unm.cs351.f11.tdrl.p1
Interface HasPattern


public interface HasPattern

Interface for things that can be queried for a regex pattern. This is intended to be used to allow tokens to define their own recognition, for use in concrete implementations of LexicalAnalyzer (such as BaconLexer). The intention is to create enums that implement this interface so that they can be treated as token types (the type parameter T from Token). Then the lexical analyzer can ask them for their recognition patterns without actually knowing anything about the language's token patterns itself.

Version:
1.0
Author:
terran

Method Summary
 String getPattern()
          Get the regular expression string for recognizing this token type.
 

Method Detail

getPattern

String getPattern()
Get the regular expression string for recognizing this token type.

Returns:
Pattern regex string.