Exception: ANTLR3::Test::Grammar::FormatError
- Inherits:
-
StandardError
- Object
- StandardError
- ANTLR3::Test::Grammar::FormatError
- Defined in:
- lib/antlr3/test/grammar.rb
Overview
error Grammar::CompilationFailure
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source, file = nil) ⇒ FormatError
constructor
A new instance of FormatError.
Constructor Details
#initialize(source, file = nil) ⇒ FormatError
Returns a new instance of FormatError.
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/antlr3/test/grammar.rb', line 341 def initialize( source, file = nil ) @file = file @source = source = '' if file.nil? # inline << "bad inline grammar source:\n" << ( "-" * 80 ) << "\n" << @source [ -1 ] == ?\n or << "\n" << ( "-" * 80 ) << "\n" << "could not locate a grammar name and type declaration matching\n" << "/^\s*(lexer|parser|tree)?\s*grammar\s*(\S+)\s*;/" else << 'bad grammar source in file %p' % @file << ( "-" * 80 ) << "\n" << @source [ -1 ] == ?\n or << "\n" << ( "-" * 80 ) << "\n" << "could not locate a grammar name and type declaration matching\n" << "/^\s*(lexer|parser|tree)?\s*grammar\s*(\S+)\s*;/" end super( ) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
335 336 337 |
# File 'lib/antlr3/test/grammar.rb', line 335 def file @file end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
335 336 337 |
# File 'lib/antlr3/test/grammar.rb', line 335 def source @source end |
Class Method Details
.[](*args) ⇒ Object
337 338 339 |
# File 'lib/antlr3/test/grammar.rb', line 337 def self.[]( *args ) new( *args ) end |