예제 #1
0
		public FluentEmitter IfNot()
		{
			Pop();
			var block = new IfBlock() { StartInstruction = LastEmittedInstruction, OpCode = OpCodes.Brtrue }; // it jumps if value top on stack is true
			IfBlocks.Push(block);
			return this;
		}
예제 #2
0
		public FluentEmitter Ifgte()
		{
			Pop();
			var pop1 = LastEmittedInstruction;
			Pop();
			var block = new IfBlock() { StartInstruction = pop1, IsDoublePop = true, OpCode = OpCodes.Blt };
			IfBlocks.Push(block);
			return this;
		}
예제 #3
0
        public FluentEmitter IfNot()
        {
            Pop();
            var block = new IfBlock()
            {
                StartInstruction = LastEmittedInstruction, OpCode = OpCodes.Brtrue
            };                                                                                                            // it jumps if value top on stack is true

            IfBlocks.Push(block);
            return(this);
        }
예제 #4
0
		public FluentEmitter Else()
		{
			if(IfBlocks.Count == 0 || IfBlocks.Peek().OpCode == OpCodes.Br)
				throw new Exception("no if blfor else");
			Nop();
			var jumpstart = LastEmittedInstruction;
			EndIf();
			var block = new IfBlock() { StartInstruction = jumpstart, OpCode = OpCodes.Br }; // it jumps if value top on stack is true
			IfBlocks.Push(block);
			return this;
		}
예제 #5
0
        public FluentEmitter Ifgte()
        {
            Pop();
            var pop1 = LastEmittedInstruction;

            Pop();
            var block = new IfBlock()
            {
                StartInstruction = pop1, IsDoublePop = true, OpCode = OpCodes.Blt
            };

            IfBlocks.Push(block);
            return(this);
        }
예제 #6
0
        public FluentEmitter Else()
        {
            if (IfBlocks.Count == 0 || IfBlocks.Peek().OpCode == OpCodes.Br)
            {
                throw new Exception("no if blfor else");
            }
            Nop();
            var jumpstart = LastEmittedInstruction;

            EndIf();
            var block = new IfBlock()
            {
                StartInstruction = jumpstart, OpCode = OpCodes.Br
            };                                                                                           // it jumps if value top on stack is true

            IfBlocks.Push(block);
            return(this);
        }