public class BoundedByOppositeClausesRecognizer extends RecognizerBase<ECobolParserState>
CALL a ON EXCEPTION DISPLAY b NOT ON EXCEPTION DISPLAY c
, the
parser needs to know which verb has which clause when it gets to the NOT
term. For this example the NOT ON EXCEPTION
belongs to the CALL
verb. If there was not a NOT
in the second clause, it would
belong to the DISPLAY verb because by syntax verbs cannot usually have more
than one occurrence of a clause in a statement.NO_MATCH, tailRecognizers
Constructor and Description |
---|
BoundedByOppositeClausesRecognizer() |
Modifier and Type | Method and Description |
---|---|
protected int |
matchesLocally(ParserState<ECobolParserState> parserState,
java.util.List<IToken> tokens,
int startOffset)
Attempts to match the recognizer locally (without respecting tail
recognizers).
|
createNode, createNode, createNode, debug, endNode, endNodeWithContinuation, endNodeWithContinuation, endNodeWithName, ensureTopLevel, getRecognizerStringRepresentation, markStart, matches, notPreCondition, optional, optionalSubRecognizer, parseOnce, parseStrictlyUntil, parseUntil, parseUntilOrEof, preCondition, repeated, repeatedAtLeastOnce, repeatedSubRecognizer, sequence, sequenceBefore, skipAny, skipBefore, skipBeforeWithNesting, skipBeforeWithNesting, skipBeforeWithNesting, skipBeforeWithNesting, skipBeforeWithNesting, skipBeforeWithNesting, skipForward, skipNested, skipNested, skipTo, skipToWithNesting, skipToWithNesting, skipToWithNesting, skipToWithNesting, skipWithNesting, skipWithNesting, subRecognizer, subRecognizer, toString
public BoundedByOppositeClausesRecognizer()
protected int matchesLocally(ParserState<ECobolParserState> parserState, java.util.List<IToken> tokens, int startOffset)
matchesLocally
in class RecognizerBase<ECobolParserState>
parserState
- the current state of the underlying parser.tokens
- the list of tokens.startOffset
- the current offset into the tokens from where to start matching.RecognizerBase.NO_MATCH
if matching was not possible at this position.