public class Pre extends Token
Token that specifies a conditional token.
A Pre consists of a token (a Token) and a
predicate (an Expression). First
predicate is evaluated. If it evaluates to true,
the token is parsed. The only way for Pre to fail is if
predicate evaluates to true, but parsing the
token fails.
Expression| Modifier and Type | Field and Description |
|---|---|
Expression |
predicate |
Token |
token |
| Constructor and Description |
|---|
Pre(String name,
Token token,
Expression predicate,
Encoding encoding) |
| Modifier and Type | Method and Description |
|---|---|
protected ParseResult |
parseImpl(String scope,
Environment environment,
Encoding encoding) |
String |
toString() |
getCanonical, isLocal, makeNameFragment, parse, parsepublic final Token token
public final Expression predicate
public Pre(String name, Token token, Expression predicate, Encoding encoding)
protected ParseResult parseImpl(String scope, Environment environment, Encoding encoding) throws IOException
parseImpl in class TokenIOExceptionCopyright © 2017. All rights reserved.