Пример #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);
        }