Module: ANTLR3::ASTBuilder

Extended by:
ClassMacros
Defined in:
lib/antlr3/modes/ast-builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


10
11
12
13
14
# File 'lib/antlr3/modes/ast-builder.rb', line 10

def self.included( klass )
  def klass.return_scope_members
    super.push( :tree )
  end
end

Instance Method Details

#initialize(input, options = {}) ⇒ Object


16
17
18
19
20
21
22
# File 'lib/antlr3/modes/ast-builder.rb', line 16

def initialize( input, options = {} )
  @adaptor = options[ :adaptor ] ||= begin
    ( input.adaptor rescue nil ) or
      AST::CommonTreeAdaptor.new( token_class )
  end
  super( input, options )
end