Beispiel #1
0
        /// <summary>
        /// Parser for ExpressionPredicate
        /// </summary>
        /// <param name="parsedExpression">Expression which is already parsed</param>
        /// <returns>Parsed ExpressionPredicate</returns>
        public ExpressionPredicate ParseExpressionPredicate(Expression parsedExpression)
        {
            ExpressionPredicate expressionPredicate = new ExpressionPredicate();

            expressionPredicate.SetExpression(parsedExpression);

            return expressionPredicate;
        }
Beispiel #2
0
        /// <summary>
        /// Parse an CatExpression
        /// </summary>
        /// <param name="expression">Expression which is already parsed</param>
        /// <returns></returns>
        public Expression ParseCatExpression(Expression expression)
        {
            CatExpression catExpression = new CatExpression();

            //Left part of catenation expression
            catExpression.SetLeftExpression(expression);

            //Skip + token
            NextToken("+", "expression + expression", '+');

            //Parse right part of token
            catExpression.SetRightExpression(ParseExpression());

            return catExpression;
        }
Beispiel #3
0
        /// <summary>
        /// Parser for IsPredicate
        /// </summary>
        /// <returns>Parsed IsPredicate</returns>
        public IsPredicate ParseIsPredicate(Expression parsedExpression)
        {
            IsPredicate isPredicate = new IsPredicate();

            //Set already parsed expression
            isPredicate.SetExpression(parsedExpression);

            //Skip . token
            NextToken(".", "Expression.Type?", '.');

            //Parse type
            isPredicate.SetType(ParseType());

            //Skip ? token
            NextToken("?", "Expression.Type?", '?');

            return isPredicate;
        }
Beispiel #4
0
 /// <summary>
 /// Add expression to ListExpression
 /// </summary>
 /// <param name="expression">Expression to add</param>
 public void AddExpression(Expression expression)
 {
     ExpressionList.Add(expression);
 }
Beispiel #5
0
 /// <summary>
 /// Set expression of ExpressionArgument
 /// </summary>
 /// <param name="expression">Expression to set</param>
 public void SetExpression(Expression expression)
 {
     Expr = expression;
 }
Beispiel #6
0
        /// <summary>
        /// Parse an FieldExpression
        /// </summary>
        /// <param name="expression">Expression which is already parsed</param>
        /// <returns></returns>
        public Expression ParseFieldExpression(Expression expression)
        {
            FieldExpression fieldExpression = new FieldExpression();

            //Add already parsed expression to field
            fieldExpression.SetExpression(expression);

            //Skip . token
            NextToken(".", "expression.identifier", '.');

            //Parse identifier
            CurrentToken = TokenStream.NextToken();
            fieldExpression.SetIdentifier(CurrentToken.GetValue().ToString());

            return fieldExpression;
        }
Beispiel #7
0
 /// <summary>
 /// Set right expression
 /// </summary>
 /// <param name="rightExpression">Expression</param>
 public void SetRightExpression(Expression rightExpression)
 {
     RightExpression = rightExpression;
 }
Beispiel #8
0
 /// <summary>
 /// Set left expression
 /// </summary>
 /// <param name="leftExpression">Expression</param>
 public void SetLeftExpression(Expression leftExpression)
 {
     LeftExpression = leftExpression;
 }