public override void Visit(IPopValue popValue)
 {
     if (Process(popValue))
     {
         visitor.Visit(popValue);
     }
     base.Visit(popValue);
 }
示例#2
0
文件: Unstacker.cs 项目: xornand/cci
        public override IExpression Rewrite(IPopValue popValue)
        {
            var t = popValue.Type;

            Contract.Assume(0 < this.locals.Count);
            var local = this.locals.Pop();

            if (this.inThenBranch)
            {
                var depth = this.locals.Count;
                if (this.thenBranchPushes != null && this.thenBranchPushes.ContainsKey(depth) && local == this.thenBranchPushes[depth].Target.Definition)
                {
                    this.thenBranchPushes.Remove(depth);
                }
            }
            var be = new BoundExpression()
            {
                Definition = local, Instance = null, Type = local.Type,
            };

            return(be);
        }
示例#3
0
 public override IExpression Rewrite(IPopValue popValue) {
   return this.previouslyPushedExpression;
 }
示例#4
0
 /// <summary>
 /// Allocates a shallow copy of an expression that results in the value on top of the implicit operand stack and that also pops that value from the stack.
 /// </summary>
 public PopValue(IPopValue popValue)
     : base(popValue)
 {
 }
 public override void TraverseChildren(IPopValue popValue) {
   this.sourceEmitterOutput.Write("pop");
 }
示例#6
0
 public void Visit(IPopValue popValue)
 {
     this.traverser.Traverse(popValue);
 }
示例#7
0
 public void Visit(IPopValue popValue)
 {
     Contract.Requires(popValue != null);
       throw new NotImplementedException();
 }
示例#8
0
 //^ ensures this.path.Count == old(this.path.Count);
 /// <summary>
 /// Traverses the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public virtual void Visit(IPopValue popValue)
 {
     if (this.stopTraversal) return;
 }
示例#9
0
 /// <summary>
 /// Traverses the pop value expression.
 /// </summary>
 public void Traverse(IPopValue popValue)
 {
     Contract.Requires(popValue != null);
       if (this.preorderVisitor != null) this.preorderVisitor.Visit(popValue);
       if (this.StopTraversal) return;
       this.TraverseChildren(popValue);
       if (this.StopTraversal) return;
       if (this.postorderVisitor != null) this.postorderVisitor.Visit(popValue);
 }
示例#10
0
 /// <summary>
 /// Performs some computation with the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public override void Visit(IPopValue popValue)
 {
     PopValue mutablePopValue = popValue as PopValue;
     if (alwaysMakeACopy || mutablePopValue == null) mutablePopValue = new PopValue(popValue);
     this.resultExpression = this.myCodeMutator.Visit(mutablePopValue);
 }
示例#11
0
文件: Unstacker.cs 项目: xornand/cci
 public override IExpression Rewrite(IPopValue popValue)
 {
     var t = popValue.Type;
     Contract.Assume(0 < this.locals.Count);
     var local = this.locals.Pop();
     if (this.inThenBranch) {
       var depth = this.locals.Count;
       if (this.thenBranchPushes != null && this.thenBranchPushes.ContainsKey(depth) && local == this.thenBranchPushes[depth].Target.Definition)
         this.thenBranchPushes.Remove(depth);
     }
     var be = new BoundExpression() { Definition = local, Instance = null, Type = local.Type, };
     return be;
 }
示例#12
0
 public override void Visit(IPopValue popValue)
 {
     allElements.Add(new InvokInfo(Traverser, "IPopValue", popValue));
 }
 /// <summary>
 /// Rewrites the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public virtual IExpression Rewrite(IPopValue popValue)
 {
     return popValue;
 }
示例#14
0
 public override IExpression Rewrite(IPopValue popValue)
 {
     return(base.Rewrite(popValue));
 }
示例#15
0
 /// <summary>
 /// Performs some computation with the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public override void TraverseChildren(IPopValue popValue)
 {
     //Do nothing. The containing expression or statement will consume the value.
 }
 public override void Visit(IPopValue popValue)
 {
     if(Process(popValue)){visitor.Visit(popValue);}
     base.Visit(popValue);
 }
