public void Compile(Generator gen, CEnv env)
 {
     foreach (Pair <String, Type> formArg in this.formArgs)
     {
         env.DeclareLocal(formArg.Fst);
     }
     gen.Label(env.getFunctionLabel(fName));
     body.Compile(env, gen);
     gen.Emit(new RET(formArgs.Count));
 }
Exemple #2
0
        public override void Compile(CEnv env, Generator gen)
        {
            int argCount = 0;

            foreach (var expression in expressions)
            {
                expression.Compile(env, gen);
                argCount++;
            }
            String fLabel = env.getFunctionLabel(fName);

            gen.Emit(new CALL(argCount, fLabel));
        }
Exemple #3
0
        public void Compile(Generator gen, CEnv env)
        {
            int argCount = 0;

            foreach (var formArg in formArgs)
            {
                env.DeclareLocal(formArg.Fst);
                argCount++;
            }

            gen.Label(env.getFunctionLabel(fName));
            body.Compile(env, gen);
            gen.Emit(new RET(argCount));
            //throw new NotSupportedException("This functionality will be provided at a later moment.");
        }
        public override void Compile(CEnv env, Generator gen)
        {
            foreach (Expression arg in args)
            {
                arg.Compile(env, gen);
                env.PushTemporary();
            }

            String fLabel = env.getFunctionLabel(fName);

            gen.Emit(new CALL(args.Count, fLabel));

            foreach (Expression arg in args)
            {
                env.PopTemporary();
            }
        }