unm.cs351.f11.tdrl.p1
Interface Token<T extends Enum<T> & HasPattern>


public interface Token<T extends Enum<T> & HasPattern>

Generic token type generated by an instance of a LexicalAnalyzer. This interface defines the minimal behavior for a token generated during the lexical analysis phase of parsing. Specifically, token is a thing that:

Version:
1.0
Author:
terran

Method Summary
 String getContent()
          The literal string matched when generating this token instance.
 T getType()
          The type of the token.
 

Method Detail

getContent

String getContent()
The literal string matched when generating this token instance. Possibly null or the empty string for EOF. (Whether null is an acceptable token content is implementation-dependent.)

Returns:
String data.

getType

T getType()
The type of the token. Must be an instance of type T -- some enum that describes available token types for a given lexer instance. Must never return null.

Returns:
Type of this token.