Class: Malady::AST::Node
- Inherits:
-
Object
- Object
- Malady::AST::Node
- Defined in:
- lib/malady/ast.rb
Direct Known Subclasses
AssignNode, BinaryNode, FalseBooleanNode, FnNode, FunctionCallNode, IfNode, IntegerNode, Program, SymbolNode, TrueBooleanNode
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize(filename = "(script)", line = 1, *args) ⇒ Node
constructor
A new instance of Node.
- #pos(g) ⇒ Object
Constructor Details
#initialize(filename = "(script)", line = 1, *args) ⇒ Node
Returns a new instance of Node.
6 7 8 9 |
# File 'lib/malady/ast.rb', line 6 def initialize(filename="(script)", line=1, *args) @filename = filename @line = line end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
4 5 6 |
# File 'lib/malady/ast.rb', line 4 def filename @filename end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
4 5 6 |
# File 'lib/malady/ast.rb', line 4 def line @line end |
Instance Method Details
#pos(g) ⇒ Object
11 12 13 |
# File 'lib/malady/ast.rb', line 11 def pos(g) g.set_line line end |