Class TokenTagToken

  • All Implemented Interfaces:
    Serializable, Token, WritableToken

    public class TokenTagToken
    extends CommonToken
    A Token object representing a token of a particular type; e.g., <ID>. These tokens are created for TagChunk chunks where the tag corresponds to a lexer rule or token type.
    See Also:
    Serialized Form
    • Constructor Detail

      • TokenTagToken

        public TokenTagToken​(String tokenName,
                             int type)
        Constructs a new instance of TokenTagToken for an unlabeled tag with the specified token name and type.
        Parameters:
        tokenName - The token name.
        type - The token type.
      • TokenTagToken

        public TokenTagToken​(String tokenName,
                             int type,
                             String label)
        Constructs a new instance of TokenTagToken with the specified token name, type, and label.
        Parameters:
        tokenName - The token name.
        type - The token type.
        label - The label associated with the token tag, or null if the token tag is unlabeled.
    • Method Detail

      • getTokenName

        public final String getTokenName()
        Gets the token name.
        Returns:
        The token name.
      • getLabel

        public final String getLabel()
        Gets the label associated with the rule tag.
        Returns:
        The name of the label associated with the rule tag, or null if this is an unlabeled rule tag.