예제 #1
0
        //public int newlabel()
        //{
        //    return CurrentGenerator.AllocLabel();
        //}

        //public void emitLabel(int i)
        //{
        //    CurrentGenerator.Label("L" + i.ToString());

        //}

        //public void emit(string s)
        //{
        //    CurrentIO.EmitLine(s);
        //}

        //public void emitSrc(string s)
        //{
        //    CurrentIO.EmitSource(s);
        //}

        public void emitfunSet(Expr exp, Expr toVar)
        {
            FuncCall c = exp as FuncCall;

            if (c.FunParams?.Count() > 0)
            {
                foreach (PassParam item in c.FunParams)
                {
                    if (item.Param is FuncCall)
                    {
                        Temp t = new Temp(toVar.Type);
                        CurrentGenerator.Temp(t);
                        emitfunSet(item.Param, t);
                        CurrentGenerator.Param(t);
                    }
                    else
                    {
                        CurrentGenerator.Param(item);
                    }
                }
            }
            CurrentGenerator.Call(toVar, c.Func);
            CurrentGenerator.CallEnd();
        }
예제 #2
0
 public void Call(FuncCall caller)
 {
     IntermediateCode.CurrentIO.Emit("\t" + caller.Func + "(");
 }
예제 #3
0
 public Call(FuncCall caller) : base(caller.lexline)
 {
     Caller = caller;
 }
예제 #4
0
 public void Call(FuncCall caller)
 {
     IntermediateCode.CurrentIO.EmitLine(caller.ToString());
 }