Class: IV::Phonic::AST::Node

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

Instance Method Summary collapse

Constructor Details

#initialize(parent, node) ⇒ Node

Returns a new instance of Node.



21
22
23
24
25
26
# File 'lib/iv/phonic/ast.rb', line 21

def initialize parent, node
  @parent = parent
  @program = parent.program
  @begin = node[:begin]
  @end = node[:end]
end

Instance Method Details

#begin_positionObject



36
37
38
# File 'lib/iv/phonic/ast.rb', line 36

def begin_position
  @begin
end

#end_positionObject



40
41
42
# File 'lib/iv/phonic/ast.rb', line 40

def end_position
  @end
end

#programObject



32
33
34
# File 'lib/iv/phonic/ast.rb', line 32

def program
  @program
end

#sourceObject



28
29
30
# File 'lib/iv/phonic/ast.rb', line 28

def source
  @program.source
end