@UsedInGeneratedCode @Override public void exitFunctionExpr(ExprParser.FunctionExprContext ctx) { String fnName = ctx.getChild(0).getText(); final List<Expr> args = ctx.getChildCount() > 3 ? (List<Expr>) nodes.get(ctx.getChild(2)) : Collections.emptyList(); Expr expr = macroTable.get(fnName, args); if (expr == null) { // Built-in functions. final Function function = Parser.getFunction(fnName); if (function == null) { throw new RE("function '%s' is not defined.", fnName); } expr = new FunctionExpr(function, fnName, args); } nodes.put(ctx, expr); }
@UsedInGeneratedCode @Override public void exitFunctionExpr(ExprParser.FunctionExprContext ctx) { String fnName = ctx.getChild(0).getText(); final List<Expr> args = ctx.getChildCount() > 3 ? (List<Expr>) nodes.get(ctx.getChild(2)) : Collections.emptyList(); Expr expr = macroTable.get(fnName, args); if (expr == null) { // Built-in functions. final Function function = Parser.getFunction(fnName); if (function == null) { throw new RE("function '%s' is not defined.", fnName); } expr = new FunctionExpr(function, fnName, args); } nodes.put(ctx, expr); }