Exemplo n.º 1
0
 public CallStatementWrapper(CallOperator callOperator) : base(
         new List <Node> {
     callOperator
 },
         callOperator.Value,
         callOperator.Line,
         callOperator.Position)
 {
 }
        private DesignatorNode ParseFunctionCall(SymTable symTable, DesignatorNode function)
        {
            var fs = (FunctionSymbol)function.Type;
            var p  = ParseActualParameters(symTable);

            CheckParameters(fs.Parameters, p);
            var f = new CallOperator(p.Childs, "Call", p.Line, p.Position)
            {
                Subprogram = fs,
                Type       = fs.ReturnType
            };

            switch (fs.ReturnType)
            {
            case RecordTypeSymbol _:
                return(ParseMemberAccess(symTable, f));

            case ArrayTypeSymbol _:
                return(ParseIndex(symTable, f));
            }
            return(f);
        }