Ejemplo n.º 1
0
 public override OclExpression Visit(EnumLiteralExp node)
 {
     /* For simplicity we do not allow this yet */
     notSupportedExpression = node;
     isSuitable             = false;
     throw new OclConstructNotAvailableInPSM(node);
 }
 public override bool Visit(EnumLiteralExp node)
 {
     /* For simplicity we do not allow this yet */
     violatingExpression = node;
     isSuitable          = false;
     return(false);
 }
        public void testEnumLiteralExp()
        {
            AstOclModelElementFactory factory1  = AstOclModelElementFactoryManager.getInstance(umlModel.getOclPackage());
            CoreEnumeration           situation = (CoreEnumeration)getClassifier("Situation");
            CoreEnumLiteral           married   = situation.lookupEnumLiteral("married");
            EnumLiteralExp            exp       = factory1.createEnumLiteralExp(married);

            Assert.AreEqual("Situation::married", exp.ToString());
        }
Ejemplo n.º 4
0
        public void testEnumerationLiteral_01()
        {
            List <object> constraints = doTestContextOK("context Film inv: Situation::married = Situation::married",
                                                        getCurrentMethodName());

            OclExpression oclExpression = getConstraintExpression(constraints);

            Assert.IsTrue(((OperationCallExp)oclExpression).getSource() is EnumLiteralExp);
            EnumLiteralExp exp = (EnumLiteralExp)((OperationCallExp)oclExpression).getSource();

            Assert.AreEqual("Situation", exp.getType().getName());
            Assert.AreEqual("married", exp.getReferredEnumLiteral().getName());
        }
Ejemplo n.º 5
0
        public void doTestEnumOK(String enumFullName, String enumName, String enumLiteral, String source)
        {
            CSTNode node = parseOK(enumFullName + "::" + enumLiteral, source);

            Assert.IsTrue(node is CSTClassifierAttributeCallExpCS);
            CSTClassifierAttributeCallExpCS literalExp = (CSTClassifierAttributeCallExpCS)node;

            Assert.IsNotNull(literalExp.getAst());
            Assert.IsTrue(literalExp.getAst() is EnumLiteralExp);
            EnumLiteralExp ast = (EnumLiteralExp)literalExp.getAst();

            Assert.AreEqual(enumLiteral, ast.getReferredEnumLiteral().getName());

            Assert.IsNotNull(ast.getType());
            Assert.AreEqual(enumName, ast.getType().getName());
        }
Ejemplo n.º 6
0
 public virtual void Visit(EnumLiteralExp node)
 {
     AssignIsPartOfIteratorBody(node);
     throw new ExpressionNotSupportedInXPath(node);
 }
Ejemplo n.º 7
0
 public void Visit(EnumLiteralExp node)
 {
 }
Ejemplo n.º 8
0
 public void Visit(EnumLiteralExp node)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 9
0
 public abstract TType Visit(EnumLiteralExp node);
 public void visitEnumLiteralExp(EnumLiteralExp exp)
 {
 }