Class JavaccTokenDocument
- java.lang.Object
-
- net.sourceforge.pmd.lang.ast.impl.TokenDocument<JavaccToken>
-
- net.sourceforge.pmd.lang.ast.impl.javacc.JavaccTokenDocument
-
public final class JavaccTokenDocument extends TokenDocument<JavaccToken>
Token document for Javacc implementations. This is a helper object for generated token managers. Note: the extension point is a custom implementation ofJavaccTokenDocument.TokenDocumentBehavior
, seeJjtreeParserAdapter.tokenBehavior()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaccTokenDocument.TokenDocumentBehavior
Overridable configuration of a token document.
-
Constructor Summary
Constructors Constructor Description JavaccTokenDocument(TextDocument textDocument, JavaccTokenDocument.TokenDocumentBehavior behavior)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaccToken
createToken(int kind, CharStream cs, @Nullable String image)
@NonNull String
describeKind(int kind)
JavaccToken
getFirstToken()
Returns the first token of the token chain.JavaccToken
open()
Open the document.-
Methods inherited from class net.sourceforge.pmd.lang.ast.impl.TokenDocument
getFullText, getTextDocument
-
-
-
-
Constructor Detail
-
JavaccTokenDocument
public JavaccTokenDocument(TextDocument textDocument, JavaccTokenDocument.TokenDocumentBehavior behavior)
-
-
Method Detail
-
open
public JavaccToken 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
public JavaccToken getFirstToken()
Description copied from class:TokenDocument
Returns the first token of the token chain.- Specified by:
getFirstToken
in classTokenDocument<JavaccToken>
-
describeKind
public @NonNull String describeKind(int kind)
-
createToken
public JavaccToken createToken(int kind, CharStream cs, @Nullable String image)
-
-