class ANTLR3::Error::EarlyExit
- error
- used by
-
all recognizers
- occurs when
-
The recognizer is in a
(..)+
subrule, meaning the recognizer must match the body of the subrule one or more times. If it fails to match at least one occurence of the subrule, the recognizer will raise anEarlyExit
exception.
Example¶ ↑
consider a grammar like:
lexer grammar EarlyExitDemo; ... ID: 'a'..'z' ('0'..'9')+;
now in ruby
require 'EarlyExitDemo' input = ANTLR3::StringStream.new( "ab" ) lexer = EarlyExitDemo::Lexer.new( input ) lexer.next_token # -> raises EarlyExit: line 1:1 required (...)+ loop did not match # anything at character "b"
Attributes
decision_number[RW]
Public Class Methods
new( decision_number, input )
click to toggle source
Calls superclass method
ANTLR3::Error::RecognitionError::new
# File lib/antlr3/error.rb, line 449 def initialize( decision_number, input ) @decision_number = decision_number super( input ) end
Public Instance Methods
message()
click to toggle source
# File lib/antlr3/error.rb, line 454 def message "The recognizer did not match anything for a (..)+ loop." end