Class: Vertigo::AstNode

Inherits:
Object
  • Object
show all
Defined in:
lib/vertigo/ast.rb,
lib/vertigo/ast_vertigo_rkgen.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#labelObject

Returns the value of attribute label.



6
7
8
# File 'lib/vertigo/ast.rb', line 6

def label
  @label
end

#posObject

Returns the value of attribute pos.



7
8
9
# File 'lib/vertigo/ast.rb', line 7

def pos
  @pos
end

Instance Method Details

#accept(visitor, arg = nil) ⇒ Object



9
10
11
12
# File 'lib/vertigo/ast_vertigo_rkgen.rb', line 9

def accept(visitor, arg=nil)
   name = self.class.name.split(/::/).last
   visitor.send("visit#{name}".to_sym, self ,arg) # Metaprograming !
end

#strObject



14
15
16
17
# File 'lib/vertigo/ast_vertigo_rkgen.rb', line 14

def str
  ppr=PrettyPrinter.new
  self.accept(ppr)
end