public ExtendedParser(Builder context, String input) {
super(context, input);
}
@Override
protected AstEval eval(boolean required, boolean deferred) throws ScanException, ParseException {
AstEval v = null;
Symbol start_eval = deferred ? START_EVAL_DEFERRED : START_EVAL_DYNAMIC;
if (this.getToken().getSymbol() == start_eval) {
consumeToken();
AstNode node = expr(true);
try {
consumeToken(END_EVAL);
} catch (ParseException e) {
if (this.getToken().getSymbol() == FLOAT && node instanceof AstIdentifier) {
// Handle ${someMap.${someId}}
String mapKey = this.getToken().getImage().replace(".", "");
node = createAstDot(node, mapKey, true);
consumeToken();
consumeToken(END_EVAL);
} else {
throw e;
}
}
v = new AstEval(node, deferred);
} else if (required) {
fail(start_eval);
}
return v;
}