Exception: ANTLR3::Error::FailedPredicate
- Inherits:
-
RecognitionError
- Object
- StandardError
- RecognitionError
- ANTLR3::Error::FailedPredicate
- Defined in:
- lib/antlr3/error.rb
Overview
- error
-
FailedPredicate
- used by
-
all recognizers
- occurs when
-
A recognizer is in a rule with a predicate action element, and the predicating action code evaluated to a
false
value.
Constant Summary
Constants included from Constants
Constants::BUILT_IN_TOKEN_NAMES, Constants::DEFAULT, Constants::DOWN, Constants::EOF, Constants::EOF_TOKEN, Constants::EOR_TOKEN_TYPE, Constants::HIDDEN, Constants::INVALID, Constants::INVALID_NODE, Constants::INVALID_TOKEN, Constants::MEMO_RULE_FAILED, Constants::MEMO_RULE_UNKNOWN, Constants::MIN_TOKEN_TYPE, Constants::SKIP_TOKEN, Constants::UP
Instance Attribute Summary collapse
-
#input ⇒ Object
Returns the value of attribute input.
-
#predicate_text ⇒ Object
Returns the value of attribute predicate_text.
-
#rule_name ⇒ Object
Returns the value of attribute rule_name.
Attributes inherited from RecognitionError
#column, #index, #line, #source_name, #symbol, #token
Instance Method Summary collapse
-
#initialize(input, rule_name, predicate_text) ⇒ FailedPredicate
constructor
A new instance of FailedPredicate.
- #inspect ⇒ Object
- #message ⇒ Object
Methods inherited from RecognitionError
#approximate_line_info?, #location, #unexpected_type
Constructor Details
#initialize(input, rule_name, predicate_text) ⇒ FailedPredicate
Returns a new instance of FailedPredicate.
472 473 474 475 476 |
# File 'lib/antlr3/error.rb', line 472 def initialize( input, rule_name, predicate_text ) @rule_name = rule_name @predicate_text = predicate_text super( input ) end |
Instance Attribute Details
#input ⇒ Object
Returns the value of attribute input.
471 472 473 |
# File 'lib/antlr3/error.rb', line 471 def input @input end |
#predicate_text ⇒ Object
Returns the value of attribute predicate_text.
471 472 473 |
# File 'lib/antlr3/error.rb', line 471 def predicate_text @predicate_text end |
#rule_name ⇒ Object
Returns the value of attribute rule_name.
471 472 473 |
# File 'lib/antlr3/error.rb', line 471 def rule_name @rule_name end |
Instance Method Details
#inspect ⇒ Object
478 479 480 |
# File 'lib/antlr3/error.rb', line 478 def inspect '%s(%s, { %s }?)' % [ self.class.name, @rule_name, @predicate_text ] end |
#message ⇒ Object
482 483 484 |
# File 'lib/antlr3/error.rb', line 482 def "rule #@rule_name failed predicate: { #@predicate_text }?" end |