Class AntlrToken

    • Constructor Detail

      • AntlrToken

        public AntlrToken​(org.antlr.v4.runtime.Token token,
                          AntlrToken previousComment)
        Constructor
        Parameters:
        token - The antlr token implementation
        previousComment - The previous comment
    • Method Detail

      • getNext

        public GenericToken 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
        Returns:
        the next generic token if it exists; null if it does not exist
      • getPreviousComment

        public GenericToken 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
        Returns:
        the comment-type token if it exists; null if it does not exist
      • getBeginLine

        public int getBeginLine()
        Description copied from interface: GenericToken
        Gets the line where the token's region begins
        Specified by:
        getBeginLine in interface GenericToken
        Returns:
        a non-negative integer containing the begin line
      • getBeginColumn

        public int getBeginColumn()
        Description copied from interface: GenericToken
        Gets the column offset from the start of the begin line where the token's region begins
        Specified by:
        getBeginColumn in interface GenericToken
        Returns:
        a non-negative integer containing the begin column
      • getEndLine

        public int getEndLine()
        Description copied from interface: GenericToken
        Gets the line where the token's region ends
        Specified by:
        getEndLine in interface GenericToken
        Returns:
        a non-negative integer containing the end line
      • getEndColumn

        public int getEndColumn()
        Description copied from interface: GenericToken
        Gets the column offset from the start of the end line where the token's region ends
        Specified by:
        getEndColumn in interface GenericToken
        Returns:
        a non-negative integer containing the begin column
      • getKind

        @Experimental
        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.

        Note: This is an experimental API.

        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
      • isHidden

        public boolean isHidden()
      • isDefault

        public boolean isDefault()