use of com.google.auto.value.processor.escapevelocity.ExpressionNode.NotExpressionNode in project auto by google.
the class Parser method parseUnaryExpression.
/**
* Parses an expression not containing any operators (except inside parentheses).
* <pre>{@code
* <unary-expression> -> <primary> |
* ( <expression> ) |
* ! <unary-expression>
* }</pre>
*/
private ExpressionNode parseUnaryExpression() throws IOException {
skipSpace();
ExpressionNode node;
if (c == '(') {
nextNonSpace();
node = parseExpression();
expect(')');
skipSpace();
return node;
} else if (c == '!') {
next();
node = new NotExpressionNode(parseUnaryExpression());
skipSpace();
return node;
} else {
return parsePrimary();
}
}
Aggregations