|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.runtime.tools.ParserForwarder<T,B>
public class ParserForwarder<T,B extends LexerBuffer>
This class implements a lexer error handler and a lexer lifecycle handler.
The lexer error handler part forwards error to the parser branching mechanism
(see SimpleParser.branchOnError(Object, String)
) or
error recovery mechanism.
The lifecycle handler part forwards the close
(resp.
reset
) event in order to
close
(resp. reset
)
the parser.
Constructor Summary | |
---|---|
ParserForwarder(SimpleParser<T> parser)
Creates a parser forwarder. |
Method Summary | |
---|---|
ForwardReturn |
forwardUnexpectedCharacter(Lexer<B> lexer)
Forwards unexpected character found during the lexing process. |
void |
forwardUnexpectedEndOfFile(Lexer<B> lexer)
Forwards unexpected end of file during the lexing process. |
void |
handleClose(Lexer<B> lexer)
Called after the lexer is closed. |
void |
handleReset(Lexer<B> lexer)
Called after the lexer is reseted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParserForwarder(SimpleParser<T> parser)
parser
- the parser that will be notifiedMethod Detail |
---|
public ForwardReturn forwardUnexpectedCharacter(Lexer<B> lexer)
SimpleParser.branchOnError(Object, String)
forwardUnexpectedCharacter
in interface ErrorForwarder<B extends LexerBuffer>
lexer
- the buffer that push the character
false
if lexer must discard inputpublic void forwardUnexpectedEndOfFile(Lexer<B> lexer)
SimpleParser.branchOnError(Object, String)
.
forwardUnexpectedEndOfFile
in interface ErrorForwarder<B extends LexerBuffer>
lexer
- the bufferpublic void handleReset(Lexer<B> lexer)
handleReset
in interface LifecycleHandler<B extends LexerBuffer>
Lexer.reset(fr.umlv.tatoo.runtime.buffer.LexerBuffer)
public void handleClose(Lexer<B> lexer)
handleClose
in interface LifecycleHandler<B extends LexerBuffer>
SimpleLexer.close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |