public class Def extends Token
Token that specifies a value to parse in the input.
A Def consists of a size (a ValueExpression, in bytes)
and a predicate (an Expression). The
predicate may be null.
Parsing will succeed if size evaluates to a single value, if
that many bytes are available in the input and if predicate
(if present) evaluates to true.
Expression,
Nod,
ValueExpression| Modifier and Type | Field and Description |
|---|---|
Expression |
predicate |
ValueExpression |
size |
| Constructor and Description |
|---|
Def(String name,
ValueExpression size,
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 ValueExpression size
public final Expression predicate
public Def(String name, ValueExpression size, Expression predicate, Encoding encoding)
protected ParseResult parseImpl(String scope, Environment environment, Encoding encoding) throws IOException
parseImpl in class TokenIOExceptionCopyright © 2017. All rights reserved.