| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum | |
| pack-priv static interface | ParseContext.
Allows tracing of parsing progress during error condition, to ease debugging. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | at
The current position of the input. |
| private int | |
| private int | |
| private TreeNode | |
| private ParseContext. | |
| private String | |
| pack-priv static final String | |
| private final ArrayList | |
| private boolean | |
| pack-priv final SourceLocator | |
| pack-priv final String | |
| private ParseContext. | |
| pack-priv Object | result
The current parse result. |
| pack-priv final CharSequence | |
| pack-priv int | step
The current logical step. |
| private ParseContext. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | applyNewNode(Parser<?> parser, String name)
Applies |
| pack-priv final ParseTree | |
| pack-priv final ParseTree | |
| pack-priv abstract CharSequence | |
| private void | |
| pack-priv final void | enableTrace(final String rootName)
Enables parse tree tracing with |
| pack-priv final int | |
| pack-priv final void | |
| pack-priv final void | |
| private String | |
| pack-priv final int | |
| pack-priv abstract String | |
| pack-priv abstract Token | |
| pack-priv final ParseContext. | |
| pack-priv abstract boolean | |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv abstract char | |
| pack-priv final void | |
| pack-priv final ParseErrorDetails | |
| pack-priv final boolean | |
| pack-priv final <T> boolean | |
| pack-priv final void | |
| pack-priv final void | |
| private void | |
| private void | |
| pack-priv final boolean | |
| pack-priv abstract int | |
| public String | |
| pack-priv final void | |
| pack-priv final boolean |
| at | back to summary |
|---|---|
| pack-priv int at The current position of the input. Points to the token array for token level. | |
| currentErrorAt | back to summary |
|---|---|
| private int currentErrorAt | |
| currentErrorIndex | back to summary |
|---|---|
| private int currentErrorIndex | |
| currentErrorNode | back to summary |
|---|---|
| private TreeNode currentErrorNode | |
| currentErrorType | back to summary |
|---|---|
| private ParseContext. | |
| encountered | back to summary |
|---|---|
| private String encountered | |
| EOF | back to summary |
|---|---|
| pack-priv static final String EOF | |
| errors | back to summary |
|---|---|
| private final ArrayList<Object> errors | |
| errorSuppressed | back to summary |
|---|---|
| private boolean errorSuppressed | |
| locator | back to summary |
|---|---|
| pack-priv final SourceLocator locator | |
| module | back to summary |
|---|---|
| pack-priv final String module | |
| overrideErrorType | back to summary |
|---|---|
| private ParseContext. | |
| result | back to summary |
|---|---|
| pack-priv Object result The current parse result. | |
| source | back to summary |
|---|---|
| pack-priv final CharSequence source | |
| step | back to summary |
|---|---|
| pack-priv int step The current logical step. | |
| trace | back to summary |
|---|---|
| private ParseContext. | |
| ParseContext | back to summary |
|---|---|
| pack-priv ParseContext(CharSequence source, int at, String module, SourceLocator locator) | |
| ParseContext | back to summary |
|---|---|
| pack-priv ParseContext(CharSequence source, Object ret, int at, String module, SourceLocator locator) | |
| applyAsDelimiter | back to summary |
|---|---|
| pack-priv final boolean applyAsDelimiter(Parser<?> parser) Runs | |
| applyNested | back to summary |
|---|---|
| pack-priv final boolean applyNested(Parser<?> parser, ParseContext nestedState) | |
| applyNewNode | back to summary |
|---|---|
| pack-priv final boolean applyNewNode(Parser<?> parser, String name) Applies | |
| buildErrorParseTree | back to summary |
|---|---|
| pack-priv final ParseTree buildErrorParseTree() | |
| buildParseTree | back to summary |
|---|---|
| pack-priv final ParseTree buildParseTree() | |
| characters | back to summary |
|---|---|
| pack-priv abstract CharSequence characters() Reads the characters as input. Only applicable to character level parsers. | |
| copyErrorFrom | back to summary |
|---|---|
| private void copyErrorFrom(ParseContext that) | |
| enableTrace | back to summary |
|---|---|
| pack-priv final void enableTrace(final String rootName) Enables parse tree tracing with | |
| errorIndex | back to summary |
|---|---|
| pack-priv final int errorIndex() The physical index of the current most relevant error, | |
| expected | back to summary |
|---|---|
| pack-priv final void expected(Object what) | |
| fail | back to summary |
|---|---|
| pack-priv final void fail(String message) | |
| getEncountered | back to summary |
|---|---|
| private String getEncountered() | |
| getIndex | back to summary |
|---|---|
| pack-priv final int getIndex() Returns the current index in the original source. | |
| getInputName | back to summary |
|---|---|
| pack-priv abstract String getInputName(int pos) Returns the string representation of the current input (character or token). | |
| getToken | back to summary |
|---|---|
| pack-priv abstract Token getToken() Returns the current token. Only applicable to token level parser. | |
| getTrace | back to summary |
|---|---|
| pack-priv final ParseContext. | |
| isEof | back to summary |
|---|---|
| pack-priv abstract boolean isEof() | |
| missing | back to summary |
|---|---|
| pack-priv final void missing(Object what) | |
| next | back to summary |
|---|---|
| pack-priv final void next() | |
| next | back to summary |
|---|---|
| pack-priv final void next(int n) | |
| peekChar | back to summary |
|---|---|
| pack-priv abstract char peekChar() Peeks the current character. Only applicable to character level parser. | |
| raise | back to summary |
|---|---|
pack-priv final void raise(ParseContext.
| |
| renderError | back to summary |
|---|---|
| pack-priv final ParseErrorDetails renderError() Only called when rendering the error in | |
| repeat | back to summary |
|---|---|
| pack-priv final boolean repeat(Parser<?> parser, int n) | |
| repeat | back to summary |
|---|---|
| pack-priv final <T> boolean repeat(Parser<? extends T> parser, int n, Collection<T> collection) | |
| set | back to summary |
|---|---|
| pack-priv final void set(int step, int at, Object ret) | |
| setAt | back to summary |
|---|---|
| pack-priv final void setAt(int step, int at) | |
| setErrorState | back to summary |
|---|---|
| private void setErrorState(int errorAt, int errorIndex, ParseContext. | |
| setErrorState | back to summary |
|---|---|
| private void setErrorState(int errorAt, int errorIndex, ParseContext. | |
| stillThere | back to summary |
|---|---|
| pack-priv final boolean stillThere(int wasAt, int originalStep) | |
| toIndex | back to summary |
|---|---|
| pack-priv abstract int toIndex(int pos) Translates the logical position to physical index in the original source. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| unexpected | back to summary |
|---|---|
| pack-priv final void unexpected(String what) | |
| withErrorSuppressed | back to summary |
|---|---|
| pack-priv final boolean withErrorSuppressed(Parser<?> parser) Runs | |
| Modifier and Type | Field and Description |
|---|---|
| public static final ParseContext. | DELIMITING
When the error is mostly lenient (as a delimiter of repetitions for example). |
| public static final ParseContext. | EXPECTING
When |
| public static final ParseContext. | FAILURE
When |
| pack-priv final boolean | |
| public static final ParseContext. | MISSING
When any expected input isn't found. |
| public static final ParseContext. | NONE
Default value, no error. |
| public static final ParseContext. | UNEXPECTED
When |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ParseContext. | |
| public static ParseContext. |
| DELIMITING | back to summary |
|---|---|
| public static final ParseContext. When the error is mostly lenient (as a delimiter of repetitions for example). | |
| EXPECTING | back to summary |
|---|---|
| public static final ParseContext. When | |
| FAILURE | back to summary |
|---|---|
| public static final ParseContext. When | |
| mergeable | back to summary |
|---|---|
| pack-priv final boolean mergeable | |
| MISSING | back to summary |
|---|---|
| public static final ParseContext. When any expected input isn't found. | |
| NONE | back to summary |
|---|---|
| public static final ParseContext. Default value, no error. | |
| UNEXPECTED | back to summary |
|---|---|
| public static final ParseContext. When | |
| ErrorType | back to summary |
|---|---|
| private ErrorType(boolean mergeable) | |
| valueOf | back to summary |
|---|---|
| public static ParseContext. | |
| values | back to summary |
|---|---|
| public static ParseContext. | |
| Modifier and Type | Method and Description |
|---|---|
| public TreeNode | |
| public TreeNode | getLatestChild()
Called by branching parsers, to save the current state of tree, before trying parsers that could modify the tree state. |
| public void | |
| public void | push(String name)
Upon applying a parser with |
| public void | setCurrentResult(Object result)
Whenever a labeled parser succeeds, it calls this method to set its result in the trace. |
| public void | setLatestChild(TreeNode node)
Called by labeled parser to reset the current child node when the current node failed. |
| public void | setStateAs(ParseContext.
Set the enclosing parser's tree state into the nested parser's state. |
| public void |
| getCurrentNode | back to summary |
|---|---|
| public TreeNode getCurrentNode() Returns the current node, that is being parsed (not necessarily finished). | |
| getLatestChild | back to summary |
|---|---|
| public TreeNode getLatestChild() Called by branching parsers, to save the current state of tree, before trying parsers that could modify the tree state. | |
| pop | back to summary |
|---|---|
| public void pop() When a parser finishes, the current node is popped so we are back to the parent parser. | |
| push | back to summary |
|---|---|
| public void push(String name) Upon applying a parser with | |
| setCurrentResult | back to summary |
|---|---|
| public void setCurrentResult(Object result) Whenever a labeled parser succeeds, it calls this method to set its result in the trace. | |
| setLatestChild | back to summary |
|---|---|
| public void setLatestChild(TreeNode node) Called by labeled parser to reset the current child node when the current node failed.
Also called by | |
| setStateAs | back to summary |
|---|---|
| public void setStateAs(ParseContext. Set the enclosing parser's tree state into the nested parser's state. Called for both nested token-level parser and nested scanner. | |
| startFresh | back to summary |
|---|---|
| public void startFresh(ParseContext context) Called when tokenizer passes on to token-level parser. | |