private final void error ( ) throws ParserException { Integer currentState = stateStack . peek ( ) ; parserErrors . addError ( currentState ) ; if ( backtrackEnabled && ! backtrackStack . isEmpty ( ) ) { trackBack ( ) ; return ; } if ( ! backtrackEnabled ) { logger . trace ( "No valid action available and back tracking is disabled. Aborting near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'..." ) ; } else { logger . trace ( "No valid action available and back tracking stack is empty. Aborting near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'..." ) ; } throw new ParserException ( "Error! Could not parse the token stream near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'!" ) ; }
This method is called for an error action .