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(),JavaCCTokenizer.tokenBehavior()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJavaccTokenDocument.TokenDocumentBehaviorOverridable 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 JavaccTokencreateToken(int kind, CharStream cs, @Nullable String image)@NonNull StringdescribeKind(int kind)JavaccTokengetFirstToken()Returns the first token of the token chain.JavaccTokenopen()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:TokenDocumentReturns the first token of the token chain.- Specified by:
getFirstTokenin classTokenDocument<JavaccToken>
-
describeKind
public @NonNull String describeKind(int kind)
-
createToken
public JavaccToken createToken(int kind, CharStream cs, @Nullable String image)
-
-