- Enclosing class:
Input
public static interface Input.Tok
A
Tok
("tock") is a token, or a comment, or a newline, or a maximal string of blanks. A
token Tok
underlies a Input.Token
, and each other Tok
is attached to a single
Token
. Tokens and comments have indices; white space Tok
s do not.-
Method Summary
Modifier and TypeMethodDescriptionint
Return theTok
's0
-based column number.int
getIndex()
Return theTok
's index.TheTok
's original text (before processing escapes).int
Return theTok
's0
-based position.getText()
TheTok
's text.boolean
Is theTok
a comment?boolean
Is theTok
a javadoc comment?boolean
Is theTok
a newline?boolean
Is theTok
a "//" comment?boolean
Is theTok
a "/*" comment?int
length()
The length of theTok
's original text.
-
Method Details
-
getIndex
int getIndex()Return theTok
's index.- Returns:
- its index
-
getPosition
int getPosition()Return theTok
's0
-based position.- Returns:
- its position
-
getColumn
int getColumn()Return theTok
's0
-based column number.- Returns:
- its column number
-
getText
String getText()TheTok
's text. -
getOriginalText
String getOriginalText()TheTok
's original text (before processing escapes). -
length
int length()The length of theTok
's original text. -
isNewline
boolean isNewline()Is theTok
a newline? -
isSlashSlashComment
boolean isSlashSlashComment()Is theTok
a "//" comment? -
isSlashStarComment
boolean isSlashStarComment()Is theTok
a "/*" comment? -
isJavadocComment
boolean isJavadocComment()Is theTok
a javadoc comment? -
isComment
boolean isComment()Is theTok
a comment?
-