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(); }
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)); }
protected abstract void VisitNegateInstruction(NegateInstruction instruction);