Beispiel #1
0
        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));
        }
Beispiel #3
0
        public static IEnumerable <TokenType> Parse(string toParse)
        {
            var t = new StringTokenizer(toParse);

            while (t.GetNextToken() != TokenType.EndOfInput)
            {
                yield return(t.CurrentToken);
            }
        }