Exception: ANTLR3::CompileTask::GrammarFile::FormatError
- Inherits:
-
StandardError
- Object
- StandardError
- ANTLR3::CompileTask::GrammarFile::FormatError
- Defined in:
- lib/antlr3/task.rb
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.
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 |
# File 'lib/antlr3/task.rb', line 473 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\n' % @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.
467 468 469 |
# File 'lib/antlr3/task.rb', line 467 def file @file end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
467 468 469 |
# File 'lib/antlr3/task.rb', line 467 def source @source end |
Class Method Details
.[](*args) ⇒ Object
469 470 471 |
# File 'lib/antlr3/task.rb', line 469 def self.[]( *args ) new( *args ) end |