|
|||||||||
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.HTMLToken1
public class HTMLToken1
A HTMLToken1 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 |
CHAR_REF
|
static int |
COMMENT
|
static int |
END_TAG_NAME
|
static int |
EQUAL
|
static int |
ERROR_MALFORMED_TAG
|
static int |
NAME
|
static int |
REFERENCE
|
static int |
SCRIPT
|
static int |
TAG_END
|
static int |
TAG_NAME
|
static int |
TAG_START
|
static int |
VALUE
|
static int |
WHITE_SPACE
|
static int |
WORD
|
Fields inherited from class com.Ostermiller.Syntax.Lexer.Token |
---|
INITIAL_STATE, UNDEFINED_STATE |
Constructor Summary | |
---|---|
HTMLToken1(int ID,
String contents,
int lineNumber,
int charBegin,
int charEnd)
Create a new token. |
|
HTMLToken1(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 |
isCharacterReference()
Checks this token to see if it is a character reference. |
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 |
isName()
Checks this token to see if it is a name of a name value pair. |
boolean |
isScript()
Checks this token to see if it is an script. |
boolean |
isSeparator()
Checks this token to see if it is a tag. |
boolean |
isTagName()
Checks this token to see if it is an tag name. |
boolean |
isValue()
Checks this token to see if it is a value of a name value pair. |
boolean |
isWhiteSpace()
Checks this token to see if it is White Space. |
boolean |
isWord()
Checks this token to see if it is a word. |
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 TAG_START
public static final int TAG_END
public static final int EQUAL
public static final int WORD
public static final int REFERENCE
public static final int TAG_NAME
public static final int END_TAG_NAME
public static final int NAME
public static final int VALUE
public static final int CHAR_REF
public static final int SCRIPT
public static final int COMMENT
public static final int WHITE_SPACE
public static final int ERROR_MALFORMED_TAG
Constructor Detail |
---|
public HTMLToken1(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 HTMLToken1(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 isSeparator()
public boolean isWord()
public boolean isTagName()
public boolean isName()
public boolean isValue()
public boolean isCharacterReference()
public boolean isScript()
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 |