Class AntlrToken

  • All Implemented Interfaces:
    GenericToken

    public class AntlrToken
    extends java.lang.Object
    implements GenericToken
    Generic Antlr representation of a token.
    • Constructor Summary

      Constructors 
      Constructor Description
      AntlrToken​(org.antlr.v4.runtime.Token token, AntlrToken previousComment)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBeginColumn()
      Gets the column offset from the start of the begin line where the token's region begins
      int getBeginLine()
      Gets the line where the token's region begins
      int getEndColumn()
      Gets the column offset from the start of the end line where the token's region ends
      int getEndLine()
      Gets the line where the token's region ends
      java.lang.String getImage()
      Gets the token's text.
      GenericToken getNext()
      Obtain the next generic token according to the input stream which generated the instance of this token.
      GenericToken getPreviousComment()
      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).
      int getType()  
      boolean isHidden()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • getImage

        public java.lang.String getImage()
        Description copied from interface: GenericToken
        Gets the token's text.
        Specified by:
        getImage in interface GenericToken
        Returns:
        the token's text
      • 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
      • 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
      • 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
      • 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
      • getType

        public int getType()
      • isHidden

        public boolean isHidden()