Exemple #1
0
        protected override IAstTreeNode Xform(ExpressionNode node)
        {
            foreach (var child in node.Children)
            {
                var childExpression = child as ExpressionNode;

                if (childExpression != null &&
                    node.OpCode == childExpression.OpCode &&
                    node.GetArity() == Arity.BinaryPlus)
                {
                    var clone = (ExpressionNode)node.Clone();
                    clone.Children.RemoveAll(cchild => cchild.Id == child.Id);
                    clone.Children.AddRange(child.Children);
                    return clone;
                }
            }

            return null;
        }
Exemple #2
0
 public NegationNode(ExpressionNode arg0)
     : base(arg0)
 {
 }
Exemple #3
0
 public override void Visit(ExpressionNode node)
 {
     if (!(node is TermNode) && !(node is NegationNode))
         writer.WriteLine(node.OpCode);
 }
Exemple #4
0
 public virtual void Visit(ExpressionNode node){}
Exemple #5
0
 public override void Visit(ExpressionNode node)
 {
     node.ValidateArity();
 }
Exemple #6
0
 public OrNode(ExpressionNode arg0, ExpressionNode arg1, params ExpressionNode[] args) 
     : base(arg0.Cons(arg1.Cons(args)))
 {
 }
Exemple #7
0
 public L1Expression(ExpressionNode expressionNode)
     :base(expressionNode)
 {
 }
Exemple #8
0
 protected virtual IAstTreeNode Xform(ExpressionNode node) { return null; }
Exemple #9
0
 public sealed override void Visit(ExpressionNode node) { VisitAndXform(node, Xform(node)); }