Class AntlrToken

    • Constructor Detail

      • AntlrToken

        @Deprecated
        public AntlrToken​(org.antlr.v4.runtime.Token token,
                          AntlrToken previousComment,
                          TextDocument textDoc)
        Deprecated.
        Don't create antlr tokens directly, use an AntlrTokenManager
        Constructor
        Parameters:
        token - The antlr token implementation
        previousComment - The previous comment
        textDoc - The text document
    • Method Detail

      • getNext

        public AntlrToken getNext()
        Description copied from interface: GenericToken
        Obtain the next generic token according to the input stream which generated the instance of this token.
        Specified by:
        getNext in interface GenericToken<AntlrToken>
        Returns:
        the next generic token if it exists; null if it does not exist
      • getPreviousComment

        public AntlrToken getPreviousComment()
        Description copied from interface: GenericToken
        Obtain a comment-type token which, according to the input stream which generated the instance of this token, precedes this instance token and succeeds the previous generic token (if there is any).
        Specified by:
        getPreviousComment in interface GenericToken<AntlrToken>
        Returns:
        the comment-type token if it exists; null if it does not exist
      • getImageCs

        public CharSequence getImageCs()
        Description copied from interface: GenericToken
        Returns the text of the token as a char sequence. This should be preferred when you can use eg StringUtils to do some processing, without having to create a string.
        Specified by:
        getImageCs in interface GenericToken<AntlrToken>
      • isEof

        public boolean isEof()
        Description copied from interface: GenericToken
        Returns true if this token is an end-of-file token. This is the last token of token sequences that have been fully lexed.
        Specified by:
        isEof in interface GenericToken<AntlrToken>
      • getKind

        public int getKind()
        Description copied from interface: GenericToken
        Gets a unique integer representing the kind of token this is. The semantics of this kind depend on the language.

        The returned constants can be looked up in the language's "*ParserConstants", e.g. CppParserConstants or JavaParserConstants. These constants are considered internal API and may change at any time when the language's grammar is changed.

        Specified by:
        getKind in interface GenericToken<AntlrToken>
      • isHidden

        public boolean isHidden()
      • isDefault

        public boolean isDefault()