Ejemplo n.º 1
0
        public CallExpr Parse(ParserContext context)
        {
            // Invoke the function call argument parser.
            List <Expr> args = new CallArgsParser().Parse(context);

            // Create the function call expression entity.
            CallExpr functionCall = new CallExpr(this.identifier, args);

            // Return the function call expression.
            return(functionCall);
        }
Ejemplo n.º 2
0
        public FunctionCallExpr Parse(TokenStream stream)
        {
            // Capture identifier.
            var identifier = stream.Next(TokenType.Identifier).Value;

            // Ensure the function has been emitted.
            if (!SymbolTable.functions.ContainsKey(identifier))
            {
                throw new Exception($"Call to a non-existent function named '{identifier}' performed");
            }

            // Retrieve the target.
            LLVMValueRef target = SymbolTable.functions[identifier];

            // Invoke the function call argument parser.
            var args = new CallArgsParser().Parse(stream);

            // TODO: Callee.
            // Create the function call expression entity.
            var functionCall = new FunctionCallExpr(target, "TestCallee", args);

            return(functionCall);
        }