|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.Ostermiller.Syntax.Lexer.Token com.Ostermiller.Syntax.Lexer.LatexToken
public class LatexToken
A LatexToken is a token that is returned by a lexer that is lexing a HTML
source file. It has several attributes describing the token:
The type of token, the text of the token, the line number on which it
occurred, the number of characters into the input at which it started, and
similarly, the number of characters into the input at which it ended.
Field Summary | |
---|---|
static int |
COMMAND
|
static int |
COMMAND_CHAR
|
static int |
COMMENT
|
static int |
ERROR_UNEXPECTED_COMMAND_CHAR
|
static int |
TEXT
|
static int |
WHITE_SPACE
|
Fields inherited from class com.Ostermiller.Syntax.Lexer.Token |
---|
INITIAL_STATE, UNDEFINED_STATE |
Constructor Summary | |
---|---|
LatexToken(int ID,
String contents,
int lineNumber,
int charBegin,
int charEnd)
Create a new token. |
|
LatexToken(int ID,
String contents,
int lineNumber,
int charBegin,
int charEnd,
int state)
Create a new token. |
Method Summary | |
---|---|
String |
errorString()
get a String that explains the error, if this token is an error. |
int |
getCharBegin()
get the offset into the input in characters at which this token started |
int |
getCharEnd()
get the offset into the input in characters at which this token ended |
String |
getContents()
get the contents of this token |
String |
getDescription()
A description of this token. |
int |
getID()
get the ID number of this token |
int |
getLineNumber()
get the line number of the input on which this token started |
int |
getState()
Get an integer representing the state the tokenizer is in after returning this token. |
boolean |
isComment()
Checks this token to see if it is a comment. |
boolean |
isError()
Checks this token to see if it is an Error. |
boolean |
isText()
Checks this token to see if it is text. |
boolean |
isWhiteSpace()
Checks this token to see if it is White Space. |
String |
toString()
get a representation of this token as a human readable string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int COMMAND
public static final int COMMAND_CHAR
public static final int TEXT
public static final int COMMENT
public static final int WHITE_SPACE
public static final int ERROR_UNEXPECTED_COMMAND_CHAR
Constructor Detail |
---|
public LatexToken(int ID, String contents, int lineNumber, int charBegin, int charEnd)
ID
- the id number of the tokencontents
- A string representing the text of the tokenlineNumber
- the line number of the input on which this token startedcharBegin
- the offset into the input in characters at which this token startedcharEnd
- the offset into the input in characters at which this token endedpublic LatexToken(int ID, String contents, int lineNumber, int charBegin, int charEnd, int state)
ID
- the id number of the tokencontents
- A string representing the text of the tokenlineNumber
- the line number of the input on which this token startedcharBegin
- the offset into the input in characters at which this token startedcharEnd
- the offset into the input in characters at which this token endedstate
- the state the tokenizer is in after returning this token.Method Detail |
---|
public int getState()
getState
in class Token
public int getID()
getID
in class Token
public String getContents()
getContents
in class Token
public int getLineNumber()
getLineNumber
in class Token
public int getCharBegin()
getCharBegin
in class Token
public int getCharEnd()
getCharEnd
in class Token
public boolean isText()
public boolean isComment()
isComment
in class Token
public boolean isWhiteSpace()
isWhiteSpace
in class Token
public boolean isError()
isError
in class Token
public String getDescription()
getDescription
in class Token
public String errorString()
errorString
in class Token
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |