public static interface Input.Tok
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.Modifier and Type | Method and Description |
---|---|
int |
getColumn()
Return the
Tok 's 0 -based column number. |
int |
getIndex()
Return the
Tok 's index. |
String |
getOriginalText()
The
Tok 's original text (before processing escapes). |
int |
getPosition()
Return the
Tok 's 0 -based position. |
String |
getText()
The
Tok 's text. |
boolean |
isComment()
Is the
Tok a comment? |
boolean |
isJavadocComment()
Is the
Tok a javadoc comment? |
boolean |
isNewline()
Is the
Tok a newline? |
boolean |
isSlashSlashComment()
Is the
Tok a "//" comment? |
boolean |
isSlashStarComment()
Is the
Tok a "//" comment? |
int |
length()
The length of the
Tok 's original text. |
int getIndex()
Tok
's index.int getPosition()
Tok
's 0
-based position.int getColumn()
Tok
's 0
-based column number.String getText()
Tok
's text.String getOriginalText()
Tok
's original text (before processing escapes).int length()
Tok
's original text.boolean isNewline()
Tok
a newline?boolean isSlashSlashComment()
Tok
a "//" comment?boolean isSlashStarComment()
Tok
a "//" comment?boolean isJavadocComment()
Tok
a javadoc comment?boolean isComment()
Tok
a comment?Copyright © 2015–2017 Google Inc.. All rights reserved.