fr.umlv.tatoo.runtime.lexer
Interface LexerErrorRecoveryPolicy<R,B extends LexerBuffer>

All Known Implementing Classes:
DefaultLexerErrorRecoveryPolicy, NoLexerErrorRecoveryPolicy

public interface LexerErrorRecoveryPolicy<R,B extends LexerBuffer>


Method Summary
 ProcessReturn continueRecoverOnError(Lexer<B> lexer, ActionProcessor<R> processor)
          Called when error recovery was initiated by recover on error, and method errorRecoveryNeedsContinuation() returns true
 ProcessReturn continueRecoverOnUnexpectedEndOfFile(Lexer<B> lexer, ActionProcessor<R> processor)
          Called when error recovery was initiated by recover on error, and method unexpectedEndOfFileRecoveryNeedsContinuation() returns true
 boolean errorRecoveryNeedsContinuation()
          Indicate if 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 continueRecoverOnUnexpectedEndOfFile(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor
 

Method Detail

recoverOnError

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

Parameters:
processor - the action processor

continueRecoverOnError

ProcessReturn continueRecoverOnError(Lexer<B> lexer,
                                     ActionProcessor<R> processor)
Called when error recovery was initiated by recover on error, and method errorRecoveryNeedsContinuation() returns true

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.

errorRecoveryNeedsContinuation

boolean errorRecoveryNeedsContinuation()
Indicate if continueRecoverOnError(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor

Returns:
true if continueRecoverOnError(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor

recoverOnUnexpectedEndOfFile

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

Parameters:
processor - the action processor

continueRecoverOnUnexpectedEndOfFile

ProcessReturn continueRecoverOnUnexpectedEndOfFile(Lexer<B> lexer,
                                                   ActionProcessor<R> processor)
Called when error recovery was initiated by recover on error, and method unexpectedEndOfFileRecoveryNeedsContinuation() returns true

Parameters:
processor - the action processor
Returns:
MORE if more characters are needed, ERROR, if error recovery fails and TOKEN if a new token is spawned.

unexpectedEndOfFileRecoveryNeedsContinuation

boolean unexpectedEndOfFileRecoveryNeedsContinuation()
Indicate if continueRecoverOnUnexpectedEndOfFile(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor

Returns:
true if continueRecoverOnUnexpectedEndOfFile(fr.umlv.tatoo.runtime.lexer.Lexer, fr.umlv.tatoo.runtime.lexer.rules.ActionProcessor) needs to be called by processor