Esempio n. 1
0
 public override void Generate(ModuleContext context)
 {
     item2Exp.Generate(context);
     item1Exp.Generate(context);
     context.Add(new ByteCode {
         opCode = ByteCode.OpCode.Bind
     });
 }
Esempio n. 2
0
        public override void Generate(ModuleContext context)
        {
            context.BeginLoop();
            var beginLabel = new LabelExpression(context.NewUID(), debugInfo);

            beginLabel.Generate(context);
            var jumpBegin = new LuaLabel(context.vm, beginLabel.value, beginLabel.index);
            var endLabel  = new LabelExpression(context.NewUID(), debugInfo);
            var jumpEnd   = new LuaLabel(context.vm, endLabel.value, endLabel.index);

            moduleExp.Generate(context);
            context.Add(new ByteCode {
                opCode = ByteCode.OpCode.Jump, opArg = jumpBegin
            });
            endLabel.Generate(context);
            jumpEnd.index = endLabel.index;
            context.EndLoop(jumpEnd);
        }
Esempio n. 3
0
 public override void Generate(ModuleContext context)
 {
     context.Add(new ByteCode {
         opCode = ByteCode.OpCode.Push, opArg = context.vm.GetString(value)
     });
 }
Esempio n. 4
0
 public override void Generate(ModuleContext context)
 {
     context.Add(new ByteCode {
         opCode = ByteCode.OpCode.Push, opArg = context.vm.nil
     });
 }