Module: ANTLR3::Test::NameSpace

Included in:
GrammarManager
Defined in:
lib/antlr3/test/functional.rb

Overview

module Location

Instance Method Summary (collapse)

Instance Method Details

- (Object) import(ruby_file)

import( ruby_file ) => [ new constants, ... ] Read the source code from the path given by ruby_file and evaluate it within the class body. Return new constants created in the class after the evaluation.



43
44
45
46
47
# File 'lib/antlr3/test/functional.rb', line 43

def import( ruby_file )
  constants_before = constants
  class_eval( File.read( ruby_file ), ruby_file, 1 )
  constants - constants_before
end

- (Object) import_grammar_targets(grammar)



49
50
51
52
53
# File 'lib/antlr3/test/functional.rb', line 49

def import_grammar_targets( grammar )
  for file in grammar.target_files
    import( file )
  end
end