|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.runtime.parser.ParserErrorRecoveryPolicy<T,N,P,V>
T
- type of terminals.N
- type of non-terminal.P
- type of productions.V
- type of versions.public abstract class ParserErrorRecoveryPolicy<T,N,P,V>
Error recovery policy of the parser.
Parser.createParser(ParserTable,ParserListener,ParserErrorRecoveryPolicy,Object,Object,LookaheadMap)
Constructor Summary | |
---|---|
ParserErrorRecoveryPolicy()
|
Method Summary | ||
---|---|---|
abstract boolean |
closeParser(Parser<T,N,P,V> parser)
Notifies that the parser is closing and an error was notified by continueRecoverOnError(fr.umlv.tatoo.runtime.parser.Parser
returning ActionReturn.NEXT_ERROR . |
|
abstract ActionReturn |
continueRecoverOnError(Parser<T,N,P,V> parser,
IntArrayList states,
T terminal)
Called when error recovery was initiated by recover on error, and method errorRecoveryNeedsContinuation()
returns true |
|
abstract boolean |
errorRecoveryNeedsContinuation()
Indicate if continueRecoverOnError(fr.umlv.tatoo.runtime.parser.Parser needs to be called by processor |
|
abstract Set<? extends T> |
getLookahead(Parser<T,N,P,V> parser,
Set<? extends T> proposedLookaheads)
Returns the lookahead set of terminals that the parser should accept as input of next Parser.step() . |
|
static
|
getNoErrorRecoveryPolicy(ParserWarningReporter<T,N,P,V> warningReporter)
Returns an error recover policy that doesn't recover errors. |
|
abstract ActionReturn |
recoverOnError(Parser<T,N,P,V> parser,
IntArrayList states,
T terminal,
String message)
Tries to recover on an error. |
|
abstract void |
reset()
Reset the error recovery policy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParserErrorRecoveryPolicy()
Method Detail |
---|
public abstract boolean errorRecoveryNeedsContinuation()
continueRecoverOnError(fr.umlv.tatoo.runtime.parser.Parser, fr.umlv.tatoo.runtime.util.IntArrayList, T)
needs to be called by processor
continueRecoverOnError(fr.umlv.tatoo.runtime.parser.Parser, fr.umlv.tatoo.runtime.util.IntArrayList, T)
needs to be called by processorpublic abstract ActionReturn recoverOnError(Parser<T,N,P,V> parser, IntArrayList states, T terminal, String message)
true
if error recovery started and/or succeeded, false
if lexer must skip some input. This method may
throw a ParseException to signify a fatal error.
parser
- the parser.states
- the state stack of the parser.terminal
- the terminal that caused the error or null
if no terminal is available.
NEXT
if lexer must skip some input.public abstract ActionReturn continueRecoverOnError(Parser<T,N,P,V> parser, IntArrayList states, T terminal)
errorRecoveryNeedsContinuation()
returns true
parser
- the parser.states
- the state stack of the parser.terminal
- current terminal, argument of
Parser.step(terminal)
or null.
NEXT
if the terminal must be skipped by the parser,
KEEP
otherwise.public abstract boolean closeParser(Parser<T,N,P,V> parser)
continueRecoverOnError(fr.umlv.tatoo.runtime.parser.Parser, fr.umlv.tatoo.runtime.util.IntArrayList, T)
returning ActionReturn.NEXT_ERROR
.
This method is called in Parser.close()
.
parser
- the parser.
Parser.close()
public abstract Set<? extends T> getLookahead(Parser<T,N,P,V> parser, Set<? extends T> proposedLookaheads)
Parser.step()
.
parser
- the parser.proposedLookaheads
- the lookahead set of terminal
of current parser state when there is no error.
null
for all terminals.public abstract void reset()
Parser.reset(Object)
public static <T,N,P,V> ParserErrorRecoveryPolicy<T,N,P,V> getNoErrorRecoveryPolicy(ParserWarningReporter<T,N,P,V> warningReporter)
T
- type of terminals.N
- type of non-terminals.P
- type of productions.V
- type of versions.warningReporter
- a reporter that will display a warning or null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |