Beispiel #1
0
 public void Visit(LetExp node)
 {
     sb.AppendFormat("let ");
     VariableDeclaration(node.Variable);
     sb.Append(" in ");
     node.InExpression.Accept(this);
 }
Beispiel #2
0
 public void Visit(LetExp node)
 {
     Expressions.Add(node.Variable.Value);
     Expressions.Add(node.InExpression);
     node.Variable.Value.Accept(this);
     node.InExpression.Accept(this);
 }
Beispiel #3
0
 public void Visit(LetExp node)
 {
     sb.AppendFormat("(let {0}:{1} = ", node.Variable.Name, node.Variable.PropertyType);
     node.Variable.Value.Accept(this);
     sb.Append("in");
     node.InExpression.Accept(this);
     sb.Append(")");
 }
Beispiel #4
0
        public override void Visit(LetExp node)
        {
            base.Visit(node);
            node.Variable.Value.Accept(this);
            node.InExpression.Accept(this);
            TranslationOption translationOption = new TranslationOption();

            translationOption.FormatString = string.Format("for ${0} in {{0}} return {{1}}", node.Variable.Name);
            SubexpressionTranslations.AddTranslationOption(node, translationOption, node.Variable.Value, node.InExpression);
        }
        public override bool Visit(LetExp node)
        {
            violatingExpression = node;
            bool valueDefAccept = node.Variable.Value.Accept(this);

            VariableClassMappings.CreateSubCollectionIfNeeded(node.Variable);

            isSuitable = false;
            return(false);
        }
 private void    removeAllLinks()
 {
     appliedProperty     = null;
     initializedVariable = null;
     loopExp             = null;
     navigationCallExp   = null;
     parentOperation     = null;
     ifExp           = null;
     thenClause      = null;
     elseClause      = null;
     letExp          = null;
     collectionRange = null;
     collectionItem  = null;
 }
Beispiel #7
0
        public void testLetOK_03()
        {
            List <object> constraints = doTestContextOK("context Film inv: let x : Integer = 20, y : Real = 40.10 in x > 0 ",
                                                        getCurrentMethodName());

            foreach (CSTInvariantCS constraint in constraints)
            {
                CSTExpressionInOclCS expression    = constraint.getExpressionNodeCS();
                OclExpression        oclExpression = ((ExpressionInOclImpl)expression.getAst()).getBodyExpression();

                Assert.IsTrue(oclExpression is LetExp);
                LetExp exp = (LetExp)oclExpression;

                Assert.AreEqual("Boolean", exp.getType().getName());
            }
        }
        public void testLetExp()
        {
            AstOclModelElementFactory factory1 = AstOclModelElementFactoryManager.getInstance(umlModel.getOclPackage());

            OclExpression       initExp  = factory1.createIntegerLiteralExp(100, getClassifier("Integer"));
            VariableDeclaration variable = factory1.createVariableDeclaration("abc", getClassifier("Integer"), initExp);

            OclExpression varExp     = factory1.createVariableExp(variable);
            OclExpression intLiteral = factory1.createIntegerLiteralExp(200, getClassifier("Integer"));
            List <object> paramTypes = new List <object>();

            paramTypes.Add(getClassifier("Integer"));
            CoreOperation oper = getClassifier("Integer").lookupOperation("+", paramTypes);

            List <object> args = new List <object> ();

            args.Add(intLiteral);
            OclExpression inExp = factory1.createOperationCallExp(varExp, oper, args, getClassifier("Integer"), false);

            LetExp exp = factory1.createLetExp(variable, inExp);

            Assert.AreEqual("let abc : Integer = 100 in abc + 200", exp.ToString());
            Assert.AreEqual("Integer", exp.getType().getName());
        }
Beispiel #9
0
 public override OclExpression Visit(LetExp node)
 {
     notSupportedExpression = node;
     isSuitable             = false;
     throw new OclConstructNotAvailableInPSM(node);
 }
Beispiel #10
0
 public virtual void Visit(LetExp node)
 {
     AssignIsPartOfIteratorBody(node);
 }
 /**
  * @param letExp The letExp to set.
  */
 public void setLetExp(LetExp letExp)
 {
     removeAllLinks();
     this.letExp = letExp;
 }
Beispiel #12
0
 /**
  * @param letExp The letExp to set.
  */
 public void setLetExp(LetExp letExp)
 {
     this.letExp = letExp;
 }
Beispiel #13
0
 public abstract TType Visit(LetExp node);
 public void endVisitLetExp(LetExp exp)
 {
 }
 public void beginVisitLetExp(LetExp exp)
 {
 }