Class: Malady::AST::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/malady/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filenameObject (readonly)

Returns the value of attribute filename.



4
5
6
# File 'lib/malady/ast.rb', line 4

def filename
  @filename
end

#lineObject (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