public override void Visit(IBitwiseAnd bitwiseAnd) { if (Process(bitwiseAnd)) { visitor.Visit(bitwiseAnd); } base.Visit(bitwiseAnd); }
private HLLocation ProcessBitwiseAndExpression(IBitwiseAnd pExpression) { HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand); HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitBitwiseAnd(locationTemporary, locationLeftOperand, locationRightOperand); return(pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary); }
/// <summary> /// Performs some computation with the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public virtual void Visit(IBitwiseAnd bitwiseAnd) { this.Visit((IBinaryOperation)bitwiseAnd); }
/// <summary> /// Traverses the children of the bitwise and expression. /// </summary> public virtual void TraverseChildren(IBitwiseAnd bitwiseAnd) { Contract.Requires(bitwiseAnd != null); this.TraverseChildren((IBinaryOperation)bitwiseAnd); }
/// <summary> /// Performs some computation with the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public virtual void Visit(IBitwiseAnd bitwiseAnd) { }
public override void Visit(IBitwiseAnd operation) { ProcessOperation(operation); }
public virtual void onASTElement(IBitwiseAnd bitwiseAnd) { }
public void Visit(IBitwiseAnd bitwiseAnd) { this.result = this.copier.Copy(bitwiseAnd); }
/// <summary> /// Generates IL for the specified bitwise and. /// </summary> /// <param name="bitwiseAnd">The bitwise and.</param> public override void TraverseChildren(IBitwiseAnd bitwiseAnd) { this.Traverse(bitwiseAnd.LeftOperand); this.Traverse(bitwiseAnd.RightOperand); this.generator.Emit(OperationCode.And); this.StackSize--; }
public override void Visit(IBitwiseAnd bitwiseAnd) { if(Process(bitwiseAnd)){visitor.Visit(bitwiseAnd);} base.Visit(bitwiseAnd); }
private HLLocation ProcessBitwiseAndExpression(IBitwiseAnd pExpression) { HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand); HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand); HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type))); mCurrentBlock.EmitBitwiseAnd(locationTemporary, locationLeftOperand, locationRightOperand); return pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary; }
public void Visit(IBitwiseAnd bitwiseAnd) { this.result = this.rewriter.Rewrite(bitwiseAnd); }
/// <summary> /// Rewrites the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public virtual IExpression Rewrite(IBitwiseAnd bitwiseAnd) { var mutableBitwiseAnd = bitwiseAnd as BitwiseAnd; if (mutableBitwiseAnd == null) return bitwiseAnd; this.RewriteChildren(mutableBitwiseAnd); return mutableBitwiseAnd; }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public virtual void Visit(IBitwiseAnd bitwiseAnd) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(bitwiseAnd); this.Visit(bitwiseAnd.LeftOperand); this.Visit(bitwiseAnd.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(); }
/// <summary> /// /// </summary> /// <param name="bitwiseAnd"></param> public BitwiseAnd(IBitwiseAnd bitwiseAnd) : base(bitwiseAnd) { }
public override void TraverseChildren(IBitwiseAnd bitwiseAnd) { base.TraverseChildren(bitwiseAnd); ((BitwiseAnd)bitwiseAnd).Type = this.GetBitwiseOperationType(bitwiseAnd); }
/// <summary> /// Visits the specified bitwise and. /// </summary> /// <param name="bitwiseAnd">The bitwise and.</param> public override void Visit(IBitwiseAnd bitwiseAnd) { BitwiseAnd mutableBitwiseAnd = bitwiseAnd as BitwiseAnd; if (alwaysMakeACopy || mutableBitwiseAnd == null) mutableBitwiseAnd = new BitwiseAnd(bitwiseAnd); this.resultExpression = this.myCodeMutator.Visit(mutableBitwiseAnd); }
public override void Visit(IBitwiseAnd bitwiseAnd) { allElements.Add(new InvokInfo(Traverser, "IBitwiseAnd", bitwiseAnd)); }
public override void TraverseChildren(IBitwiseAnd bitwiseAnd) { var targetExpression = bitwiseAnd.LeftOperand as ITargetExpression; if (targetExpression != null) { // x &= e bool statement = this.currentExpressionIsOpAssignStatement; this.currentExpressionIsOpAssignStatement = false; this.VisitAssignment(targetExpression, bitwiseAnd, (IExpression e) => this.TraverseBitwiseAndRightOperandAndDoOperation(e), treatAsStatement: statement, pushTargetRValue: true, resultIsInitialTargetRValue: bitwiseAnd.ResultIsUnmodifiedLeftOperand); } else { // x & e this.Traverse(bitwiseAnd.LeftOperand); this.TraverseBitwiseAndRightOperandAndDoOperation(bitwiseAnd); } }
/// <summary> /// Rewrites the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public virtual IExpression Rewrite(IBitwiseAnd bitwiseAnd) { return bitwiseAnd; }
public override void TraverseChildren(IBitwiseAnd bitwiseAnd) { MethodEnter(bitwiseAnd); base.TraverseChildren(bitwiseAnd); MethodExit(); }
public override IExpression Rewrite(IBitwiseAnd operation) { return(ReplaceOperation(operation)); }
/// <summary> /// Returns a deep copy of the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public BitwiseAnd Copy(IBitwiseAnd bitwiseAnd) { Contract.Requires(bitwiseAnd != null); Contract.Ensures(Contract.Result<BitwiseAnd>() != null); var mutableCopy = this.shallowCopier.Copy(bitwiseAnd); this.CopyChildren((BinaryOperation)mutableCopy); return mutableCopy; }
/// <summary> /// Traverses the bitwise and expression. /// </summary> public void Traverse(IBitwiseAnd bitwiseAnd) { Contract.Requires(bitwiseAnd != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(bitwiseAnd); if (this.StopTraversal) return; this.TraverseChildren(bitwiseAnd); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(bitwiseAnd); }
/// <summary> /// Returns a shallow copy of the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public BitwiseAnd Copy(IBitwiseAnd bitwiseAnd) { Contract.Requires(bitwiseAnd != null); Contract.Ensures(Contract.Result<BitwiseAnd>() != null); return new BitwiseAnd(bitwiseAnd); }
public void Visit(IBitwiseAnd bitwiseAnd) { this.traverser.Traverse(bitwiseAnd); }
public void Visit(IBitwiseAnd bitwiseAnd) { Contract.Requires(bitwiseAnd != null); throw new NotImplementedException(); }
/// <summary> /// Visits the specified bitwise and. /// </summary> /// <param name="bitwiseAnd">The bitwise and.</param> public override void Visit(IBitwiseAnd bitwiseAnd) { BitwiseAnd mutableBitwiseAnd = new BitwiseAnd(bitwiseAnd); this.resultExpression = this.myCodeCopier.DeepCopy(mutableBitwiseAnd); }
public void Visit(IBitwiseAnd bitwiseAnd) { throw new NotImplementedException(); }
/// <summary> /// Returns a deep copy of the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public BitwiseAnd Copy(IBitwiseAnd bitwiseAnd) { var mutableCopy = this.shallowCopier.Copy(bitwiseAnd); this.CopyChildren((BinaryOperation)mutableCopy); return mutableCopy; }
public override void TraverseChildren(IBitwiseAnd bitwiseAnd) { var needsParen = LowerPrecedenceThanParentExpression(bitwiseAnd); var savedCurrentPrecedence = this.currentPrecedence; this.currentPrecedence = this.Precedence(bitwiseAnd); if (needsParen) this.sourceEmitterOutput.Write("("); this.Traverse(bitwiseAnd.LeftOperand); if (bitwiseAnd.LeftOperand is ITargetExpression) this.sourceEmitterOutput.Write(" &= "); else this.sourceEmitterOutput.Write(" & "); this.Traverse(bitwiseAnd.RightOperand); if (needsParen) this.sourceEmitterOutput.Write(")"); this.currentPrecedence = savedCurrentPrecedence; }
/// <summary> /// Returns a shallow copy of the given bitwise and expression. /// </summary> /// <param name="bitwiseAnd"></param> public BitwiseAnd Copy(IBitwiseAnd bitwiseAnd) { return new BitwiseAnd(bitwiseAnd); }
/// <summary> /// Visits the specified bitwise and. /// </summary> /// <param name="bitwiseAnd">The bitwise and.</param> public override void Visit(IBitwiseAnd bitwiseAnd) { BitwiseAnd mutableBitwiseAnd = bitwiseAnd as BitwiseAnd; if (mutableBitwiseAnd == null) { this.resultExpression = bitwiseAnd; return; } this.resultExpression = this.myCodeMutator.Visit(mutableBitwiseAnd); }