Class JavaccTokenDocument
java.lang.Object
net.sourceforge.pmd.lang.ast.impl.TokenDocument<JavaccToken>
net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument
Token document for Javacc implementations. This is a helper object
for generated token managers. Note: the extension point is a custom
implementation of
JavaccTokenDocument.TokenDocumentBehavior, see JjtreeParserAdapter.tokenBehavior().-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOverridable configuration of a token document. -
Constructor Summary
ConstructorsConstructorDescriptionJavaccTokenDocument(TextDocument textDocument, JavaccTokenDocument.TokenDocumentBehavior behavior) -
Method Summary
Modifier and TypeMethodDescriptioncreateToken(int kind, CharStream cs, @Nullable String image) @NonNull StringdescribeKind(int kind) Returns the first token of the token chain.open()Open the document.Methods inherited from class net.sourceforge.pmd.lang.ast.impl.TokenDocument
getFullText, getTextDocument
-
Constructor Details
-
JavaccTokenDocument
public JavaccTokenDocument(TextDocument textDocument, JavaccTokenDocument.TokenDocumentBehavior behavior)
-
-
Method Details
-
open
Open the document. This is only meant to be used by a Javacc-generated parser.- Returns:
- The token for the document start. This token is implicit and will never end up in the final token chain.
- Throws:
IllegalStateException- If the document has already been opened
-
getFirstToken
Description copied from class:TokenDocumentReturns the first token of the token chain.- Specified by:
getFirstTokenin classTokenDocument<JavaccToken>
-
describeKind
- See Also:
-
createToken
- See Also:
-