/// <summary> /// Constructor /// </summary> /// <param name="op">Operator used as a prefix</param> /// <param name="value">Value of the node</param> public UnaryPrefixNode(UnaryOperatorType op, IUnaryNode value) { Operator = op; Value = value; }
/// <summary> /// Constructor /// </summary> /// <param name="left">Left part of the node</param> /// <param name="rights">Right parts of the node, each with operator</param> public BinaryNode(IUnaryNode left, IEnumerable <BinaryNodeItem>?rights = null) { Left = new BinaryNodeItem(BinaryOperatorType.Result, left); Rights = rights != null?rights.ToList() : new List <BinaryNodeItem>(); }
/// <summary> /// Constructor /// </summary> /// <param name="op">Operator</param> /// <param name="item">Unary node used as a right part of a binary node</param> public BinaryNodeItem(BinaryOperatorType op, IUnaryNode item) { Operator = op; Item = item; }