fr.umlv.tatoo.runtime.lexer
Class NoLexerErrorRecoveryPolicy<R,B extends LexerBuffer>

java.lang.Object
  extended by fr.umlv.tatoo.runtime.lexer.NoLexerErrorRecoveryPolicy<R,B>
All Implemented Interfaces:
LexerErrorRecoveryPolicy<R,B>

public class NoLexerErrorRecoveryPolicy<R,B extends LexerBuffer>
extends Object
implements LexerErrorRecoveryPolicy<R,B>


Constructor Summary
NoLexerErrorRecoveryPolicy()
           
 
Method Summary
 ProcessReturn continueRecoverOnError(Lexer<B> lexer, ActionProcessor<R> processor)
          Called when error recovery was initiated by recover on error, and method LexerErrorRecoveryPolicy.errorRecoveryNeedsContinuation() returns true
 ProcessReturn continueRecoverOnUnexpectedEndOfFile(Lexer<B> lexer, ActionProcessor<R> processor)
          Called when error recovery was initiated by recover on error, and method LexerErrorRecoveryPolicy.unexpectedEndOfFileRecoveryNeedsContinuation() returns true
 boolean errorRecoveryNeedsContinuation()
          Indicate if LexerErrorRecoveryPolicy.continueRecoverOnError(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor
 void recoverOnError(Lexer<B> lexer, ActionProcessor<R> processor)
          Called when the impossible match first occurs.
 void recoverOnUnexpectedEndOfFile(Lexer<B> lexer, ActionProcessor<R> processor)
          Called when the impossible match first occurs at end of input.
 boolean unexpectedEndOfFileRecoveryNeedsContinuation()
          Indicate if LexerErrorRecoveryPolicy.continueRecoverOnUnexpectedEndOfFile(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoLexerErrorRecoveryPolicy

public NoLexerErrorRecoveryPolicy()
Method Detail

continueRecoverOnError

public ProcessReturn continueRecoverOnError(Lexer<B> lexer,
                                            ActionProcessor<R> processor)
Description copied from interface: LexerErrorRecoveryPolicy
Called when error recovery was initiated by recover on error, and method LexerErrorRecoveryPolicy.errorRecoveryNeedsContinuation() returns true

Specified by:
continueRecoverOnError in interface LexerErrorRecoveryPolicy<R,B extends LexerBuffer>
Parameters:
lexer - the lexer
processor - the action processor
Returns:
MORE if more characters are needed, ERROR, if error recovery fails and TOKEN if a new token is spawned.

continueRecoverOnUnexpectedEndOfFile

public ProcessReturn continueRecoverOnUnexpectedEndOfFile(Lexer<B> lexer,
                                                          ActionProcessor<R> processor)
Description copied from interface: LexerErrorRecoveryPolicy
Called when error recovery was initiated by recover on error, and method LexerErrorRecoveryPolicy.unexpectedEndOfFileRecoveryNeedsContinuation() returns true

Specified by:
continueRecoverOnUnexpectedEndOfFile in interface LexerErrorRecoveryPolicy<R,B extends LexerBuffer>
processor - the action processor
Returns:
MORE if more characters are needed, ERROR, if error recovery fails and TOKEN if a new token is spawned.

errorRecoveryNeedsContinuation

public boolean errorRecoveryNeedsContinuation()
Description copied from interface: LexerErrorRecoveryPolicy
Indicate if LexerErrorRecoveryPolicy.continueRecoverOnError(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor

Specified by:
errorRecoveryNeedsContinuation in interface LexerErrorRecoveryPolicy<R,B extends LexerBuffer>
Returns:
true if LexerErrorRecoveryPolicy.continueRecoverOnError(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor

recoverOnError

public void recoverOnError(Lexer<B> lexer,
                           ActionProcessor<R> processor)
Description copied from interface: LexerErrorRecoveryPolicy
Called when the impossible match first occurs. If necessary, LexerErrorRecoveryPolicy.errorRecoveryNeedsContinuation() returns true and LexerErrorRecoveryPolicy.continueRecoverOnError(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) is called

Specified by:
recoverOnError in interface LexerErrorRecoveryPolicy<R,B extends LexerBuffer>
processor - the action processor

recoverOnUnexpectedEndOfFile

public void recoverOnUnexpectedEndOfFile(Lexer<B> lexer,
                                         ActionProcessor<R> processor)
Description copied from interface: LexerErrorRecoveryPolicy
Called when the impossible match first occurs at end of input. If necessary, LexerErrorRecoveryPolicy.unexpectedEndOfFileRecoveryNeedsContinuation() returns true and LexerErrorRecoveryPolicy.continueRecoverOnUnexpectedEndOfFile(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) is called

Specified by:
recoverOnUnexpectedEndOfFile in interface LexerErrorRecoveryPolicy<R,B extends LexerBuffer>
processor - the action processor

unexpectedEndOfFileRecoveryNeedsContinuation

public boolean unexpectedEndOfFileRecoveryNeedsContinuation()
Description copied from interface: LexerErrorRecoveryPolicy
Indicate if LexerErrorRecoveryPolicy.continueRecoverOnUnexpectedEndOfFile(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor

Specified by:
unexpectedEndOfFileRecoveryNeedsContinuation in interface LexerErrorRecoveryPolicy<R,B extends LexerBuffer>
Returns:
true if LexerErrorRecoveryPolicy.continueRecoverOnUnexpectedEndOfFile(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor