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.



312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/antlr3/test/grammar.rb', line 312

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

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



310
311
312
# File 'lib/antlr3/test/grammar.rb', line 310

def command
  @command
end

#grammarObject (readonly)

Returns the value of attribute grammar.



310
311
312
# File 'lib/antlr3/test/grammar.rb', line 310

def grammar
  @grammar
end

#outputObject (readonly)

Returns the value of attribute output.



310
311
312
# File 'lib/antlr3/test/grammar.rb', line 310

def output
  @output
end

#statusObject (readonly)

Returns the value of attribute status.



310
311
312
# File 'lib/antlr3/test/grammar.rb', line 310

def status
  @status
end