Package eu.bandm.tools.lexic
Class TokenRule<T>
java.lang.Object
eu.bandm.tools.lexic.TokenRule<T>
- Type Parameters:
T- the type of token types
Associates a token type with a syntax fragment.
The fragment must not match an empty sequence of code points.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) NAutomaton<T> Returns the automaton that implements the syntax fragment of this rule.getType()Returns the token type of this rule.toString()
-
Constructor Details
-
TokenRule
Creates a new instance.- Parameters:
type- the token type; whethernullis acceptable is application-dependentfragment- the syntax fragment- Throws:
NullPointerException- iffragmentis nullIllegalArgumentException- iffragmentmatches an empty sequence of code points
-
-
Method Details
-
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
-