示例#17
0
 public void Visit(IPopValue popValue)
 {
     this.result = this.rewriter.Rewrite(popValue);
 }
示例#18
0
 /// <summary>
 /// Rewrites the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public virtual IExpression Rewrite(IPopValue popValue)
 {
     var mutablePopValue = popValue as PopValue;
       if (mutablePopValue == null) return popValue;
       this.RewriteChildren(mutablePopValue);
       return mutablePopValue;
 }
示例#19
0
 public virtual void onASTElement(IPopValue popValue)
 {
 }
示例#20
0
    /// <summary>
    /// Returns a shallow copy of the given pop value expression.
    /// </summary>
    /// <param name="popValue"></param>
    public PopValue Copy(IPopValue popValue) {
      Contract.Requires(popValue != null);
      Contract.Ensures(Contract.Result<PopValue>() != null);

      return new PopValue(popValue);
    }
        public override void TraverseChildren(IPopValue popValue)
{ MethodEnter(popValue);
            base.TraverseChildren(popValue);
     MethodExit();   }
示例#22
0
    /// <summary>
    /// Returns a deep copy of the given pop value expression.
    /// </summary>
    /// <param name="popValue"></param>
    public PopValue Copy(IPopValue popValue) {
      Contract.Requires(popValue != null);
      Contract.Ensures(Contract.Result<PopValue>() != null);

      var mutableCopy = this.shallowCopier.Copy(popValue);
      this.CopyChildren((Expression)popValue);
      return mutableCopy;
    }
示例#23
0
 /// <summary>
 /// Performs some computation with the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public virtual void Visit(IPopValue popValue)
 {
 }
 /// <summary>
 /// Performs some computation with the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public virtual void Visit(IPopValue popValue)
 {
 }
示例#25
0
 /// <summary>
 /// Traverses the children of the pop value expression.
 /// </summary>
 public virtual void TraverseChildren(IPopValue popValue)
 {
     Contract.Requires(popValue != null);
       this.TraverseChildren((IExpression)popValue);
 }
示例#26
0
 /// <summary>
 /// Performs some computation with the given pop value expression.
 /// </summary>
 public override void Visit(IPopValue popValue)
 {
     PopValue mutablePopValue = new PopValue(popValue);
     this.resultExpression = this.myCodeCopier.DeepCopy(mutablePopValue);
 }
示例#27
0
 /// <summary>
 /// Performs some computation with the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public virtual void Visit(IPopValue popValue)
 {
     this.Visit((IExpression)popValue);
 }
示例#28
0
 /// <summary>
 /// Returns a deep copy of the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public PopValue Copy(IPopValue popValue)
 {
     var mutableCopy = this.shallowCopier.Copy(popValue);
       this.CopyChildren((Expression)popValue);
       return mutableCopy;
 }
示例#29
0
 public void Visit(IPopValue popValue)
 {
     throw new NotImplementedException();
 }
示例#30
0
 /// <summary>
 /// Returns a shallow copy of the given pop value expression.
 /// </summary>
 /// <param name="popValue"></param>
 public PopValue Copy(IPopValue popValue)
 {
     return new PopValue(popValue);
 }
 public override void TraverseChildren(IPopValue popValue) {
   this.foundAPop = true;
   this.StopTraversal = true;
 }
示例#32
0
 public void Visit(IPopValue popValue)
 {
     this.result = this.copier.Copy(popValue);
 }
 public virtual void onASTElement(IPopValue popValue) { }
 public override void TraverseChildren(IPopValue popValue) {
   var locExpr = this.sink.operandStack.Pop();
   this.TranslatedExpressions.Push(locExpr);
 }
示例#35
0
 public override void TraverseChildren(IPopValue popValue)
 {
     MethodEnter(popValue);
     base.TraverseChildren(popValue);
     MethodExit();
 }
示例#36
0
 /// <summary>
 /// Visits the specified PopValue.
 /// </summary>
 /// <param name="popValue">The PopValue.</param>
 public override void Visit(IPopValue popValue)
 {
     PopValue mutablePopValue = popValue as PopValue;
     if (mutablePopValue == null) {
       this.resultExpression = popValue;
       return;
     }
     this.resultExpression = this.myCodeMutator.Visit(mutablePopValue);
 }