A Tok ("tock") is a token, or a comment, or a newline, or a maximal string of blanks. A token Tok underlies a Token, and each other Tok is attached to a single Token. Tokens and comments have indices; white space Toks do not.
| 27 | * {@code Token}. Tokens and comments have indices; white space {@code Tok}s do not. |
| 28 | */ |
| 29 | public interface Tok { |
| 30 | /** |
| 31 | * Return the {@code Tok}'s index. |
| 32 | * |
| 33 | * @return its index |
| 34 | */ |
| 35 | int getIndex(); |
| 36 | |
| 37 | /** |
| 38 | * Return the {@code Tok}'s {@code 0}-based position. |
| 39 | * |
| 40 | * @return its position |
| 41 | */ |
| 42 | int getPosition(); |
| 43 | |
| 44 | /** |
| 45 | * Return the {@code Tok}'s {@code 0}-based column number. |
| 46 | * |
| 47 | * @return its column number |
| 48 | */ |
| 49 | int getColumn(); |
| 50 | |
| 51 | /** The {@code Tok}'s text. */ |
| 52 | String getText(); |
| 53 | |
| 54 | /** The {@code Tok}'s original text (before processing escapes). */ |
| 55 | String getOriginalText(); |
| 56 | |
| 57 | /** The length of the {@code Tok}'s original text. */ |
| 58 | int length(); |
| 59 | |
| 60 | /** Is the {@code Tok} a newline? */ |
| 61 | boolean isNewline(); |
| 62 | |
| 63 | /** Is the {@code Tok} a "//" comment? */ |
| 64 | boolean isSlashSlashComment(); |
| 65 | |
| 66 | /** Is the {@code Tok} a "/*" comment? */ |
| 67 | boolean isSlashStarComment(); |
| 68 | |
| 69 | /** Is the {@code Tok} a javadoc comment? */ |
| 70 | boolean isJavadocComment(); |
| 71 | |
| 72 | /** Is the {@code Tok} a comment? */ |
| 73 | boolean isComment(); |
| 74 | } |
| 75 | |
| 76 | /** A {@code Token} is a language-level token. */ |
| 77 | public interface Token { |
no outgoing calls
no test coverage detected