internal static ExpressionNode ParseExpression(string line, int startIndex) { if (startIndex >= line.Length) { return(null); } var oper = ParseOperator(line, startIndex); if (oper == null) { return(null); } ReducibleNode left = ParseNumeric(line, oper.NextIndex); if (left == null) { left = ParseExpression(line, oper.NextIndex); if (left == null) { return(null); } } ReducibleNode right = ParseNumeric(line, left.NextIndex); if (right == null) { right = ParseExpression(line, left.NextIndex); if (right == null) { return(null); } } var index = SkipWhiteSpace(line, right.NextIndex); return(new ExpressionNode(oper, left, right, index)); }
public ExpressionNode(OperatorNode oper, ReducibleNode left, ReducibleNode right, int nextIndex) : base(nextIndex) { this.Operator = oper; this.Left = left; this.Right = right; }