|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlp.parse.LpToken
public class LpToken
An immutable container for information about 1 token in an input created by
a LpLexer
. Contains a type, the corresponding lexem, line number and
the position within the line.
LpLexer
,
LpTokenType
Field Summary | |
---|---|
private String |
lexem
The corresponding lexem. |
private int |
lineNumber
Number of the line where the token occurs. |
private int |
position
Position within the line where the token occurs. |
private LpTokenType |
type
Type of the token. |
Constructor Summary | |
---|---|
LpToken(LpTokenType type,
String lexem,
int lineNumber,
int position)
Creates a new instance. |
Method Summary | |
---|---|
String |
getLexem()
Returns the corresponding lexem. |
int |
getLineNumber()
Returns the position within the line where the token occurs. |
int |
getPosition()
Returns the number of the line where the token occurs. |
LpTokenType |
getType()
Returns the type of the token. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final LpTokenType type
private final String lexem
private final int lineNumber
private final int position
Constructor Detail |
---|
public LpToken(LpTokenType type, String lexem, int lineNumber, int position)
type
- type of the token.lexem
- the corresponding lexem.lineNumber
- number of the line where the token occurs.position
- position within the line where the token occurs.Method Detail |
---|
public LpTokenType getType()
public String getLexem()
public int getPosition()
public int getLineNumber()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |