Class TokenRule<T>

java.lang.Object
eu.bandm.tools.lexic.TokenRule<T>
Type Parameters:
T - the type of token types

public class TokenRule<T> extends Object
Associates a token type with a syntax fragment.
See Also:
  • Constructor Details

    • TokenRule

      public TokenRule(@Opt T type, TokenFragment fragment)
      Creates a new instance.
      Parameters:
      type - the token type; whether null is acceptable is application-dependent
      fragment - the syntax fragment
  • Method Details

    • getType

      @Opt public T getType()
      Returns the token type of this rule.
      Returns:
      the token type of this rule
    • getImplementation

      NAutomaton<T> getImplementation()
      Returns the automaton that implements the syntax fragment of this rule.
      Returns:
      the automaton that implements the syntax fragment of this rule
    • toString

      public String toString()
      Overrides:
      toString in class Object