Exemplo n.º 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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        public static IEnumerable <TokenType> Parse(string toParse)
        {
            var t = new StringTokenizer(toParse);

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