net.sourceforge.czt.parser.util
Interface Token
- All Known Subinterfaces:
- LocToken
- All Known Implementing Classes:
- Keyword, LatexSym, LocTokenImpl, TokenImpl, TokenName
public interface Token
A token is an object with a name and an optional spelling, which is
usually created by a lexer (or scanner) and subsequently used in a
parser. A typical Z token is LPAREN, which is created when the
lexer finds a '('-character. Another typical Z Token is DECORWORD,
which is created when the lexer finds a decorated word like "x?".
The DECORWORD token has usually a spelling associated, "x?" in the
example above.
It is convenient to allow any Object to be used as a spelling
for a token. For example, a NUMERAL token could have an Integer as
spelling. The toString() method of the spelling
object should return the string from which the lexer created this
token.
- Author:
- Petra Malik
getName
java.lang.String getName()
getSpelling
java.lang.Object getSpelling()
spelling
java.lang.String spelling()
Copyright © 2003-2007 Community Z Tools Project. All Rights Reserved.