Ejemplo n.º 1
0
        private static void Cast(Compiler cmp, Argument[] args)
        {
            Function fct = cmp.Functions.Last();
            Variable v1  = ArgumentSelector.ExtractVar(fct, args[1]);
            Variable v2  = ArgumentSelector.ExtractVar(fct, args[2]);

            CastInstruction c = new CastInstruction(v1, v2);

            fct.Instructions.Add(c);
        }
Ejemplo n.º 2
0
        public static void If(Compiler cmp, Argument[] args)
        {
            Function      fct = cmp.Functions.Last();
            IfInstruction i   = new IfInstruction();

            i.V1    = ArgumentSelector.ExtractOrder <Variable>(ArgumentSelector.Const_Variable, fct, args[1]);
            i.V2    = ArgumentSelector.ExtractOrder <Variable>(ArgumentSelector.Const_Variable, fct, args[3]);
            i.Flag  = Flags[args[2]];
            i.Label = args[4];

            fct.Instructions.Add(i);
        }