| Modifier and Type | Method and Description |
|---|---|
| public Token | |
| public String | |
| public String | |
| public String | Returns: The text of all tokens within the source interval ofctx.The context providing the source interval of tokens to get
text for. ctx)Return the text of all tokens in the source interval of the specified context. |
| public String | Returns: The text of all tokens lying between the specifiedstart
and stop tokens.The first token in the interval to get text for. start, Object The last token in the interval to get text for (inclusive). stop)Return the text of all tokens in this stream between |
| public TokenSource | |
| public Token |
| get | back to summary |
|---|---|
| public Token get(int i) Gets the The preconditions for this method are the same as the preconditions of
The symbol referred to by
| |
| getText | back to summary |
|---|---|
| public String getText(Interval interval) Return the text of all tokens within the specified
TokenStream stream = ...;
String text = "";
for (int i = interval.a; i <= interval.b; i++) {
text += stream.get(i).getText();
}
| |
| getText | back to summary |
|---|---|
| public String getText() Return the text of all tokens in the stream. This method behaves like the
following code, including potential exceptions from the calls to
TokenStream stream = ...; String text = stream.getText(new Interval(0, stream.size())); | |
| getText | back to summary |
|---|---|
| public String getText(RuleContext ctx) Return the text of all tokens in the source interval of the specified
context. This method behaves like the following code, including potential
exceptions from the call to If TokenStream stream = ...; String text = stream.getText(ctx.getSourceInterval());
| |
| getText | back to summary |
|---|---|
| public String getText(Object start, Object stop) Return the text of all tokens in this stream between If the specified For streams which ensure that the
TokenStream stream = ...;
String text = "";
for (int i = start.getTokenIndex(); i <= stop.getTokenIndex(); i++) {
text += stream.get(i).getText();
}
| |
| getTokenSource | back to summary |
|---|---|
| public TokenSource getTokenSource() Gets the underlying
| |
| LT | back to summary |
|---|---|
| public Token LT(int k) Get the
| |