protected BinaryNode(Node leftNode, Node rightNode) { Debug.Assert(leftNode != null); Debug.Assert(rightNode != null); this.leftNode = leftNode; this.rightNode = rightNode; }
protected TernaryNode(Node firstNode, Node secondNode, Node thirdNode) { Debug.Assert(firstNode != null); Debug.Assert(secondNode != null); Debug.Assert(thirdNode != null); this.firstNode = firstNode; this.secondNode = secondNode; this.thirdNode = thirdNode; }
//private static readonly ExceptionHelper exceptionHelper = new ExceptionHelper(typeof(ConditionalBinaryNode)); protected ConditionalBinaryNode(Node leftNode, Node rightNode) : base(leftNode, rightNode) { }
//private static readonly ExceptionHelper exceptionHelper = new ExceptionHelper(typeof(NegateNode)); public NegateNode(Node node) : base(node) { }
//private static readonly ExceptionHelper exceptionHelper = new ExceptionHelper(typeof(TernaryConditionalNode)); public TernaryConditionalNode(Node firstNode, Node secondNode, Node thirdNode) : base(firstNode, secondNode, thirdNode) { }
protected UnaryNode(Node node) { Debug.Assert(node != null); this.node = node; }
// turn the expression into an AST each time it changes (not each time our Convert methods are called) private void EnsureExpressionNode() { if (this.expressionNode != null || string.IsNullOrEmpty(this.expression)) { return; } using (var stringReader = new StringReader(this.expression)) using (var tokenizer = new Tokenizer(stringReader)) using (var parser = new Parser(tokenizer)) { this.expressionNode = parser.ParseExpression(); } }
//private static readonly ExceptionHelper exceptionHelper = new ExceptionHelper(typeof(ComplementNode)); public ComplementNode(Node node) : base(node) { }