Beispiel #1
0
        public virtual Expr parseStatement(string paramString)
        {
            paramString = StringUtils.escapeParametricExpression(paramString);
            ExprParser exprParser = new ExprParser();

            try
            {
                exprParser.parse(new ExprLexer(paramString));
            }
            catch (IOException iOException)
            {
                Console.WriteLine(iOException.ToString());
                Console.Write(iOException.StackTrace);
                throw new ExprException(iOException.Message);
            }
            Expr expr = exprParser.get();

            Exprs.ToUpper(expr);
            if (expr is ExprEvaluatable)
            {
                expr = ((ExprEvaluatable)expr).evaluate(this);
            }
            else
            {
                throw new ExprException("Not Evaluatable result for: " + paramString);
            }
            return(expr);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.boris.expr.Expr parseAndValidate(String paramString) throws java.io.IOException, org.boris.expr.ExprException
        public virtual Expr parseAndValidate(string paramString)
        {
            ExprParser exprParser = new ExprParser();

            exprParser.ParserVisitor = this;
            exprParser.parse(new ExprLexer(paramString));
            Expr expr = exprParser.get();

            Exprs.ToUpper(expr);
            return(expr);
        }