public class Pre extends Token
Token that specifies a precondition for parsing a nested 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. Parsing this token will only succeed if the
predicate evaluates to true and if parsing the
nested token succeeds.
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 |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
protected Optional<ParseState> |
parseImpl(Environment environment) |
String |
toString() |
getCanonical, isLocal, makeNameFragment, parsepublic final Token token
public final Expression predicate
public Pre(String name, Token token, Expression predicate, Encoding encoding)
protected Optional<ParseState> parseImpl(Environment environment)
Copyright © 2017. All rights reserved.