public static double Compute(string expression) { var t = new StringTokenizer(expression); // With this tokenizer, head must be forwarded at first. return(t.GetNextToken() == TokenType.EndOfInput ? 0.0 : ComputeCondExpression(t)); }
public Node Parse(string expression) { var t = new StringTokenizer(expression); // With this tokenizer, head must be forwarded at first. return(t.GetNextToken() == TokenType.EndOfInput ? null : Parse(t)); }
public static IEnumerable <TokenType> Parse(string toParse) { var t = new StringTokenizer(toParse); while (t.GetNextToken() != TokenType.EndOfInput) { yield return(t.CurrentToken); } }