This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Modifier and Type | Class and Description |
|---|---|
| public static class | VirtualParser.
Scanner that does token lookahead and throws AssertionErrors if an error occurs. |
| Modifier and Type | Field and Description |
|---|---|
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| protected void | reportSyntaxError(int pos, JCDiagnostic.
Overrides com. Report a syntax using the given the position parameter and arguments, unless one was already reported at the same position. |
| protected void | reportSyntaxError(JCDiagnostic.
Overrides com. Report a syntax error using the given DiagnosticPosition object and arguments, unless one was already reported at the same position. |
| protected JCTree. | syntaxError(int pos, JCDiagnostic.
Overrides com.
|
| protected JCTree. | syntaxError(int pos, List<? extends JCTree> errs, JCDiagnostic.
Overrides com.
|
| public static boolean | Returns: true if successfulparent parser parser, Consumer<JavacParser> function that takes a parser and invokes a method on that parser parserAction)Attempts a parse action and returns true if successful or false if a parse error is thrown. |
| hasErrors | back to summary |
|---|---|
| private boolean hasErrors | |
| VirtualParser | back to summary |
|---|---|
| public VirtualParser(JavacParser parser) | |
| hasErrors | back to summary |
|---|---|
| public boolean hasErrors() | |
| reportSyntaxError | back to summary |
|---|---|
| protected void reportSyntaxError(int pos, JCDiagnostic. Overrides com. Doc from com. Report a syntax using the given the position parameter and arguments, unless one was already reported at the same position.
| |
| reportSyntaxError | back to summary |
|---|---|
| protected void reportSyntaxError(JCDiagnostic. Overrides com. Doc from com. Report a syntax error using the given DiagnosticPosition object and arguments, unless one was already reported at the same position.
| |
| syntaxError | back to summary |
|---|---|
| protected JCTree. Overrides com.
| |
| syntaxError | back to summary |
|---|---|
| protected JCTree. Overrides com.
| |
| tryParse | back to summary |
|---|---|
| public static boolean tryParse(JavacParser parser, Consumer<JavacParser> parserAction) Attempts a parse action and returns true if successful or false if a parse error is thrown.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | offset
Token offset from where parent scanner branched. |
| private Tokens. | prevToken
The previous token, set by nextToken(). |
| pack-priv Lexer | S
Parent scanner. |
| private Tokens. | token
The token, set by nextToken(). |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | errPos()
Implements com. Return the position where a lexical error occurred; |
| public void | errPos(int pos)
Implements com. Set the position where a lexical error occurred; |
| public Queue | getDocComments()
Implements com. Returns a queue for the documentation comments encountered in a compilation unit. |
| public Position. | getLineMap()
Implements com. Build a map for translating between line numbers and positions in the input. |
| public void | lintWarning(JCDiagnostic.
Implements com. Report a warning that is subject to possible suppression by |
| public void | |
| public Tokens. | prevToken()
Implements com. Return the last character position of the previous token. |
| public void | setPrevToken(Tokens.
Implements com. Sets the previous token. |
| public Tokens. | split()
Implements com. Splits the current token in two and return the first (split) token. |
| public Tokens. | |
| public Tokens. | token(int lookahead)
Implements com. Return token with given lookahead. |
| offset | back to summary |
|---|---|
| pack-priv int offset Token offset from where parent scanner branched. | |
| prevToken | back to summary |
|---|---|
| private Tokens. The previous token, set by nextToken(). | |
| S | back to summary |
|---|---|
| pack-priv Lexer S Parent scanner. | |
| token | back to summary |
|---|---|
| private Tokens. The token, set by nextToken(). | |
| VirtualScanner | back to summary |
|---|---|
| public VirtualScanner(Lexer s) | |
| errPos | back to summary |
|---|---|
| public int errPos() Implements com. Doc from com. Return the position where a lexical error occurred;
| |
| errPos | back to summary |
|---|---|
| public void errPos(int pos) Implements com. Doc from com. Set the position where a lexical error occurred;
| |
| getDocComments | back to summary |
|---|---|
| public Queue Implements com. Doc from com. Returns a queue for the documentation comments encountered in a compilation unit. Comments may be added to this queue by the implementation; clients may remove them from the queue as they are analyzed. Note all comments may also be associated with the following token.
| |
| getLineMap | back to summary |
|---|---|
| public Position. Implements com. Doc from com. Build a map for translating between line numbers and positions in the input.
| |
| lintWarning | back to summary |
|---|---|
| public void lintWarning(JCDiagnostic. Implements com. Doc from com. Report a warning that is subject to possible suppression by
| |
| nextToken | back to summary |
|---|---|
| public void nextToken() Implements com. Doc from com. Consume the next token.
| |
| prevToken | back to summary |
|---|---|
| public Tokens. Implements com. Doc from com. Return the last character position of the previous token.
| |
| setPrevToken | back to summary |
|---|---|
| public void setPrevToken(Tokens. Implements com. Doc from com. Sets the previous token.
| |
| split | back to summary |
|---|---|
| public Tokens. Implements com. Doc from com. Splits the current token in two and return the first (split) token. For instance '<<<' is split into two tokens '<' and '<<' respectively, and the latter is returned.
| |
| token | back to summary |
|---|---|
| public Tokens. Implements com. Doc from com. Return current token.
| |
| token | back to summary |
|---|---|
| public Tokens. Implements com. Doc from com. Return token with given lookahead.
| |