Ejemplo n.º 1
0
 public override int GenerateCode(int loc, IVirtualMachine vm, CheckerInformation info)
 {
     if (IsFuncCall)
     {
         if (info.ProcFuncs.ContainsIdent(Ident))
         {
             ASTProcFuncDecl callee = info.ProcFuncs[Ident];
             if (!callee.IsFunc)
             {
                 throw new IVirtualMachine.InternalError("Calls inside expresssions can only be made to functions but never to procedures!");
             }
             loc = ASTCmdCall.GenerateCallingCode(loc, vm, info, callee, OptInitOrExprList);
             return(loc);
         }
         else
         {
             throw new IVirtualMachine.InternalError("Call to unkown function '" + Ident + "'");
         }
     }
     else
     {
         loc = GenerateLValue(loc, vm, info, false);
         vm.Deref(loc++);
         return(loc);
     }
 }
Ejemplo n.º 2
0
        public override int GenerateCode(int loc, IVirtualMachine vm, CheckerInformation info)
        {
            //Get abstract declaration
            ASTProcFuncDecl callee = info.ProcFuncs[Ident];

            loc = ASTCmdCall.GenerateCallingCode(loc, vm, info, callee, ExprList);
            return(loc);
        }