Note: the transformation was done with a script.
The parser cannot seem to be regenerated.
A future move could be to use nitcc instead.
Signed-off-by: Jean Privat <jean@pryen.org>
- readable var _message: String
init init_error(message: String, loc: Location)
do
init(loc)
init init_error(message: String, loc: Location)
do
init(loc)
var _state: Int = 0
# The source file
var _state: Int = 0
# The source file
- readable var _file: SourceFile
# Current character in the stream
var _stream_pos: Int = 0
# Current character in the stream
var _stream_pos: Int = 0
# State of the parser automata as stored in the parser stack.
private class State
# The internal state number
# State of the parser automata as stored in the parser stack.
private class State
# The internal state number
- readable writable var _state: Int
# The node stored with the state in the stack
# The node stored with the state in the stack
- readable writable var _nodes: nullable Object
+ var nodes: nullable Object
init(state: Int, nodes: nullable Object)
do
init(state: Int, nodes: nullable Object)
do
- _state = state
- _nodes = nodes
+ self.state = state
+ self.nodes = nodes
- readable var _n_label_decl: nullable ALabelDecl = null
- readable var _n_comment: nullable TComment = null
+ var _n_label_decl: nullable ALabelDecl = null
+ fun n_label_decl: nullable ALabelDecl do return _n_label_decl
+ var _n_comment: nullable TComment = null
+ fun n_comment: nullable TComment do return _n_comment
end
class AInstruction
super Prod
end
class AInstruction
super Prod
- readable writable var _n_id: TId
+ var _n_id: TId
+ fun n_id: TId do return _n_id
+ fun n_id=(n_id: TId) do _n_id = n_id
init do end
end
class AOperand
super Prod
init do end
end
class AOperand
super Prod
- readable var _n_value: AValue
+ var _n_value: AValue
+ fun n_value: AValue do return _n_value
init do end
end
class AValue super Prod end
init do end
end
class AValue super Prod end
class AListing
super Prod
class AListing
super Prod
- readable var _n_lines: List[ALine] = new List[ALine]
- readable var _n_label_decl: nullable ALabelDecl = null
- readable var _n_end_block: TEndBlock
+ var _n_lines: List[ALine] = new List[ALine]
+ fun n_lines: List[ALine] do return _n_lines
+ var _n_label_decl: nullable ALabelDecl = null
+ fun n_label_decl: nullable ALabelDecl do return _n_label_decl
+ var _n_end_block: TEndBlock
+ fun n_end_block: TEndBlock do return _n_end_block
init do end
end
class AEmptyLine
super ALine
init do end
end
class AEmptyLine
super ALine
- readable var _n_eol: TEol
+ var _n_eol: TEol
+ fun n_eol: TEol do return _n_eol
init do end
end
abstract class ANonEmptyLine
init do end
end
abstract class ANonEmptyLine
end
class AInstructionLine
super ANonEmptyLine
end
class AInstructionLine
super ANonEmptyLine
- readable var _n_instruction: AInstruction
- readable var _n_eol: TEol
+ var _n_instruction: AInstruction
+ fun n_instruction: AInstruction do return _n_instruction
+ var _n_eol: TEol
+ fun n_eol: TEol do return _n_eol
init do end
end
class ADirectiveLine
super ANonEmptyLine
init do end
end
class ADirectiveLine
super ANonEmptyLine
- readable var _n_directive: ADirective
- readable var _n_eol: TEol
+ var _n_directive: ADirective
+ fun n_directive: ADirective do return _n_directive
+ var _n_eol: TEol
+ fun n_eol: TEol do return _n_eol
init do end
end
class ALabelDecl
super Prod
init do end
end
class ALabelDecl
super Prod
- readable var _n_id: TId
- readable var _n_colon: TColon
+ var _n_id: TId
+ fun n_id: TId do return _n_id
+ var _n_colon: TColon
+ fun n_colon: TColon do return _n_colon
init do end
end
class AUnaryInstruction
init do end
end
class AUnaryInstruction
end
class ABinaryInstruction
super AInstruction
end
class ABinaryInstruction
super AInstruction
- readable var _n_operand: AOperand
+ var _n_operand: AOperand
+ fun n_operand: AOperand do return _n_operand
init do end
end
class AImmediateOperand
init do end
end
class AImmediateOperand
end
class AAnyOperand
super AOperand
end
class AAnyOperand
super AOperand
- readable var _n_comma: TComma
- readable var _n_id: TId
+ var _n_comma: TComma
+ fun n_comma: TComma do return _n_comma
+ var _n_id: TId
+ fun n_id: TId do return _n_id
init do end
end
class ALabelValue
super AValue
init do end
end
class ALabelValue
super AValue
- readable var _n_id: TId
+ var _n_id: TId
+ fun n_id: TId do return _n_id
init do end
end
class ANumberValue
super AValue
init do end
end
class ANumberValue
super AValue
- readable var _n_number: TNumber
+ var _n_number: TNumber
+ fun n_number: TNumber do return _n_number
init do end
end
class ACharValue
super AValue
init do end
end
class ACharValue
super AValue
- readable var _n_char: TChar
+ var _n_char: TChar
+ fun n_char: TChar do return _n_char
init do end
end
class AStringValue
super AValue
init do end
end
class AStringValue
super AValue
- readable var _n_string: TString
+ var _n_string: TString
+ fun n_string: TString do return _n_string
init do end
end
class AHexValue
super AValue
init do end
end
class AHexValue
super AValue
- readable var _n_hex: THex
+ var _n_hex: THex
+ fun n_hex: THex do return _n_hex
init do end
end
class AByteDirective
super ADirective
init do end
end
class AByteDirective
super ADirective
- readable var _n_tk_byte: TTkByte
- readable var _n_value: AValue
+ var _n_tk_byte: TTkByte
+ fun n_tk_byte: TTkByte do return _n_tk_byte
+ var _n_value: AValue
+ fun n_value: AValue do return _n_value
init do end
end
class AWordDirective
super ADirective
init do end
end
class AWordDirective
super ADirective
- readable var _n_tk_word: TTkWord
- readable var _n_value: AValue
+ var _n_tk_word: TTkWord
+ fun n_tk_word: TTkWord do return _n_tk_word
+ var _n_value: AValue
+ fun n_value: AValue do return _n_value
init do end
end
class ABlockDirective
super ADirective
init do end
end
class ABlockDirective
super ADirective
- readable var _n_tk_block: TTkBlock
- readable var _n_value: AValue
+ var _n_tk_block: TTkBlock
+ fun n_tk_block: TTkBlock do return _n_tk_block
+ var _n_value: AValue
+ fun n_value: AValue do return _n_value
init do end
end
class AAsciiDirective
super ADirective
init do end
end
class AAsciiDirective
super ADirective
- readable var _n_tk_ascii: TTkAscii
- readable var _n_value: AValue
+ var _n_tk_ascii: TTkAscii
+ fun n_tk_ascii: TTkAscii do return _n_tk_ascii
+ var _n_value: AValue
+ fun n_value: AValue do return _n_value
init do end
end
class AAddrssDirective
super ADirective
init do end
end
class AAddrssDirective
super ADirective
- readable var _n_tk_addrss: TTkAddrss
- readable var _n_value: AValue
+ var _n_tk_addrss: TTkAddrss
+ fun n_tk_addrss: TTkAddrss do return _n_tk_addrss
+ var _n_value: AValue
+ fun n_value: AValue do return _n_value
init do end
end
class AEquateDirective
super ADirective
init do end
end
class AEquateDirective
super ADirective
- readable var _n_tk_equate: TTkEquate
- readable var _n_value: AValue
+ var _n_tk_equate: TTkEquate
+ fun n_tk_equate: TTkEquate do return _n_tk_equate
+ var _n_value: AValue
+ fun n_value: AValue do return _n_value
init do end
end
class ABurnDirective
super ADirective
init do end
end
class ABurnDirective
super ADirective
- readable var _n_tk_burn: TTkBurn
- readable var _n_value: AValue
+ var _n_tk_burn: TTkBurn
+ fun n_tk_burn: TTkBurn do return _n_tk_burn
+ var _n_value: AValue
+ fun n_value: AValue do return _n_value
init do end
end
class Start
super Prod
init do end
end
class Start
super Prod
- readable var _n_base: nullable AListing
- readable var _n_eof: EOF
+ var _n_base: nullable AListing
+ fun n_base: nullable AListing do return _n_base
+ var _n_eof: EOF
+ fun n_eof: EOF do return _n_eof
init(n_base: nullable AListing, n_eof: EOF)
do
super
init(n_base: nullable AListing, n_eof: EOF)
do
super
redef class ANode
# Parent of the node in the AST
redef class ANode
# Parent of the node in the AST
- readable writable var _parent: nullable ANode
+ var _parent: nullable ANode
+ fun parent: nullable ANode do return _parent
+ fun parent=(p: nullable ANode) do _parent = p
# Remove a child from the AST
fun remove_child(child: ANode)
# Remove a child from the AST
fun remove_child(child: ANode)
# This methos should not be redefined
fun enter_visit(e: nullable ANode)
do
# This methos should not be redefined
fun enter_visit(e: nullable ANode)
do
- var old = _current_node
- _current_node = e
+ var old = current_node
+ current_node = e
end
# The current visited node
end
# The current visited node
- readable var _current_node: nullable ANode = null
+ var current_node: nullable ANode = null