Class: ANTLR3::Test::Functional

Inherits:
Test::Unit::TestCase
  • Object
show all
Extended by:
GrammarManager
Defined in:
lib/antlr3/test/functional.rb

Overview

module GrammarManager

Constant Summary

Constants included from GrammarManager

GrammarManager::DEFAULT_COMPILE_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from GrammarManager

add_default_compile_option, compile, compile_options, const_missing, grammar_count, grammars, load_grammar

Methods included from NameSpace

#import, #import_grammar_targets

Methods included from Location

#test_directory, #test_group

Class Method Details

.inherited(klass) ⇒ Object


158
159
160
161
# File 'lib/antlr3/test/functional.rb', line 158

def self.inherited( klass )
  super
  klass.test_path = call_stack[ 0 ].file
end

Instance Method Details

#compile_and_load(grammar, options = {}) ⇒ Object


183
184
185
# File 'lib/antlr3/test/functional.rb', line 183

def compile_and_load( grammar, options = {} )
  self.class.compile( grammar, options )
end

#inline_grammar(source) ⇒ Object


175
176
177
178
179
180
181
# File 'lib/antlr3/test/functional.rb', line 175

def inline_grammar( source )
  call = call_stack.find { |call| call.file != __FILE__ }
  grammar = Grammar.inline source,
              :output_directory => output_directory,
              :file => call.file,
              :line => call.line
end

#local_path(*args) ⇒ Object


163
164
165
# File 'lib/antlr3/test/functional.rb', line 163

def local_path( *args )
  self.class.local_path( *args )
end

#output_directoryObject


171
172
173
# File 'lib/antlr3/test/functional.rb', line 171

def output_directory
  self.class.output_directory
end

#test_pathObject


167
168
169
# File 'lib/antlr3/test/functional.rb', line 167

def test_path
  self.class.test_path
end