public override void Visit(IExclusiveOr exclusiveOr) { if (Process(exclusiveOr)) { visitor.Visit(exclusiveOr); } base.Visit(exclusiveOr); }
private HLLocation ProcessExclusiveOrExpression(IExclusiveOr pExpression) { HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand); HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitBitwiseXor(locationTemporary, locationLeftOperand, locationRightOperand); return(pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary); }
public void Visit(IExclusiveOr exclusiveOr) { this.traverser.Traverse(exclusiveOr); }
/// <summary> /// Traverses the exclusive or expression. /// </summary> public void Traverse(IExclusiveOr exclusiveOr) { Contract.Requires(exclusiveOr != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(exclusiveOr); if (this.StopTraversal) return; this.TraverseChildren(exclusiveOr); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(exclusiveOr); }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public virtual void Visit(IExclusiveOr exclusiveOr) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(exclusiveOr); this.Visit(exclusiveOr.LeftOperand); this.Visit(exclusiveOr.RightOperand); //^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not to decrease this.path.Count. this.path.Pop(); }
public override void Visit(IExclusiveOr operation) { ProcessOperation(operation); }
public virtual void onASTElement(IExclusiveOr exclusiveOr) { }
public void Visit(IExclusiveOr exclusiveOr) { this.result = this.copier.Copy(exclusiveOr); }
/// <summary> /// Generates IL for the specified exclusive or. /// </summary> /// <param name="exclusiveOr">The exclusive or.</param> public override void TraverseChildren(IExclusiveOr exclusiveOr) { this.Traverse(exclusiveOr.LeftOperand); this.Traverse(exclusiveOr.RightOperand); this.generator.Emit(OperationCode.Xor); this.StackSize--; }
public override void Visit(IExclusiveOr exclusiveOr) { if(Process(exclusiveOr)){visitor.Visit(exclusiveOr);} base.Visit(exclusiveOr); }
private HLLocation ProcessExclusiveOrExpression(IExclusiveOr pExpression) { HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand); HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitBitwiseXor(locationTemporary, locationLeftOperand, locationRightOperand); return pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary; }
public void Visit(IExclusiveOr exclusiveOr) { this.result = this.rewriter.Rewrite(exclusiveOr); }
/// <summary> /// Rewrites the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public virtual IExpression Rewrite(IExclusiveOr exclusiveOr) { var mutableExclusiveOr = exclusiveOr as ExclusiveOr; if (mutableExclusiveOr == null) return exclusiveOr; this.RewriteChildren(mutableExclusiveOr); return mutableExclusiveOr; }
public void Visit(IExclusiveOr exclusiveOr) { Contract.Requires(exclusiveOr != null); throw new NotImplementedException(); }
/// <summary> /// /// </summary> /// <param name="exclusiveOr"></param> public ExclusiveOr(IExclusiveOr exclusiveOr) : base(exclusiveOr) { }
public override void TraverseChildren(IExclusiveOr exclusiveOr) { base.TraverseChildren(exclusiveOr); ((ExclusiveOr)exclusiveOr).Type = this.GetBitwiseOperationType(exclusiveOr); }
/// <summary> /// Visits the specified exclusive or. /// </summary> /// <param name="exclusiveOr">The exclusive or.</param> public override void Visit(IExclusiveOr exclusiveOr) { ExclusiveOr mutableExclusiveOr = exclusiveOr as ExclusiveOr; if (alwaysMakeACopy || mutableExclusiveOr == null) mutableExclusiveOr = new ExclusiveOr(exclusiveOr); this.resultExpression = this.myCodeMutator.Visit(mutableExclusiveOr); }
public override void Visit(IExclusiveOr exclusiveOr) { allElements.Add(new InvokInfo(Traverser, "IExclusiveOr", exclusiveOr)); }
public override void TraverseChildren(IExclusiveOr exclusiveOr) { var targetExpression = exclusiveOr.LeftOperand as ITargetExpression; if (targetExpression != null) { // x ^= e bool statement = this.currentExpressionIsOpAssignStatement; this.currentExpressionIsOpAssignStatement = false; this.VisitAssignment(targetExpression, exclusiveOr, (IExpression e) => this.TraverseExclusiveOrRightOperandAndDoOperation(e), treatAsStatement: statement, pushTargetRValue: true, resultIsInitialTargetRValue: exclusiveOr.ResultIsUnmodifiedLeftOperand); } else { // x ^ e this.Traverse(exclusiveOr.LeftOperand); this.TraverseExclusiveOrRightOperandAndDoOperation(exclusiveOr); } }
/// <summary> /// Rewrites the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public virtual IExpression Rewrite(IExclusiveOr exclusiveOr) { return exclusiveOr; }
public override void TraverseChildren(IExclusiveOr exclusiveOr) { MethodEnter(exclusiveOr); base.TraverseChildren(exclusiveOr); MethodExit(); }
public override IExpression Rewrite(IExclusiveOr operation) { return(ReplaceOperation(operation)); }
/// <summary> /// Returns a deep copy of the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public ExclusiveOr Copy(IExclusiveOr exclusiveOr) { Contract.Requires(exclusiveOr != null); Contract.Ensures(Contract.Result<ExclusiveOr>() != null); var mutableCopy = this.shallowCopier.Copy(exclusiveOr); this.CopyChildren((BinaryOperation)mutableCopy); return mutableCopy; }
/// <summary> /// Performs some computation with the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public virtual void Visit(IExclusiveOr exclusiveOr) { }
/// <summary> /// Returns a shallow copy of the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public ExclusiveOr Copy(IExclusiveOr exclusiveOr) { Contract.Requires(exclusiveOr != null); Contract.Ensures(Contract.Result<ExclusiveOr>() != null); return new ExclusiveOr(exclusiveOr); }
/// <summary> /// Traverses the children of the exclusive or expression. /// </summary> public virtual void TraverseChildren(IExclusiveOr exclusiveOr) { Contract.Requires(exclusiveOr != null); this.TraverseChildren((IBinaryOperation)exclusiveOr); }
/// <summary> /// Performs some computation with the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public virtual void Visit(IExclusiveOr exclusiveOr) { this.Visit((IBinaryOperation)exclusiveOr); }
/// <summary> /// Visits the specified exclusive or. /// </summary> /// <param name="exclusiveOr">The exclusive or.</param> public override void Visit(IExclusiveOr exclusiveOr) { ExclusiveOr mutableExclusiveOr = new ExclusiveOr(exclusiveOr); this.resultExpression = this.myCodeCopier.DeepCopy(mutableExclusiveOr); }
public void Visit(IExclusiveOr exclusiveOr) { throw new NotImplementedException(); }
/// <summary> /// Returns a deep copy of the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public ExclusiveOr Copy(IExclusiveOr exclusiveOr) { var mutableCopy = this.shallowCopier.Copy(exclusiveOr); this.CopyChildren((BinaryOperation)mutableCopy); return mutableCopy; }
public override void TraverseChildren(IExclusiveOr exclusiveOr) { var needsParen = LowerPrecedenceThanParentExpression(exclusiveOr); var savedCurrentPrecedence = this.currentPrecedence; this.currentPrecedence = this.Precedence(exclusiveOr); if (needsParen) this.sourceEmitterOutput.Write("("); this.Traverse(exclusiveOr.LeftOperand); if (exclusiveOr.LeftOperand is ITargetExpression) this.sourceEmitterOutput.Write(" ^= "); else this.sourceEmitterOutput.Write(" ^ "); this.Traverse(exclusiveOr.RightOperand); if (needsParen) this.sourceEmitterOutput.Write(")"); this.currentPrecedence = savedCurrentPrecedence; }
/// <summary> /// Returns a shallow copy of the given exclusive or expression. /// </summary> /// <param name="exclusiveOr"></param> public ExclusiveOr Copy(IExclusiveOr exclusiveOr) { return new ExclusiveOr(exclusiveOr); }
/// <summary> /// Visits the specified exclusive or. /// </summary> /// <param name="exclusiveOr">The exclusive or.</param> public override void Visit(IExclusiveOr exclusiveOr) { ExclusiveOr mutableExclusiveOr = exclusiveOr as ExclusiveOr; if (mutableExclusiveOr == null) { this.resultExpression = exclusiveOr; return; } this.resultExpression = this.myCodeMutator.Visit(mutableExclusiveOr); }