Esempio n. 1
0
        public override IAstNode VisitFunctionCallExpression([NotNull] FunctionCallExpressionContext context)
        {
            Prototype function = FindCallTarget(context.CaleeName);

            var args = from expCtx in context.expression( )
                       select(IExpression) expCtx.Accept(this);

            return(new FunctionCallExpression(context.GetSourceSpan( ), function, args));
        }
Esempio n. 2
0
        public override IAstNode VisitFunctionCallExpression(FunctionCallExpressionContext context)
        {
            Prototype?function = FindCallTarget(context.CaleeName);

            if (function is null)
            {
                return(new ErrorNode(context.GetSourceSpan( ), $"Call to unknown function '{context.CaleeName}'"));
            }

            var args = from expCtx in context.expression( )
                       select(IExpression) expCtx.Accept(this);

            return(new FunctionCallExpression(context.GetSourceSpan( ), function, args));
        }