public class TokenRef extends Token
Token that references a previously parsed token.
TokenRef consists of a referenceName (a String). In order to
allow the construction of recursive tokens, this token can be used to
reference an enclosing token and use it at the current location. An example
for use of this token is to recursively define a linked list.
The referenced token is located in the current parse state by traversing it backwards until it is located. Parsing will fail if it is not found.
| Modifier and Type | Field and Description |
|---|---|
String |
referenceName |
| Constructor and Description |
|---|
TokenRef(String name,
String referenceName,
Encoding encoding) |
| Modifier and Type | Method and Description |
|---|---|
Token |
getCanonical(Environment environment) |
protected ParseResult |
parseImpl(String scope,
Environment environment,
Encoding encoding) |
isLocal, makeNameFragment, parse, parsepublic final String referenceName
protected ParseResult parseImpl(String scope, Environment environment, Encoding encoding) throws IOException
parseImpl in class TokenIOExceptionpublic Token getCanonical(Environment environment)
getCanonical in class TokenCopyright © 2017. All rights reserved.