Пример #1
0
        private static method_call CreateMethodCall(string methodName, params expression[] exprList)
        {
            SyntaxTree.method_call mc = new SyntaxTree.method_call();
            mc.dereferencing_value = new ident(methodName);
            SyntaxTree.expression_list exl = new PascalABCCompiler.SyntaxTree.expression_list();
            foreach (expression x in exprList)
            {
                exl.Add(x);
            }
            mc.parameters = exl;

            return(mc);
        }
Пример #2
0
        //private SyntaxTree.uses_list CreateStandartUsesList()
        //{
        //    uses_list res = new uses_list();
        //    unit_or_namespace pabcsystem = new unit_or_namespace();
        //    pabcsystem.name = new ident_list("PABCSystem");
        //    res.units.Add(pabcsystem);
        //    return res;
        //}

        public procedure_call CreateProcedureCall(string procName, params expression[] exprList)
        {
            SyntaxTree.procedure_call pc = new SyntaxTree.procedure_call();
            SyntaxTree.method_call    mc = new SyntaxTree.method_call();
            mc.dereferencing_value = new ident(procName);
            pc.func_name           = mc;
            SyntaxTree.expression_list exl = new PascalABCCompiler.SyntaxTree.expression_list();
            foreach (expression x in exprList)
            {
                exl.Add(x);
            }
            mc.parameters = exl;
            return(pc);
        }
 public override void visit(matching_expression _matching_expression)
 {
     SyntaxTree.procedure_call pc = new SyntaxTree.procedure_call();
     SyntaxTree.method_call mc = new SyntaxTree.method_call();
     dot_node dot = new dot_node(new ident("PABCSystem"), new ident("KV"));
     mc.dereferencing_value = dot;
     pc.func_name = mc;
     pc.source_context = _matching_expression.source_context;
     SyntaxTree.expression_list exl = new PascalABCCompiler.SyntaxTree.expression_list();
     exl.Add(_matching_expression.left);
     exl.Add(_matching_expression.right);
     mc.parameters = exl;
     visit(pc);
 }
Пример #4
0
        //private SyntaxTree.uses_list CreateStandartUsesList()
        //{
        //    uses_list res = new uses_list();
        //    unit_or_namespace pabcsystem = new unit_or_namespace();
        //    pabcsystem.name = new ident_list("PABCSystem");
        //    res.units.Add(pabcsystem);
        //    return res;
        //}

        public procedure_call CreateProcedureCall(string procName, params expression[] exprList)
        {
            SyntaxTree.procedure_call pc = new SyntaxTree.procedure_call();
            SyntaxTree.method_call mc = new SyntaxTree.method_call();
            mc.dereferencing_value = new ident(procName);
            pc.func_name = mc;
            SyntaxTree.expression_list exl = new PascalABCCompiler.SyntaxTree.expression_list();
            foreach (expression x in exprList)
                exl.Add(x);
            mc.parameters = exl;
            return pc;
        }