Esempio n. 1
0
 /* (non-Javadoc)
  * @see br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTNode#accept(br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTVisitor)
  */
 public override void accept(CSTVisitor visitor)
 {
     if (expression != null)
     {
         expression.accept(visitor);
         visitor.visitUnaryExpression(this);
     }
 }
Esempio n. 2
0
 /* (non-Javadoc)
  * @see br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTNode#accept(br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTVisitor)
  */
 public override void accept(CSTVisitor visitor)
 {
     if (bodyExpression != null)
     {
         accept(variables, visitor);
         visitor.visitBeginIteratorExp(this);
         bodyExpression.accept(visitor);
         visitor.visitEndIteratorExp(this);
     }
 }
 /* (non-Javadoc)
  * @see br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTNode#accept(br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTVisitor)
  */
 public override void accept(CSTVisitor visitor)
 {
     if ((leftExpression != null) && (operat != null) &&
         (rightExpression != null))
     {
         leftExpression.accept(visitor);
         rightExpression.accept(visitor);
         visitor.visitBinaryExpression(this);
     }
 }
Esempio n. 4
0
        /* (non-Javadoc)
         * @see br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTNode#accept(br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTVisitor)
         */
        public override void accept(CSTVisitor visitor)
        {
            if (iterators != null)
            {
                base.accept(iterators, visitor);
            }

            if ((result != null) && (bodyExpression != null))
            {
                result.accept(visitor);
                visitor.visitBeginIterateExp(this);
                bodyExpression.accept(visitor);
                visitor.visitEndIterateExp(this);
            }
        }
        /* (non-Javadoc)
         * @see br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTNode#accept(br.cos.ufrj.lens.odyssey.tools.psw.parser.cst.CSTVisitor)
         */
        public override void accept(CSTVisitor visitor)
        {
            if (callExp != null)
            {
                callExp.accept(visitor);
                visitor.visitNavigationExpressionBegin(this, callExp);

                //var expAndOperators = innerNavigation.Zip(operators, (e, o) => new { Expression = e, Operator = o });
                //foreach (var e in expAndOperators)
                //{
                //    CSTOclExpressionCS innerExp = (CSTOclExpressionCS) e.Expression;
                //    CSTNavigationOperatorCS operat = (CSTNavigationOperatorCS) e.Operator;

                //    if ((innerExp != null) && (operat != null))
                //    {
                //        operat.accept(visitor);
                //        innerExp.accept(visitor);
                //        visitor.visitNavigationExpression(this, innerExp);
                //    }
                //}

                var iter         = innerNavigation.GetEnumerator();
                var iterOperator = operators.GetEnumerator();
                while (iter.MoveNext() && iterOperator.MoveNext())
                {
                    CSTOclExpressionCS      innerExp = (CSTOclExpressionCS)iter.Current;
                    CSTNavigationOperatorCS operat   = (CSTNavigationOperatorCS)iterOperator.Current;

                    if ((innerExp != null) && (operat != null))
                    {
                        operat.accept(visitor);
                        innerExp.accept(visitor);
                        visitor.visitNavigationExpression(this, innerExp);
                    }
                }

                visitor.visitNavigationExpressionEnd(this, innerNavigation, callExp);
            }
        }