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; }
public NegationNode(ExpressionNode arg0) : base(arg0) { }
public override void Visit(ExpressionNode node) { if (!(node is TermNode) && !(node is NegationNode)) writer.WriteLine(node.OpCode); }
public virtual void Visit(ExpressionNode node){}
public override void Visit(ExpressionNode node) { node.ValidateArity(); }
public OrNode(ExpressionNode arg0, ExpressionNode arg1, params ExpressionNode[] args) : base(arg0.Cons(arg1.Cons(args))) { }
public L1Expression(ExpressionNode expressionNode) :base(expressionNode) { }
protected virtual IAstTreeNode Xform(ExpressionNode node) { return null; }
public sealed override void Visit(ExpressionNode node) { VisitAndXform(node, Xform(node)); }