コード例 #1
0
ファイル: PrintVisitor.cs プロジェクト: mff-uk/exolutio
 public void Visit(LetExp node)
 {
     sb.AppendFormat("let ");
     VariableDeclaration(node.Variable);
     sb.Append(" in ");
     node.InExpression.Accept(this);
 }
コード例 #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);
 }
コード例 #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(")");
 }
コード例 #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);
        }
コード例 #5
0
        public override bool Visit(LetExp node)
        {
            violatingExpression = node;
            bool valueDefAccept = node.Variable.Value.Accept(this);

            VariableClassMappings.CreateSubCollectionIfNeeded(node.Variable);

            isSuitable = false;
            return(false);
        }
コード例 #6
0
 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;
 }
コード例 #7
0
ファイル: TestLetExp.cs プロジェクト: leocrantunes/SheetModel
        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());
            }
        }
コード例 #8
0
        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());
        }
コード例 #9
0
 public override OclExpression Visit(LetExp node)
 {
     notSupportedExpression = node;
     isSuitable             = false;
     throw new OclConstructNotAvailableInPSM(node);
 }
コード例 #10
0
 public virtual void Visit(LetExp node)
 {
     AssignIsPartOfIteratorBody(node);
 }
コード例 #11
0
 /**
  * @param letExp The letExp to set.
  */
 public void setLetExp(LetExp letExp)
 {
     removeAllLinks();
     this.letExp = letExp;
 }
コード例 #12
0
 /**
  * @param letExp The letExp to set.
  */
 public void setLetExp(LetExp letExp)
 {
     this.letExp = letExp;
 }
コード例 #13
0
 public abstract TType Visit(LetExp node);
コード例 #14
0
 public void endVisitLetExp(LetExp exp)
 {
 }
コード例 #15
0
 public void beginVisitLetExp(LetExp exp)
 {
 }