public static ExpressionBuilder Create()
 {
     ExpressionBuilder builder = new ExpressionBuilder();
     builder.AllExpressions = new List<MathExpression>();
     builder.CurrentIndex = 0;
     builder.InputText = String.Empty;
     builder.SubExpression = new MathExpression(String.Empty);
     return builder;
 }
 private void getExpressions(ExpressionBuilder expBuilder, ref int openedParanthesis)
 {
     while (expBuilder.ThereAreMoreChars())
     {
         char currentChar = expBuilder.GetCurrentChar();
         if (currentChar == OPEN_SUBEXPRESSION)
         {
             openedParanthesis++;
             getExpressions(expBuilder.ProcessNewSubExpression(),
                            ref openedParanthesis);
         }
         else if (currentChar == CLOSE_SUBEXPRESSION)
         {
             expBuilder.SubExpressionEndFound();
             openedParanthesis--;
             return;
         }
         else
             expBuilder.AddSubExpressionChar();
     }
     expBuilder.SubExpressionEndFound();
 }
 public ExpressionBuilder ProcessNewSubExpression()
 {
     ExpressionBuilder builder = new ExpressionBuilder();
     builder.InputText = _inputText;
     builder.SubExpression = new MathExpression(String.Empty);
     updateIndex();
     return builder;
 }