Exception: ANTLR3::Test::Grammar::CompilationFailure

Inherits:
StandardError
  • Object
show all
Defined in:
lib/antlr3/test/grammar.rb

Overview

class Grammar::InlineGrammar

Constant Summary collapse

JAVA_TRACE =
/^(org\.)?antlr\.\S+\(\S+\.java:\d+\)\s*/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(grammar, command, status, output) ⇒ CompilationFailure

Returns a new instance of CompilationFailure.


318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/antlr3/test/grammar.rb', line 318

def initialize( grammar, command, status, output )
  @command = command
  @status = status
  @output = output.gsub( JAVA_TRACE, '' )
  
  message = <<-END.here_indent! % [ command, status, grammar, @output ]
  | command ``%s'' failed with status %s
  | %p
  | ~ ~ ~ command output ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
  | %s
  END
  
  super( message.chomp! || message )
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command


316
317
318
# File 'lib/antlr3/test/grammar.rb', line 316

def command
  @command
end

#grammarObject (readonly)

Returns the value of attribute grammar


316
317
318
# File 'lib/antlr3/test/grammar.rb', line 316

def grammar
  @grammar
end

#outputObject (readonly)

Returns the value of attribute output


316
317
318
# File 'lib/antlr3/test/grammar.rb', line 316

def output
  @output
end

#statusObject (readonly)

Returns the value of attribute status


316
317
318
# File 'lib/antlr3/test/grammar.rb', line 316

def status
  @status
end