java.lang.Object
provided.tokenFW.TokenFactory
- All Implemented Interfaces:
ITokenFactory
Concrete factory to create tokens
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
Singleton
Singleton instance of this class
-
-
Constructor Details
-
TokenFactory
private TokenFactory()private constructor needed for singleton
-
-
Method Details
-
makeToken
Creates Tokens from the given name and lexeme. The returned tokens will call the case in their visitors corresponding to their *name*. For many tokens the name and lexeme are the same, but for some, it is not, e.g. an Quote token, where the name is "Quote", but the lexeme is the string value of the quoted text.- Specified by:
makeToken
in interfaceITokenFactory
- Parameters:
name
- The name of the tokenlexeme
- The lexeme value for the token- Returns:
- An Token instance with the given name and lexeme which calls the named case of its visitors.
-