module ANTLR3::Test::NameSpace

Public Instance Methods

import( ruby_file ) click to toggle source

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.

# File lib/antlr3/test/functional.rb, line 44
def import( ruby_file )
  constants_before = constants
  class_eval( File.read( ruby_file ), ruby_file, 1 )
  constants - constants_before
end
import_grammar_targets( grammar ) click to toggle source
# File lib/antlr3/test/functional.rb, line 50
def import_grammar_targets( grammar )
  for file in grammar.target_files
    import( file )
  end
end