Пример #1
0
        protected override void VisitNegateInstruction(NegateInstruction instruction)
        {
            ControlState.EvaluationStack.Pop(out var stackVal);
            var resultStackVal = ComputeUnaryNumericOperation(
                stackVal,
                a => new CilStackValueInt32(-a.Value),
                a => new CilStackValueInt64(-a.Value),
                a => new CilStackValueFloat(-a.Value)
                );

            ControlState.EvaluationStack.Push(resultStackVal);

            ControlState.MoveToNextInstruction();
        }
Пример #2
0
        public override Verb CreateVerb(string[] tokens)
        {
            Color(position, length, Operators);
            switch (tokens[1])
            {
            case "-":
                Element = new AbortElement();
                break;

            case ";":
                Element = new FailElement();
                break;

            case ":":
                Element = new FenceElement();
                break;

            case "^":
                Element = new AnchorElement();
                break;

            case "!":
                Element     = new NegateElement();
                Instruction = new NegateInstruction();
                break;

            case "&":
                Element = new UseCaseElement();
                break;

            case "\\":
                Element = new RecordSeparatorElement();
                break;

            default:
                return(null);
            }
            return(new NullOp());
        }
 public void EmitNegate(Type type)
 {
     Emit(NegateInstruction.Create(type));
 }
Пример #4
0
 protected abstract void VisitNegateInstruction(NegateInstruction instruction);