Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 149105 Details for
Bug 184048
[parser] OCLLPGParser.g grammer incorrectly defines 'if' expression
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fixing patch
ocl184048.patch (text/plain), 178.42 KB, created by
Adolfo Sanchez-Barbudo Herrera
on 2009-10-08 08:52:56 EDT
(
hide
)
Description:
Fixing patch
Filename:
MIME Type:
Creator:
Adolfo Sanchez-Barbudo Herrera
Created:
2009-10-08 08:52:56 EDT
Size:
178.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ocl.ecore.tests >Index: src/org/eclipse/ocl/ecore/tests/BasicOCLTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/tests/org.eclipse.ocl.ecore.tests/src/org/eclipse/ocl/ecore/tests/BasicOCLTest.java,v >retrieving revision 1.11 >diff -u -r1.11 BasicOCLTest.java >--- src/org/eclipse/ocl/ecore/tests/BasicOCLTest.java 7 Oct 2009 20:39:29 -0000 1.11 >+++ src/org/eclipse/ocl/ecore/tests/BasicOCLTest.java 8 Oct 2009 11:53:17 -0000 >@@ -14,7 +14,7 @@ > * > * </copyright> > * >- * $Id: BasicOCLTest.java,v 1.11 2009/10/07 20:39:29 ewillink Exp $ >+ * $Id: BasicOCLTest.java,v 1.10 2009/10/07 16:59:09 ewillink Exp $ > */ > > package org.eclipse.ocl.ecore.tests; >@@ -260,6 +260,32 @@ > assertFalse(check(expr, eCls)); > } > >+ public void testIfExpressions_184048() { >+ EClass eCls = EcoreFactory.eINSTANCE.createEClass(); >+ eCls.setName("bar"); //$NON-NLS-1$ >+ >+ OCLExpression<EClassifier> expr = parse( >+ "package ecore context EClass " + //$NON-NLS-1$ >+ "inv: if self.abstract then name = 'bar' else name <> 'bar' endif ->asSequence()->at(1)" + //$NON-NLS-1$ >+ "endpackage "); //$NON-NLS-1$ >+ >+ assertFalse(check(expr, eCls)); >+ >+ eCls.setAbstract(true); >+ >+ assertTrue(check(expr, eCls)); >+ >+ eCls.setName("foo"); //$NON-NLS-1$ >+ >+ assertFalse(check(expr, eCls)); >+ >+ OCLExpression<EClassifier> expr2 = parse( >+ "package ecore context EClass " + //$NON-NLS-1$ >+ "inv: 7 = 1 + let a : String = invalid in 1 + if self.oclIsUndefined() then 1 else 5 endif " + //$NON-NLS-1$ >+ "endpackage "); //$NON-NLS-1$ >+ assertTrue(check(expr2, eCls)); >+ } >+ > public void testLetExpressions() { > EClass eCls = EcoreFactory.eINSTANCE.createEClass(); > eCls.setName("foo"); //$NON-NLS-1$ >@@ -359,14 +385,10 @@ > String self = ""; //$NON-NLS-1$ > > try { >- assertInvalidString("'\\\\\\ '"); //$NON-NLS-1$ > assertInvalidString("'str\\(ing'"); //$NON-NLS-1$ > assertInvalidString("'string\\'"); //$NON-NLS-1$ > assertInvalidString("'string\\9'"); //$NON-NLS-1$ > >- assertEquals("\\", //$NON-NLS-1$ >- evaluate(helper, self, "'\\\\'")); //$NON-NLS-1$ >- > assertEquals("str\ning", //$NON-NLS-1$ > evaluate(helper, self, "'str\\ning'")); //$NON-NLS-1$ > >#P org.eclipse.ocl >Index: src/org/eclipse/ocl/cst/impl/StateExpCSImpl.java >=================================================================== >RCS file: src/org/eclipse/ocl/cst/impl/StateExpCSImpl.java >diff -N src/org/eclipse/ocl/cst/impl/StateExpCSImpl.java >--- src/org/eclipse/ocl/cst/impl/StateExpCSImpl.java 4 Sep 2009 13:40:43 -0000 1.4 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,170 +0,0 @@ >-/** >- * <copyright> >- * >- * Copyright (c) 2005, 2008 IBM Corporation, Zeligsoft Inc., and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM - Initial API and implementation >- * Zeligsoft - Bug 243976 >- * >- * </copyright> >- * >- * $Id: StateExpCSImpl.java,v 1.4 2009/09/04 13:40:43 ewillink Exp $ >- */ >-package org.eclipse.ocl.cst.impl; >- >-import java.util.Collection; >- >-import org.eclipse.emf.common.notify.NotificationChain; >-import org.eclipse.emf.common.util.EList; >-import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.InternalEObject; >-import org.eclipse.emf.ecore.util.EObjectContainmentEList; >-import org.eclipse.emf.ecore.util.InternalEList; >-import org.eclipse.ocl.cst.CSTPackage; >-import org.eclipse.ocl.cst.SimpleNameCS; >-import org.eclipse.ocl.cst.StateExpCS; >- >-/** >- * <!-- begin-user-doc --> >- * An implementation of the model object '<em><b>State Exp CS</b></em>'. >- * <!-- end-user-doc --> >- * <p> >- * The following features are implemented: >- * <ul> >- * <li>{@link org.eclipse.ocl.cst.impl.StateExpCSImpl#getSimpleNames <em>Simple Names</em>}</li> >- * </ul> >- * </p> >- * >- * @generated >- */ >-public class StateExpCSImpl >- extends TypeCSImpl >- implements StateExpCS { >- >- /** >- * The cached value of the '{@link #getSimpleNames() <em>Simple Names</em>}' containment reference list. >- * <!-- begin-user-doc --> >- * @since 3.0 >- * <!-- end-user-doc --> >- * @see #getSimpleNames() >- * @generated >- * @ordered >- */ >- protected EList<SimpleNameCS> simpleNames; >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- protected StateExpCSImpl() { >- super(); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- protected EClass eStaticClass() { >- return CSTPackage.Literals.STATE_EXP_CS; >- } >- >- /** >- * <!-- begin-user-doc --> >- * @since 3.0 >- * <!-- end-user-doc --> >- * @generated >- */ >- public EList<SimpleNameCS> getSimpleNames() { >- if (simpleNames == null) { >- simpleNames = new EObjectContainmentEList<SimpleNameCS>( >- SimpleNameCS.class, this, CSTPackage.STATE_EXP_CS__SIMPLE_NAMES); >- } >- return simpleNames; >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public NotificationChain eInverseRemove(InternalEObject otherEnd, >- int featureID, NotificationChain msgs) { >- switch (featureID) { >- case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES : >- return ((InternalEList<?>) getSimpleNames()).basicRemove( >- otherEnd, msgs); >- } >- return super.eInverseRemove(otherEnd, featureID, msgs); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public Object eGet(int featureID, boolean resolve, boolean coreType) { >- switch (featureID) { >- case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES : >- return getSimpleNames(); >- } >- return super.eGet(featureID, resolve, coreType); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @SuppressWarnings("unchecked") >- @Override >- public void eSet(int featureID, Object newValue) { >- switch (featureID) { >- case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES : >- getSimpleNames().clear(); >- getSimpleNames().addAll( >- (Collection<? extends SimpleNameCS>) newValue); >- return; >- } >- super.eSet(featureID, newValue); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public void eUnset(int featureID) { >- switch (featureID) { >- case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES : >- getSimpleNames().clear(); >- return; >- } >- super.eUnset(featureID); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public boolean eIsSet(int featureID) { >- switch (featureID) { >- case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES : >- return simpleNames != null && !simpleNames.isEmpty(); >- } >- return super.eIsSet(featureID); >- } >- >-} //StateExpCSImpl >Index: src/org/eclipse/ocl/cst/impl/InvalidLiteralExpCSImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/impl/InvalidLiteralExpCSImpl.java,v >retrieving revision 1.3 >diff -u -r1.3 InvalidLiteralExpCSImpl.java >--- src/org/eclipse/ocl/cst/impl/InvalidLiteralExpCSImpl.java 30 Nov 2008 22:11:37 -0000 1.3 >+++ src/org/eclipse/ocl/cst/impl/InvalidLiteralExpCSImpl.java 8 Oct 2009 11:53:24 -0000 >@@ -17,9 +17,7 @@ > */ > package org.eclipse.ocl.cst.impl; > >-import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.ocl.cst.CSTPackage; > import org.eclipse.ocl.cst.InvalidLiteralExpCS; > >@@ -28,39 +26,15 @@ > * An implementation of the model object '<em><b>Invalid Literal Exp CS</b></em>'. > * <!-- end-user-doc --> > * <p> >- * The following features are implemented: >- * <ul> >- * <li>{@link org.eclipse.ocl.cst.impl.InvalidLiteralExpCSImpl#getSymbol <em>Symbol</em>}</li> >- * </ul> > * </p> > * > * @generated > */ > public class InvalidLiteralExpCSImpl >- extends LiteralExpCSImpl >+ extends SimpleNameCSImpl > implements InvalidLiteralExpCS { > > /** >- * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @see #getSymbol() >- * @generated >- * @ordered >- */ >- protected static final String SYMBOL_EDEFAULT = null; >- >- /** >- * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @see #getSymbol() >- * @generated >- * @ordered >- */ >- protected String symbol = SYMBOL_EDEFAULT; >- >- /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -79,103 +53,4 @@ > return CSTPackage.Literals.INVALID_LITERAL_EXP_CS; > } > >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public String getSymbol() { >- return symbol; >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public void setSymbol(String newSymbol) { >- String oldSymbol = symbol; >- symbol = newSymbol; >- if (eNotificationRequired()) >- eNotify(new ENotificationImpl(this, Notification.SET, >- CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL, oldSymbol, symbol)); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public Object eGet(int featureID, boolean resolve, boolean coreType) { >- switch (featureID) { >- case CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL : >- return getSymbol(); >- } >- return super.eGet(featureID, resolve, coreType); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public void eSet(int featureID, Object newValue) { >- switch (featureID) { >- case CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL : >- setSymbol((String) newValue); >- return; >- } >- super.eSet(featureID, newValue); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public void eUnset(int featureID) { >- switch (featureID) { >- case CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL : >- setSymbol(SYMBOL_EDEFAULT); >- return; >- } >- super.eUnset(featureID); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public boolean eIsSet(int featureID) { >- switch (featureID) { >- case CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL : >- return SYMBOL_EDEFAULT == null >- ? symbol != null >- : !SYMBOL_EDEFAULT.equals(symbol); >- } >- return super.eIsSet(featureID); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public String toString() { >- if (eIsProxy()) >- return super.toString(); >- >- StringBuffer result = new StringBuffer(super.toString()); >- result.append(" (symbol: "); //$NON-NLS-1$ >- result.append(symbol); >- result.append(')'); >- return result.toString(); >- } >- > } //InvalidLiteralExpCSImpl >Index: src/org/eclipse/ocl/cst/impl/BooleanLiteralExpCSImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/impl/BooleanLiteralExpCSImpl.java,v >retrieving revision 1.3 >diff -u -r1.3 BooleanLiteralExpCSImpl.java >--- src/org/eclipse/ocl/cst/impl/BooleanLiteralExpCSImpl.java 30 Nov 2008 22:11:37 -0000 1.3 >+++ src/org/eclipse/ocl/cst/impl/BooleanLiteralExpCSImpl.java 8 Oct 2009 11:53:23 -0000 >@@ -22,6 +22,8 @@ > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.ocl.cst.BooleanLiteralExpCS; > import org.eclipse.ocl.cst.CSTPackage; >+import org.eclipse.ocl.cst.LiteralExpCS; >+import org.eclipse.ocl.cst.PrimitiveLiteralExpCS; > > /** > * <!-- begin-user-doc --> >@@ -30,6 +32,7 @@ > * <p> > * The following features are implemented: > * <ul> >+ * <li>{@link org.eclipse.ocl.cst.impl.BooleanLiteralExpCSImpl#getSymbol <em>Symbol</em>}</li> > * <li>{@link org.eclipse.ocl.cst.impl.BooleanLiteralExpCSImpl#getBooleanSymbol <em>Boolean Symbol</em>}</li> > * </ul> > * </p> >@@ -37,10 +40,34 @@ > * @generated > */ > public class BooleanLiteralExpCSImpl >- extends PrimitiveLiteralExpCSImpl >+ extends SimpleNameCSImpl > implements BooleanLiteralExpCS { > > /** >+ * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @see #getSymbol() >+ * @generated >+ * @ordered >+ * >+ */ >+ protected static final String SYMBOL_EDEFAULT = null; >+ >+ /** >+ * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute. >+ * <!-- begin-user-doc --> >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @see #getSymbol() >+ * @generated >+ * @ordered >+ * >+ */ >+ protected String symbol = SYMBOL_EDEFAULT; >+ >+ /** > * The default value of the '{@link #getBooleanSymbol() <em>Boolean Symbol</em>}' attribute. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >@@ -84,6 +111,28 @@ > * <!-- end-user-doc --> > * @generated > */ >+ public String getSymbol() { >+ return symbol; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setSymbol(String newSymbol) { >+ String oldSymbol = symbol; >+ symbol = newSymbol; >+ if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, >+ CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL, oldSymbol, symbol)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ > public Boolean getBooleanSymbol() { > return booleanSymbol; > } >@@ -110,6 +159,8 @@ > @Override > public Object eGet(int featureID, boolean resolve, boolean coreType) { > switch (featureID) { >+ case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL : >+ return getSymbol(); > case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL : > return getBooleanSymbol(); > } >@@ -124,6 +175,9 @@ > @Override > public void eSet(int featureID, Object newValue) { > switch (featureID) { >+ case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL : >+ setSymbol((String) newValue); >+ return; > case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL : > setBooleanSymbol((Boolean) newValue); > return; >@@ -139,6 +193,9 @@ > @Override > public void eUnset(int featureID) { > switch (featureID) { >+ case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL : >+ setSymbol(SYMBOL_EDEFAULT); >+ return; > case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL : > setBooleanSymbol(BOOLEAN_SYMBOL_EDEFAULT); > return; >@@ -154,6 +211,10 @@ > @Override > public boolean eIsSet(int featureID) { > switch (featureID) { >+ case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL : >+ return SYMBOL_EDEFAULT == null >+ ? symbol != null >+ : !SYMBOL_EDEFAULT.equals(symbol); > case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL : > return BOOLEAN_SYMBOL_EDEFAULT == null > ? booleanSymbol != null >@@ -168,12 +229,62 @@ > * @generated > */ > @Override >+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { >+ if (baseClass == LiteralExpCS.class) { >+ switch (derivedFeatureID) { >+ default : >+ return -1; >+ } >+ } >+ if (baseClass == PrimitiveLiteralExpCS.class) { >+ switch (derivedFeatureID) { >+ case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL : >+ return CSTPackage.PRIMITIVE_LITERAL_EXP_CS__SYMBOL; >+ default : >+ return -1; >+ } >+ } >+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override >+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { >+ if (baseClass == LiteralExpCS.class) { >+ switch (baseFeatureID) { >+ default : >+ return -1; >+ } >+ } >+ if (baseClass == PrimitiveLiteralExpCS.class) { >+ switch (baseFeatureID) { >+ case CSTPackage.PRIMITIVE_LITERAL_EXP_CS__SYMBOL : >+ return CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL; >+ default : >+ return -1; >+ } >+ } >+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override > public String toString() { > if (eIsProxy()) > return super.toString(); > > StringBuffer result = new StringBuffer(super.toString()); >- result.append(" (booleanSymbol: "); //$NON-NLS-1$ >+ result.append(" (symbol: "); //$NON-NLS-1$ >+ result.append(symbol); >+ result.append(", booleanSymbol: "); //$NON-NLS-1$ > result.append(booleanSymbol); > result.append(')'); > return result.toString(); >Index: src/org/eclipse/ocl/cst/impl/CSTPackageImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/impl/CSTPackageImpl.java,v >retrieving revision 1.11 >diff -u -r1.11 CSTPackageImpl.java >--- src/org/eclipse/ocl/cst/impl/CSTPackageImpl.java 4 Oct 2009 11:16:06 -0000 1.11 >+++ src/org/eclipse/ocl/cst/impl/CSTPackageImpl.java 8 Oct 2009 11:53:24 -0000 >@@ -76,7 +76,6 @@ > import org.eclipse.ocl.cst.RealLiteralExpCS; > import org.eclipse.ocl.cst.SimpleNameCS; > import org.eclipse.ocl.cst.SimpleTypeEnum; >-import org.eclipse.ocl.cst.StateExpCS; > import org.eclipse.ocl.cst.StringLiteralExpCS; > import org.eclipse.ocl.cst.TupleLiteralExpCS; > import org.eclipse.ocl.cst.TupleTypeCS; >@@ -401,13 +400,6 @@ > * <!-- end-user-doc --> > * @generated > */ >- private EClass stateExpCSEClass = null; >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ > private EClass oclDocumentCSEClass = null; > > /** >@@ -1511,10 +1503,22 @@ > * @since 3.0 > * <!-- end-user-doc --> > * @generated >+ * >+ */ >+ public EReference getOperationCallExpCS_PathNameCS() { >+ return (EReference) operationCallExpCSEClass.getEStructuralFeatures() >+ .get(0); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @generated > */ > public EAttribute getOperationCallExpCS_IsAtomic() { > return (EAttribute) operationCallExpCSEClass.getEStructuralFeatures() >- .get(0); >+ .get(1); > } > > /** >@@ -1578,25 +1582,6 @@ > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public EClass getStateExpCS() { >- return stateExpCSEClass; >- } >- >- /** >- * <!-- begin-user-doc --> >- * @since 3.0 >- * <!-- end-user-doc --> >- * @generated >- */ >- public EReference getStateExpCS_SimpleNames() { >- return (EReference) stateExpCSEClass.getEStructuralFeatures().get(0); >- } >- >- /** >- * <!-- begin-user-doc --> > * @since 1.3 > * <!-- end-user-doc --> > * @generated >@@ -1710,16 +1695,6 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EAttribute getNullLiteralExpCS_Symbol() { >- return (EAttribute) nullLiteralExpCSEClass.getEStructuralFeatures() >- .get(0); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ > public EClass getInvalidLiteralExpCS() { > return invalidLiteralExpCSEClass; > } >@@ -1729,16 +1704,6 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EAttribute getInvalidLiteralExpCS_Symbol() { >- return (EAttribute) invalidLiteralExpCSEClass.getEStructuralFeatures() >- .get(0); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ > public EClass getCallExpCS() { > return callExpCSEClass; > } >@@ -2060,11 +2025,8 @@ > BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL); > > nullLiteralExpCSEClass = createEClass(NULL_LITERAL_EXP_CS); >- createEAttribute(nullLiteralExpCSEClass, NULL_LITERAL_EXP_CS__SYMBOL); > > invalidLiteralExpCSEClass = createEClass(INVALID_LITERAL_EXP_CS); >- createEAttribute(invalidLiteralExpCSEClass, >- INVALID_LITERAL_EXP_CS__SYMBOL); > > collectionRangeCSEClass = createEClass(COLLECTION_RANGE_CS); > createEReference(collectionRangeCSEClass, >@@ -2090,12 +2052,11 @@ > FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS); > > operationCallExpCSEClass = createEClass(OPERATION_CALL_EXP_CS); >+ createEReference(operationCallExpCSEClass, >+ OPERATION_CALL_EXP_CS__PATH_NAME_CS); > createEAttribute(operationCallExpCSEClass, > OPERATION_CALL_EXP_CS__IS_ATOMIC); > >- stateExpCSEClass = createEClass(STATE_EXP_CS); >- createEReference(stateExpCSEClass, STATE_EXP_CS__SIMPLE_NAMES); >- > oclDocumentCSEClass = createEClass(OCL_DOCUMENT_CS); > createEReference(oclDocumentCSEClass, > OCL_DOCUMENT_CS__PACKAGE_DECLARATIONS); >@@ -2166,6 +2127,7 @@ > primitiveTypeCSEClass.getESuperTypes().add(this.getSimpleNameCS()); > primitiveTypeCSEClass.getESuperTypes().add(this.getTypeCS()); > tupleTypeCSEClass.getESuperTypes().add(this.getTypeCS()); >+ collectionTypeCSEClass.getESuperTypes().add(this.getSimpleNameCS()); > collectionTypeCSEClass.getESuperTypes().add(this.getTypeCS()); > letExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS()); > ifExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS()); >@@ -2187,9 +2149,12 @@ > this.getPrimitiveLiteralExpCS()); > stringLiteralExpCSEClass.getESuperTypes().add( > this.getPrimitiveLiteralExpCS()); >+ booleanLiteralExpCSEClass.getESuperTypes().add(this.getSimpleNameCS()); > booleanLiteralExpCSEClass.getESuperTypes().add( > this.getPrimitiveLiteralExpCS()); >+ nullLiteralExpCSEClass.getESuperTypes().add(this.getSimpleNameCS()); > nullLiteralExpCSEClass.getESuperTypes().add(this.getLiteralExpCS()); >+ invalidLiteralExpCSEClass.getESuperTypes().add(this.getSimpleNameCS()); > invalidLiteralExpCSEClass.getESuperTypes().add(this.getLiteralExpCS()); > collectionRangeCSEClass.getESuperTypes().add( > this.getCollectionLiteralPartCS()); >@@ -2200,7 +2165,6 @@ > featureCallExpCSEClass.getESuperTypes().add(this.getCallExpCS()); > operationCallExpCSEClass.getESuperTypes().add( > this.getFeatureCallExpCS()); >- stateExpCSEClass.getESuperTypes().add(this.getTypeCS()); > oclDocumentCSEClass.getESuperTypes().add(this.getCSTNode()); > > // Initialize classes and features; add operations and parameters >@@ -2713,19 +2677,11 @@ > nullLiteralExpCSEClass, > NullLiteralExpCS.class, > "NullLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >- initEAttribute( >- getNullLiteralExpCS_Symbol(), >- ecorePackage.getEString(), >- "symbol", null, 0, 1, NullLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ > > initEClass( > invalidLiteralExpCSEClass, > InvalidLiteralExpCS.class, > "InvalidLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >- initEAttribute( >- getInvalidLiteralExpCS_Symbol(), >- ecorePackage.getEString(), >- "symbol", null, 0, 1, InvalidLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ > > initEClass( > collectionRangeCSEClass, >@@ -2805,22 +2761,17 @@ > operationCallExpCSEClass, > OperationCallExpCS.class, > "OperationCallExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEReference( >+ getOperationCallExpCS_PathNameCS(), >+ this.getPathNameCS(), >+ null, >+ "pathNameCS", null, 0, 1, OperationCallExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ > initEAttribute( > getOperationCallExpCS_IsAtomic(), > ecorePackage.getEBooleanObject(), > "isAtomic", "false", 0, 1, OperationCallExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$ > > initEClass( >- stateExpCSEClass, >- StateExpCS.class, >- "StateExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >- initEReference( >- getStateExpCS_SimpleNames(), >- this.getSimpleNameCS(), >- null, >- "simpleNames", null, 0, -1, StateExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- initEClass( > oclDocumentCSEClass, > OCLDocumentCS.class, > "OCLDocumentCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >Index: src/org/eclipse/ocl/cst/impl/CSTFactoryImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/impl/CSTFactoryImpl.java,v >retrieving revision 1.6 >diff -u -r1.6 CSTFactoryImpl.java >--- src/org/eclipse/ocl/cst/impl/CSTFactoryImpl.java 4 Sep 2009 13:40:43 -0000 1.6 >+++ src/org/eclipse/ocl/cst/impl/CSTFactoryImpl.java 8 Oct 2009 11:53:23 -0000 >@@ -70,7 +70,6 @@ > import org.eclipse.ocl.cst.RealLiteralExpCS; > import org.eclipse.ocl.cst.SimpleNameCS; > import org.eclipse.ocl.cst.SimpleTypeEnum; >-import org.eclipse.ocl.cst.StateExpCS; > import org.eclipse.ocl.cst.StringLiteralExpCS; > import org.eclipse.ocl.cst.TupleLiteralExpCS; > import org.eclipse.ocl.cst.TupleTypeCS; >@@ -209,8 +208,6 @@ > return createFeatureCallExpCS(); > case CSTPackage.OPERATION_CALL_EXP_CS : > return createOperationCallExpCS(); >- case CSTPackage.STATE_EXP_CS : >- return createStateExpCS(); > case CSTPackage.OCL_DOCUMENT_CS : > return createOCLDocumentCS(); > default : >@@ -677,16 +674,6 @@ > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public StateExpCS createStateExpCS() { >- StateExpCSImpl stateExpCS = new StateExpCSImpl(); >- return stateExpCS; >- } >- >- /** >- * <!-- begin-user-doc --> > * @since 1.3 > * <!-- end-user-doc --> > * @generated >Index: src/org/eclipse/ocl/cst/impl/CollectionTypeCSImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/impl/CollectionTypeCSImpl.java,v >retrieving revision 1.3 >diff -u -r1.3 CollectionTypeCSImpl.java >--- src/org/eclipse/ocl/cst/impl/CollectionTypeCSImpl.java 30 Nov 2008 22:11:38 -0000 1.3 >+++ src/org/eclipse/ocl/cst/impl/CollectionTypeCSImpl.java 8 Oct 2009 11:53:24 -0000 >@@ -42,7 +42,7 @@ > * @generated > */ > public class CollectionTypeCSImpl >- extends TypeCSImpl >+ extends SimpleNameCSImpl > implements CollectionTypeCS { > > /** >Index: src/org/eclipse/ocl/cst/impl/OperationCallExpCSImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/impl/OperationCallExpCSImpl.java,v >retrieving revision 1.4 >diff -u -r1.4 OperationCallExpCSImpl.java >--- src/org/eclipse/ocl/cst/impl/OperationCallExpCSImpl.java 4 Oct 2009 11:16:06 -0000 1.4 >+++ src/org/eclipse/ocl/cst/impl/OperationCallExpCSImpl.java 8 Oct 2009 11:53:24 -0000 >@@ -18,10 +18,13 @@ > package org.eclipse.ocl.cst.impl; > > import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.common.notify.NotificationChain; > import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.InternalEObject; > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.ocl.cst.CSTPackage; > import org.eclipse.ocl.cst.OperationCallExpCS; >+import org.eclipse.ocl.cst.PathNameCS; > > /** > * <!-- begin-user-doc --> >@@ -30,6 +33,7 @@ > * <p> > * The following features are implemented: > * <ul> >+ * <li>{@link org.eclipse.ocl.cst.impl.OperationCallExpCSImpl#getPathNameCS <em>Path Name CS</em>}</li> > * <li>{@link org.eclipse.ocl.cst.impl.OperationCallExpCSImpl#getIsAtomic <em>Is Atomic</em>}</li> > * </ul> > * </p> >@@ -41,6 +45,18 @@ > implements OperationCallExpCS { > > /** >+ * The cached value of the '{@link #getPathNameCS() <em>Path Name CS</em>}' containment reference. >+ * <!-- begin-user-doc --> >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @see #getPathNameCS() >+ * @generated >+ * @ordered >+ * >+ */ >+ protected PathNameCS pathNameCS; >+ >+ /** > * The default value of the '{@link #getIsAtomic() <em>Is Atomic</em>}' attribute. > * <!-- begin-user-doc --> > * @since 3.0 >@@ -86,6 +102,69 @@ > * @since 3.0 > * <!-- end-user-doc --> > * @generated >+ * >+ */ >+ public PathNameCS getPathNameCS() { >+ return pathNameCS; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @generated >+ * >+ */ >+ public NotificationChain basicSetPathNameCS(PathNameCS newPathNameCS, >+ NotificationChain msgs) { >+ PathNameCS oldPathNameCS = pathNameCS; >+ pathNameCS = newPathNameCS; >+ if (eNotificationRequired()) { >+ ENotificationImpl notification = new ENotificationImpl(this, >+ Notification.SET, >+ CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, oldPathNameCS, >+ newPathNameCS); >+ if (msgs == null) >+ msgs = notification; >+ else >+ msgs.add(notification); >+ } >+ return msgs; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public void setPathNameCS(PathNameCS newPathNameCS) { >+ if (newPathNameCS != pathNameCS) { >+ NotificationChain msgs = null; >+ if (pathNameCS != null) >+ msgs = ((InternalEObject) pathNameCS).eInverseRemove(this, >+ EOPPOSITE_FEATURE_BASE >+ - CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, null, >+ msgs); >+ if (newPathNameCS != null) >+ msgs = ((InternalEObject) newPathNameCS).eInverseAdd(this, >+ EOPPOSITE_FEATURE_BASE >+ - CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, null, >+ msgs); >+ msgs = basicSetPathNameCS(newPathNameCS, msgs); >+ if (msgs != null) >+ msgs.dispatch(); >+ } else if (eNotificationRequired()) >+ eNotify(new ENotificationImpl(this, Notification.SET, >+ CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, newPathNameCS, >+ newPathNameCS)); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @generated > */ > public Boolean getIsAtomic() { > return isAtomic; >@@ -112,8 +191,25 @@ > * @generated > */ > @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, >+ int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS : >+ return basicSetPathNameCS(null, msgs); >+ } >+ return super.eInverseRemove(otherEnd, featureID, msgs); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ @Override > public Object eGet(int featureID, boolean resolve, boolean coreType) { > switch (featureID) { >+ case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS : >+ return getPathNameCS(); > case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC : > return getIsAtomic(); > } >@@ -128,6 +224,9 @@ > @Override > public void eSet(int featureID, Object newValue) { > switch (featureID) { >+ case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS : >+ setPathNameCS((PathNameCS) newValue); >+ return; > case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC : > setIsAtomic((Boolean) newValue); > return; >@@ -143,6 +242,9 @@ > @Override > public void eUnset(int featureID) { > switch (featureID) { >+ case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS : >+ setPathNameCS((PathNameCS) null); >+ return; > case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC : > setIsAtomic(IS_ATOMIC_EDEFAULT); > return; >@@ -158,6 +260,8 @@ > @Override > public boolean eIsSet(int featureID) { > switch (featureID) { >+ case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS : >+ return pathNameCS != null; > case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC : > return IS_ATOMIC_EDEFAULT == null > ? isAtomic != null >Index: src/org/eclipse/ocl/cst/impl/NullLiteralExpCSImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/impl/NullLiteralExpCSImpl.java,v >retrieving revision 1.3 >diff -u -r1.3 NullLiteralExpCSImpl.java >--- src/org/eclipse/ocl/cst/impl/NullLiteralExpCSImpl.java 30 Nov 2008 22:11:37 -0000 1.3 >+++ src/org/eclipse/ocl/cst/impl/NullLiteralExpCSImpl.java 8 Oct 2009 11:53:24 -0000 >@@ -17,9 +17,7 @@ > */ > package org.eclipse.ocl.cst.impl; > >-import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.ocl.cst.CSTPackage; > import org.eclipse.ocl.cst.NullLiteralExpCS; > >@@ -28,39 +26,15 @@ > * An implementation of the model object '<em><b>Null Literal Exp CS</b></em>'. > * <!-- end-user-doc --> > * <p> >- * The following features are implemented: >- * <ul> >- * <li>{@link org.eclipse.ocl.cst.impl.NullLiteralExpCSImpl#getSymbol <em>Symbol</em>}</li> >- * </ul> > * </p> > * > * @generated > */ > public class NullLiteralExpCSImpl >- extends LiteralExpCSImpl >+ extends SimpleNameCSImpl > implements NullLiteralExpCS { > > /** >- * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @see #getSymbol() >- * @generated >- * @ordered >- */ >- protected static final String SYMBOL_EDEFAULT = null; >- >- /** >- * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @see #getSymbol() >- * @generated >- * @ordered >- */ >- protected String symbol = SYMBOL_EDEFAULT; >- >- /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -79,103 +53,4 @@ > return CSTPackage.Literals.NULL_LITERAL_EXP_CS; > } > >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public String getSymbol() { >- return symbol; >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public void setSymbol(String newSymbol) { >- String oldSymbol = symbol; >- symbol = newSymbol; >- if (eNotificationRequired()) >- eNotify(new ENotificationImpl(this, Notification.SET, >- CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL, oldSymbol, symbol)); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public Object eGet(int featureID, boolean resolve, boolean coreType) { >- switch (featureID) { >- case CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL : >- return getSymbol(); >- } >- return super.eGet(featureID, resolve, coreType); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public void eSet(int featureID, Object newValue) { >- switch (featureID) { >- case CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL : >- setSymbol((String) newValue); >- return; >- } >- super.eSet(featureID, newValue); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public void eUnset(int featureID) { >- switch (featureID) { >- case CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL : >- setSymbol(SYMBOL_EDEFAULT); >- return; >- } >- super.eUnset(featureID); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public boolean eIsSet(int featureID) { >- switch (featureID) { >- case CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL : >- return SYMBOL_EDEFAULT == null >- ? symbol != null >- : !SYMBOL_EDEFAULT.equals(symbol); >- } >- return super.eIsSet(featureID); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- @Override >- public String toString() { >- if (eIsProxy()) >- return super.toString(); >- >- StringBuffer result = new StringBuffer(super.toString()); >- result.append(" (symbol: "); //$NON-NLS-1$ >- result.append(symbol); >- result.append(')'); >- return result.toString(); >- } >- > } //NullLiteralExpCSImpl >Index: src/org/eclipse/ocl/cst/StateExpCS.java >=================================================================== >RCS file: src/org/eclipse/ocl/cst/StateExpCS.java >diff -N src/org/eclipse/ocl/cst/StateExpCS.java >--- src/org/eclipse/ocl/cst/StateExpCS.java 4 Sep 2009 13:40:44 -0000 1.4 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,60 +0,0 @@ >-/** >- * <copyright> >- * >- * Copyright (c) 2005, 2008 IBM Corporation, Zeligsoft Inc., and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM - Initial API and implementation >- * Zeligsoft - Bug 243976 >- * >- * </copyright> >- * >- * $Id: StateExpCS.java,v 1.4 2009/09/04 13:40:44 ewillink Exp $ >- */ >-package org.eclipse.ocl.cst; >- >-import org.eclipse.emf.common.util.EList; >- >-/** >- * <!-- begin-user-doc --> >- * A representation of the model object '<em><b>State Exp CS</b></em>'. >- * <!-- end-user-doc --> >- * >- * <p> >- * The following features are supported: >- * <ul> >- * <li>{@link org.eclipse.ocl.cst.StateExpCS#getSimpleNames <em>Simple Names</em>}</li> >- * </ul> >- * </p> >- * >- * @see org.eclipse.ocl.cst.CSTPackage#getStateExpCS() >- * @model >- * @generated >- * @noimplement This interface is not intended to be implemented by clients. >- * @noextend This interface is not intended to be extended by clients. >- */ >-public interface StateExpCS >- extends TypeCS { >- >- /** >- * Returns the value of the '<em><b>Simple Names</b></em>' containment reference list. >- * The list contents are of type {@link org.eclipse.ocl.cst.SimpleNameCS}. >- * <!-- begin-user-doc --> >- * <p> >- * If the meaning of the '<em>Simple Names</em>' containment reference list isn't clear, >- * there really should be more of a description here... >- * </p> >- * @since 3.0 >- * <!-- end-user-doc --> >- * @return the value of the '<em>Simple Names</em>' containment reference list. >- * @see org.eclipse.ocl.cst.CSTPackage#getStateExpCS_SimpleNames() >- * @model containment="true" >- * @generated >- */ >- EList<SimpleNameCS> getSimpleNames(); >- >-} // StateExpCS >Index: src/org/eclipse/ocl/cst/InvalidLiteralExpCS.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/InvalidLiteralExpCS.java,v >retrieving revision 1.3 >diff -u -r1.3 InvalidLiteralExpCS.java >--- src/org/eclipse/ocl/cst/InvalidLiteralExpCS.java 30 Nov 2008 22:11:38 -0000 1.3 >+++ src/org/eclipse/ocl/cst/InvalidLiteralExpCS.java 8 Oct 2009 11:53:23 -0000 >@@ -22,12 +22,6 @@ > * A representation of the model object '<em><b>Invalid Literal Exp CS</b></em>'. > * <!-- end-user-doc --> > * >- * <p> >- * The following features are supported: >- * <ul> >- * <li>{@link org.eclipse.ocl.cst.InvalidLiteralExpCS#getSymbol <em>Symbol</em>}</li> >- * </ul> >- * </p> > * > * @see org.eclipse.ocl.cst.CSTPackage#getInvalidLiteralExpCS() > * @model >@@ -36,32 +30,6 @@ > * @noextend This interface is not intended to be extended by clients. > */ > public interface InvalidLiteralExpCS >- extends LiteralExpCS { >- >- /** >- * Returns the value of the '<em><b>Symbol</b></em>' attribute. >- * <!-- begin-user-doc --> >- * <p> >- * If the meaning of the '<em>Symbol</em>' attribute isn't clear, >- * there really should be more of a description here... >- * </p> >- * <!-- end-user-doc --> >- * @return the value of the '<em>Symbol</em>' attribute. >- * @see #setSymbol(String) >- * @see org.eclipse.ocl.cst.CSTPackage#getInvalidLiteralExpCS_Symbol() >- * @model >- * @generated >- */ >- String getSymbol(); >- >- /** >- * Sets the value of the '{@link org.eclipse.ocl.cst.InvalidLiteralExpCS#getSymbol <em>Symbol</em>}' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @param value the new value of the '<em>Symbol</em>' attribute. >- * @see #getSymbol() >- * @generated >- */ >- void setSymbol(String value); >+ extends SimpleNameCS, LiteralExpCS { > > } // InvalidLiteralExpCS >Index: src/org/eclipse/ocl/cst/BooleanLiteralExpCS.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/BooleanLiteralExpCS.java,v >retrieving revision 1.3 >diff -u -r1.3 BooleanLiteralExpCS.java >--- src/org/eclipse/ocl/cst/BooleanLiteralExpCS.java 30 Nov 2008 22:11:38 -0000 1.3 >+++ src/org/eclipse/ocl/cst/BooleanLiteralExpCS.java 8 Oct 2009 11:53:21 -0000 >@@ -36,7 +36,7 @@ > * @noextend This interface is not intended to be extended by clients. > */ > public interface BooleanLiteralExpCS >- extends PrimitiveLiteralExpCS { >+ extends SimpleNameCS, PrimitiveLiteralExpCS { > > /** > * Returns the value of the '<em><b>Boolean Symbol</b></em>' attribute. >Index: src/org/eclipse/ocl/cst/CSTPackage.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/CSTPackage.java,v >retrieving revision 1.10 >diff -u -r1.10 CSTPackage.java >--- src/org/eclipse/ocl/cst/CSTPackage.java 4 Oct 2009 11:22:31 -0000 1.10 >+++ src/org/eclipse/ocl/cst/CSTPackage.java 8 Oct 2009 11:53:23 -0000 >@@ -2229,7 +2229,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_CS__START_OFFSET = TYPE_CS__START_OFFSET; >+ int COLLECTION_TYPE_CS__START_OFFSET = SIMPLE_NAME_CS__START_OFFSET; > > /** > * The feature id for the '<em><b>End Offset</b></em>' attribute. >@@ -2239,7 +2239,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_CS__END_OFFSET = TYPE_CS__END_OFFSET; >+ int COLLECTION_TYPE_CS__END_OFFSET = SIMPLE_NAME_CS__END_OFFSET; > > /** > * The feature id for the '<em><b>Start Token</b></em>' attribute. >@@ -2249,7 +2249,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_CS__START_TOKEN = TYPE_CS__START_TOKEN; >+ int COLLECTION_TYPE_CS__START_TOKEN = SIMPLE_NAME_CS__START_TOKEN; > > /** > * The feature id for the '<em><b>End Token</b></em>' attribute. >@@ -2259,7 +2259,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_CS__END_TOKEN = TYPE_CS__END_TOKEN; >+ int COLLECTION_TYPE_CS__END_TOKEN = SIMPLE_NAME_CS__END_TOKEN; > > /** > * The feature id for the '<em><b>Ast</b></em>' attribute. >@@ -2269,7 +2269,27 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_CS__AST = TYPE_CS__AST; >+ int COLLECTION_TYPE_CS__AST = SIMPLE_NAME_CS__AST; >+ >+ /** >+ * The feature id for the '<em><b>Value</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ * @noreference This field is not intended to be referenced by clients. >+ */ >+ int COLLECTION_TYPE_CS__VALUE = SIMPLE_NAME_CS__VALUE; >+ >+ /** >+ * The feature id for the '<em><b>Type</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ * @noreference This field is not intended to be referenced by clients. >+ */ >+ int COLLECTION_TYPE_CS__TYPE = SIMPLE_NAME_CS__TYPE; > > /** > * The feature id for the '<em><b>Collection Type Identifier</b></em>' attribute. >@@ -2279,7 +2299,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_CS__COLLECTION_TYPE_IDENTIFIER = TYPE_CS_FEATURE_COUNT + 0; >+ int COLLECTION_TYPE_CS__COLLECTION_TYPE_IDENTIFIER = SIMPLE_NAME_CS_FEATURE_COUNT + 0; > > /** > * The feature id for the '<em><b>Type CS</b></em>' containment reference. >@@ -2289,7 +2309,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_CS__TYPE_CS = TYPE_CS_FEATURE_COUNT + 1; >+ int COLLECTION_TYPE_CS__TYPE_CS = SIMPLE_NAME_CS_FEATURE_COUNT + 1; > > /** > * The number of structural features of the '<em>Collection Type CS</em>' class. >@@ -2299,7 +2319,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_CS_FEATURE_COUNT = TYPE_CS_FEATURE_COUNT + 2; >+ int COLLECTION_TYPE_CS_FEATURE_COUNT = SIMPLE_NAME_CS_FEATURE_COUNT + 2; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.impl.LetExpCSImpl <em>Let Exp CS</em>}' class. >@@ -3585,7 +3605,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int BOOLEAN_LITERAL_EXP_CS__START_OFFSET = PRIMITIVE_LITERAL_EXP_CS__START_OFFSET; >+ int BOOLEAN_LITERAL_EXP_CS__START_OFFSET = SIMPLE_NAME_CS__START_OFFSET; > > /** > * The feature id for the '<em><b>End Offset</b></em>' attribute. >@@ -3595,7 +3615,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int BOOLEAN_LITERAL_EXP_CS__END_OFFSET = PRIMITIVE_LITERAL_EXP_CS__END_OFFSET; >+ int BOOLEAN_LITERAL_EXP_CS__END_OFFSET = SIMPLE_NAME_CS__END_OFFSET; > > /** > * The feature id for the '<em><b>Start Token</b></em>' attribute. >@@ -3605,7 +3625,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int BOOLEAN_LITERAL_EXP_CS__START_TOKEN = PRIMITIVE_LITERAL_EXP_CS__START_TOKEN; >+ int BOOLEAN_LITERAL_EXP_CS__START_TOKEN = SIMPLE_NAME_CS__START_TOKEN; > > /** > * The feature id for the '<em><b>End Token</b></em>' attribute. >@@ -3615,7 +3635,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int BOOLEAN_LITERAL_EXP_CS__END_TOKEN = PRIMITIVE_LITERAL_EXP_CS__END_TOKEN; >+ int BOOLEAN_LITERAL_EXP_CS__END_TOKEN = SIMPLE_NAME_CS__END_TOKEN; > > /** > * The feature id for the '<em><b>Ast</b></em>' attribute. >@@ -3625,7 +3645,27 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int BOOLEAN_LITERAL_EXP_CS__AST = PRIMITIVE_LITERAL_EXP_CS__AST; >+ int BOOLEAN_LITERAL_EXP_CS__AST = SIMPLE_NAME_CS__AST; >+ >+ /** >+ * The feature id for the '<em><b>Value</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ * @noreference This field is not intended to be referenced by clients. >+ */ >+ int BOOLEAN_LITERAL_EXP_CS__VALUE = SIMPLE_NAME_CS__VALUE; >+ >+ /** >+ * The feature id for the '<em><b>Type</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ * @noreference This field is not intended to be referenced by clients. >+ */ >+ int BOOLEAN_LITERAL_EXP_CS__TYPE = SIMPLE_NAME_CS__TYPE; > > /** > * The feature id for the '<em><b>Symbol</b></em>' attribute. >@@ -3635,7 +3675,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int BOOLEAN_LITERAL_EXP_CS__SYMBOL = PRIMITIVE_LITERAL_EXP_CS__SYMBOL; >+ int BOOLEAN_LITERAL_EXP_CS__SYMBOL = SIMPLE_NAME_CS_FEATURE_COUNT + 0; > > /** > * The feature id for the '<em><b>Boolean Symbol</b></em>' attribute. >@@ -3645,7 +3685,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL = PRIMITIVE_LITERAL_EXP_CS_FEATURE_COUNT + 0; >+ int BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL = SIMPLE_NAME_CS_FEATURE_COUNT + 1; > > /** > * The number of structural features of the '<em>Boolean Literal Exp CS</em>' class. >@@ -3655,7 +3695,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int BOOLEAN_LITERAL_EXP_CS_FEATURE_COUNT = PRIMITIVE_LITERAL_EXP_CS_FEATURE_COUNT + 1; >+ int BOOLEAN_LITERAL_EXP_CS_FEATURE_COUNT = SIMPLE_NAME_CS_FEATURE_COUNT + 2; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.impl.NullLiteralExpCSImpl <em>Null Literal Exp CS</em>}' class. >@@ -3676,7 +3716,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int NULL_LITERAL_EXP_CS__START_OFFSET = LITERAL_EXP_CS__START_OFFSET; >+ int NULL_LITERAL_EXP_CS__START_OFFSET = SIMPLE_NAME_CS__START_OFFSET; > > /** > * The feature id for the '<em><b>End Offset</b></em>' attribute. >@@ -3686,7 +3726,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int NULL_LITERAL_EXP_CS__END_OFFSET = LITERAL_EXP_CS__END_OFFSET; >+ int NULL_LITERAL_EXP_CS__END_OFFSET = SIMPLE_NAME_CS__END_OFFSET; > > /** > * The feature id for the '<em><b>Start Token</b></em>' attribute. >@@ -3696,7 +3736,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int NULL_LITERAL_EXP_CS__START_TOKEN = LITERAL_EXP_CS__START_TOKEN; >+ int NULL_LITERAL_EXP_CS__START_TOKEN = SIMPLE_NAME_CS__START_TOKEN; > > /** > * The feature id for the '<em><b>End Token</b></em>' attribute. >@@ -3706,7 +3746,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int NULL_LITERAL_EXP_CS__END_TOKEN = LITERAL_EXP_CS__END_TOKEN; >+ int NULL_LITERAL_EXP_CS__END_TOKEN = SIMPLE_NAME_CS__END_TOKEN; > > /** > * The feature id for the '<em><b>Ast</b></em>' attribute. >@@ -3716,17 +3756,27 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int NULL_LITERAL_EXP_CS__AST = LITERAL_EXP_CS__AST; >+ int NULL_LITERAL_EXP_CS__AST = SIMPLE_NAME_CS__AST; > > /** >- * The feature id for the '<em><b>Symbol</b></em>' attribute. >+ * The feature id for the '<em><b>Value</b></em>' attribute. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int NULL_LITERAL_EXP_CS__SYMBOL = LITERAL_EXP_CS_FEATURE_COUNT + 0; >+ int NULL_LITERAL_EXP_CS__VALUE = SIMPLE_NAME_CS__VALUE; >+ >+ /** >+ * The feature id for the '<em><b>Type</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ * @noreference This field is not intended to be referenced by clients. >+ */ >+ int NULL_LITERAL_EXP_CS__TYPE = SIMPLE_NAME_CS__TYPE; > > /** > * The number of structural features of the '<em>Null Literal Exp CS</em>' class. >@@ -3736,7 +3786,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int NULL_LITERAL_EXP_CS_FEATURE_COUNT = LITERAL_EXP_CS_FEATURE_COUNT + 1; >+ int NULL_LITERAL_EXP_CS_FEATURE_COUNT = SIMPLE_NAME_CS_FEATURE_COUNT + 0; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.impl.InvalidLiteralExpCSImpl <em>Invalid Literal Exp CS</em>}' class. >@@ -3757,7 +3807,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int INVALID_LITERAL_EXP_CS__START_OFFSET = LITERAL_EXP_CS__START_OFFSET; >+ int INVALID_LITERAL_EXP_CS__START_OFFSET = SIMPLE_NAME_CS__START_OFFSET; > > /** > * The feature id for the '<em><b>End Offset</b></em>' attribute. >@@ -3767,7 +3817,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int INVALID_LITERAL_EXP_CS__END_OFFSET = LITERAL_EXP_CS__END_OFFSET; >+ int INVALID_LITERAL_EXP_CS__END_OFFSET = SIMPLE_NAME_CS__END_OFFSET; > > /** > * The feature id for the '<em><b>Start Token</b></em>' attribute. >@@ -3777,7 +3827,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int INVALID_LITERAL_EXP_CS__START_TOKEN = LITERAL_EXP_CS__START_TOKEN; >+ int INVALID_LITERAL_EXP_CS__START_TOKEN = SIMPLE_NAME_CS__START_TOKEN; > > /** > * The feature id for the '<em><b>End Token</b></em>' attribute. >@@ -3787,7 +3837,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int INVALID_LITERAL_EXP_CS__END_TOKEN = LITERAL_EXP_CS__END_TOKEN; >+ int INVALID_LITERAL_EXP_CS__END_TOKEN = SIMPLE_NAME_CS__END_TOKEN; > > /** > * The feature id for the '<em><b>Ast</b></em>' attribute. >@@ -3797,17 +3847,27 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int INVALID_LITERAL_EXP_CS__AST = LITERAL_EXP_CS__AST; >+ int INVALID_LITERAL_EXP_CS__AST = SIMPLE_NAME_CS__AST; > > /** >- * The feature id for the '<em><b>Symbol</b></em>' attribute. >+ * The feature id for the '<em><b>Value</b></em>' attribute. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int INVALID_LITERAL_EXP_CS__SYMBOL = LITERAL_EXP_CS_FEATURE_COUNT + 0; >+ int INVALID_LITERAL_EXP_CS__VALUE = SIMPLE_NAME_CS__VALUE; >+ >+ /** >+ * The feature id for the '<em><b>Type</b></em>' attribute. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ * @ordered >+ * @noreference This field is not intended to be referenced by clients. >+ */ >+ int INVALID_LITERAL_EXP_CS__TYPE = SIMPLE_NAME_CS__TYPE; > > /** > * The number of structural features of the '<em>Invalid Literal Exp CS</em>' class. >@@ -3817,7 +3877,7 @@ > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int INVALID_LITERAL_EXP_CS_FEATURE_COUNT = LITERAL_EXP_CS_FEATURE_COUNT + 1; >+ int INVALID_LITERAL_EXP_CS_FEATURE_COUNT = SIMPLE_NAME_CS_FEATURE_COUNT + 0; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.impl.CollectionRangeCSImpl <em>Collection Range CS</em>}' class. >@@ -4637,105 +4697,34 @@ > int OPERATION_CALL_EXP_CS__IS_MARKED_PRE_CS = FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS; > > /** >- * The feature id for the '<em><b>Is Atomic</b></em>' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- * @ordered >- * @noreference This field is not intended to be referenced by clients. >- */ >- int OPERATION_CALL_EXP_CS__IS_ATOMIC = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 0; >- >- /** >- * The number of structural features of the '<em>Operation Call Exp CS</em>' class. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- * @ordered >- * @noreference This field is not intended to be referenced by clients. >- */ >- int OPERATION_CALL_EXP_CS_FEATURE_COUNT = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 1; >- >- /** >- * The meta object id for the '{@link org.eclipse.ocl.cst.impl.StateExpCSImpl <em>State Exp CS</em>}' class. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @see org.eclipse.ocl.cst.impl.StateExpCSImpl >- * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getStateExpCS() >- * @generated >- * @noreference This field is not intended to be referenced by clients. >- */ >- int STATE_EXP_CS = 49; >- >- /** >- * The feature id for the '<em><b>Start Offset</b></em>' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- * @ordered >- * @noreference This field is not intended to be referenced by clients. >- */ >- int STATE_EXP_CS__START_OFFSET = TYPE_CS__START_OFFSET; >- >- /** >- * The feature id for the '<em><b>End Offset</b></em>' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- * @ordered >- * @noreference This field is not intended to be referenced by clients. >- */ >- int STATE_EXP_CS__END_OFFSET = TYPE_CS__END_OFFSET; >- >- /** >- * The feature id for the '<em><b>Start Token</b></em>' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- * @ordered >- * @noreference This field is not intended to be referenced by clients. >- */ >- int STATE_EXP_CS__START_TOKEN = TYPE_CS__START_TOKEN; >- >- /** >- * The feature id for the '<em><b>End Token</b></em>' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- * @ordered >- * @noreference This field is not intended to be referenced by clients. >- */ >- int STATE_EXP_CS__END_TOKEN = TYPE_CS__END_TOKEN; >- >- /** >- * The feature id for the '<em><b>Ast</b></em>' attribute. >+ * The feature id for the '<em><b>Path Name CS</b></em>' containment reference. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int STATE_EXP_CS__AST = TYPE_CS__AST; >+ int OPERATION_CALL_EXP_CS__PATH_NAME_CS = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 0; > > /** >- * The feature id for the '<em><b>Simple Names</b></em>' containment reference list. >+ * The feature id for the '<em><b>Is Atomic</b></em>' attribute. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int STATE_EXP_CS__SIMPLE_NAMES = TYPE_CS_FEATURE_COUNT + 0; >+ int OPERATION_CALL_EXP_CS__IS_ATOMIC = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 1; > > /** >- * The number of structural features of the '<em>State Exp CS</em>' class. >+ * The number of structural features of the '<em>Operation Call Exp CS</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated > * @ordered > * @noreference This field is not intended to be referenced by clients. > */ >- int STATE_EXP_CS_FEATURE_COUNT = TYPE_CS_FEATURE_COUNT + 1; >+ int OPERATION_CALL_EXP_CS_FEATURE_COUNT = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 2; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class. >@@ -4746,7 +4735,7 @@ > * @generated > * @noreference This field is not intended to be referenced by clients. > */ >- int OCL_DOCUMENT_CS = 50; >+ int OCL_DOCUMENT_CS = 49; > > /** > * The feature id for the '<em><b>Start Offset</b></em>' attribute. >@@ -4827,7 +4816,7 @@ > * @generated > * @noreference This field is not intended to be referenced by clients. > */ >- int SIMPLE_TYPE_ENUM = 51; >+ int SIMPLE_TYPE_ENUM = 50; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.PrePostOrBodyEnum <em>Pre Post Or Body Enum</em>}' enum. >@@ -4838,7 +4827,7 @@ > * @generated > * @noreference This field is not intended to be referenced by clients. > */ >- int PRE_POST_OR_BODY_ENUM = 52; >+ int PRE_POST_OR_BODY_ENUM = 51; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.CollectionTypeIdentifierEnum <em>Collection Type Identifier Enum</em>}' enum. >@@ -4849,7 +4838,7 @@ > * @generated > * @noreference This field is not intended to be referenced by clients. > */ >- int COLLECTION_TYPE_IDENTIFIER_ENUM = 53; >+ int COLLECTION_TYPE_IDENTIFIER_ENUM = 52; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.MessageExpKind <em>Message Exp Kind</em>}' enum. >@@ -4860,7 +4849,7 @@ > * @generated > * @noreference This field is not intended to be referenced by clients. > */ >- int MESSAGE_EXP_KIND = 54; >+ int MESSAGE_EXP_KIND = 53; > > /** > * The meta object id for the '{@link org.eclipse.ocl.cst.DotOrArrowEnum <em>Dot Or Arrow Enum</em>}' enum. >@@ -4871,7 +4860,7 @@ > * @generated > * @noreference This field is not intended to be referenced by clients. > */ >- int DOT_OR_ARROW_ENUM = 55; >+ int DOT_OR_ARROW_ENUM = 54; > > /** > * The meta object id for the '<em>IToken</em>' data type. >@@ -4882,7 +4871,7 @@ > * @generated > * @noreference This field is not intended to be referenced by clients. > */ >- int ITOKEN = 56; >+ int ITOKEN = 55; > > /** > * Returns the meta object for class '{@link org.eclipse.ocl.cst.CSTNode <em>Node</em>}'. >@@ -6040,17 +6029,6 @@ > EClass getNullLiteralExpCS(); > > /** >- * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.NullLiteralExpCS#getSymbol <em>Symbol</em>}'. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @return the meta object for the attribute '<em>Symbol</em>'. >- * @see org.eclipse.ocl.cst.NullLiteralExpCS#getSymbol() >- * @see #getNullLiteralExpCS() >- * @generated >- */ >- EAttribute getNullLiteralExpCS_Symbol(); >- >- /** > * Returns the meta object for class '{@link org.eclipse.ocl.cst.InvalidLiteralExpCS <em>Invalid Literal Exp CS</em>}'. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >@@ -6061,17 +6039,6 @@ > EClass getInvalidLiteralExpCS(); > > /** >- * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.InvalidLiteralExpCS#getSymbol <em>Symbol</em>}'. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @return the meta object for the attribute '<em>Symbol</em>'. >- * @see org.eclipse.ocl.cst.InvalidLiteralExpCS#getSymbol() >- * @see #getInvalidLiteralExpCS() >- * @generated >- */ >- EAttribute getInvalidLiteralExpCS_Symbol(); >- >- /** > * Returns the meta object for class '{@link org.eclipse.ocl.cst.CollectionRangeCS <em>Collection Range CS</em>}'. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >@@ -6241,38 +6208,29 @@ > EClass getOperationCallExpCS(); > > /** >- * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic <em>Is Atomic</em>}'. >+ * Returns the meta object for the containment reference '{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}'. > * <!-- begin-user-doc --> > * @since 3.0 > * <!-- end-user-doc --> >- * @return the meta object for the attribute '<em>Is Atomic</em>'. >- * @see org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic() >+ * @return the meta object for the containment reference '<em>Path Name CS</em>'. >+ * @see org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS() > * @see #getOperationCallExpCS() > * @generated >+ * > */ >- EAttribute getOperationCallExpCS_IsAtomic(); >+ EReference getOperationCallExpCS_PathNameCS(); > > /** >- * Returns the meta object for class '{@link org.eclipse.ocl.cst.StateExpCS <em>State Exp CS</em>}'. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @return the meta object for class '<em>State Exp CS</em>'. >- * @see org.eclipse.ocl.cst.StateExpCS >- * @generated >- */ >- EClass getStateExpCS(); >- >- /** >- * Returns the meta object for the containment reference list '{@link org.eclipse.ocl.cst.StateExpCS#getSimpleNames <em>Simple Names</em>}'. >+ * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic <em>Is Atomic</em>}'. > * <!-- begin-user-doc --> > * @since 3.0 > * <!-- end-user-doc --> >- * @return the meta object for the containment reference list '<em>Simple Names</em>'. >- * @see org.eclipse.ocl.cst.StateExpCS#getSimpleNames() >- * @see #getStateExpCS() >+ * @return the meta object for the attribute '<em>Is Atomic</em>'. >+ * @see org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic() >+ * @see #getOperationCallExpCS() > * @generated > */ >- EReference getStateExpCS_SimpleNames(); >+ EAttribute getOperationCallExpCS_IsAtomic(); > > /** > * Returns the meta object for class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'. >@@ -7396,15 +7354,6 @@ > EClass NULL_LITERAL_EXP_CS = eINSTANCE.getNullLiteralExpCS(); > > /** >- * The meta object literal for the '<em><b>Symbol</b></em>' attribute feature. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- EAttribute NULL_LITERAL_EXP_CS__SYMBOL = eINSTANCE >- .getNullLiteralExpCS_Symbol(); >- >- /** > * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.InvalidLiteralExpCSImpl <em>Invalid Literal Exp CS</em>}' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >@@ -7415,15 +7364,6 @@ > EClass INVALID_LITERAL_EXP_CS = eINSTANCE.getInvalidLiteralExpCS(); > > /** >- * The meta object literal for the '<em><b>Symbol</b></em>' attribute feature. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- EAttribute INVALID_LITERAL_EXP_CS__SYMBOL = eINSTANCE >- .getInvalidLiteralExpCS_Symbol(); >- >- /** > * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.CollectionRangeCSImpl <em>Collection Range CS</em>}' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >@@ -7570,34 +7510,25 @@ > EClass OPERATION_CALL_EXP_CS = eINSTANCE.getOperationCallExpCS(); > > /** >- * The meta object literal for the '<em><b>Is Atomic</b></em>' attribute feature. >+ * The meta object literal for the '<em><b>Path Name CS</b></em>' containment reference feature. > * <!-- begin-user-doc --> > * @since 3.0 > * <!-- end-user-doc --> > * @generated >+ * > */ >- EAttribute OPERATION_CALL_EXP_CS__IS_ATOMIC = eINSTANCE >- .getOperationCallExpCS_IsAtomic(); >+ EReference OPERATION_CALL_EXP_CS__PATH_NAME_CS = eINSTANCE >+ .getOperationCallExpCS_PathNameCS(); > > /** >- * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.StateExpCSImpl <em>State Exp CS</em>}' class. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @see org.eclipse.ocl.cst.impl.StateExpCSImpl >- * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getStateExpCS() >- * @generated >- */ >- EClass STATE_EXP_CS = eINSTANCE.getStateExpCS(); >- >- /** >- * The meta object literal for the '<em><b>Simple Names</b></em>' containment reference list feature. >+ * The meta object literal for the '<em><b>Is Atomic</b></em>' attribute feature. > * <!-- begin-user-doc --> > * @since 3.0 > * <!-- end-user-doc --> > * @generated > */ >- EReference STATE_EXP_CS__SIMPLE_NAMES = eINSTANCE >- .getStateExpCS_SimpleNames(); >+ EAttribute OPERATION_CALL_EXP_CS__IS_ATOMIC = eINSTANCE >+ .getOperationCallExpCS_IsAtomic(); > > /** > * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class. >Index: src/org/eclipse/ocl/cst/OperationCallExpCS.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/OperationCallExpCS.java,v >retrieving revision 1.4 >diff -u -r1.4 OperationCallExpCS.java >--- src/org/eclipse/ocl/cst/OperationCallExpCS.java 4 Oct 2009 11:17:11 -0000 1.4 >+++ src/org/eclipse/ocl/cst/OperationCallExpCS.java 8 Oct 2009 11:53:23 -0000 >@@ -25,6 +25,7 @@ > * <p> > * The following features are supported: > * <ul> >+ * <li>{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}</li> > * <li>{@link org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic <em>Is Atomic</em>}</li> > * </ul> > * </p> >@@ -39,6 +40,37 @@ > extends FeatureCallExpCS { > > /** >+ * Returns the value of the '<em><b>Path Name CS</b></em>' containment reference. >+ * <!-- begin-user-doc --> >+ * <p> >+ * If the meaning of the '<em>Path Name CS</em>' containment reference isn't clear, >+ * there really should be more of a description here... >+ * </p> >+ * >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @return the value of the '<em>Path Name CS</em>' containment reference. >+ * @see #setPathNameCS(PathNameCS) >+ * @see org.eclipse.ocl.cst.CSTPackage#getOperationCallExpCS_PathNameCS() >+ * @model containment="true" >+ * @generated >+ * >+ */ >+ PathNameCS getPathNameCS(); >+ >+ /** >+ * Sets the value of the '{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}' containment reference. >+ * <!-- begin-user-doc --> >+ * @since 3.0 >+ * <!-- end-user-doc --> >+ * @param value the new value of the '<em>Path Name CS</em>' containment reference. >+ * @see #getPathNameCS() >+ * @generated >+ * >+ */ >+ void setPathNameCS(PathNameCS value); >+ >+ /** > * Returns the value of the '<em><b>Is Atomic</b></em>' attribute. > * The default value is <code>"false"</code>. > * <!-- begin-user-doc --> >Index: src/org/eclipse/ocl/cst/CSTFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/CSTFactory.java,v >retrieving revision 1.4 >diff -u -r1.4 CSTFactory.java >--- src/org/eclipse/ocl/cst/CSTFactory.java 2 Dec 2008 11:58:50 -0000 1.4 >+++ src/org/eclipse/ocl/cst/CSTFactory.java 8 Oct 2009 11:53:21 -0000 >@@ -419,15 +419,6 @@ > OperationCallExpCS createOperationCallExpCS(); > > /** >- * Returns a new object of class '<em>State Exp CS</em>'. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @return a new object of class '<em>State Exp CS</em>'. >- * @generated >- */ >- StateExpCS createStateExpCS(); >- >- /** > * Returns a new object of class '<em>OCL Document CS</em>'. > * <!-- begin-user-doc --> > * @since 1.3 >Index: src/org/eclipse/ocl/cst/CollectionTypeCS.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/CollectionTypeCS.java,v >retrieving revision 1.3 >diff -u -r1.3 CollectionTypeCS.java >--- src/org/eclipse/ocl/cst/CollectionTypeCS.java 30 Nov 2008 22:11:38 -0000 1.3 >+++ src/org/eclipse/ocl/cst/CollectionTypeCS.java 8 Oct 2009 11:53:23 -0000 >@@ -37,7 +37,7 @@ > * @noextend This interface is not intended to be extended by clients. > */ > public interface CollectionTypeCS >- extends TypeCS { >+ extends SimpleNameCS, TypeCS { > > /** > * Returns the value of the '<em><b>Collection Type Identifier</b></em>' attribute. >Index: src/org/eclipse/ocl/cst/NullLiteralExpCS.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/NullLiteralExpCS.java,v >retrieving revision 1.3 >diff -u -r1.3 NullLiteralExpCS.java >--- src/org/eclipse/ocl/cst/NullLiteralExpCS.java 30 Nov 2008 22:11:38 -0000 1.3 >+++ src/org/eclipse/ocl/cst/NullLiteralExpCS.java 8 Oct 2009 11:53:23 -0000 >@@ -22,12 +22,6 @@ > * A representation of the model object '<em><b>Null Literal Exp CS</b></em>'. > * <!-- end-user-doc --> > * >- * <p> >- * The following features are supported: >- * <ul> >- * <li>{@link org.eclipse.ocl.cst.NullLiteralExpCS#getSymbol <em>Symbol</em>}</li> >- * </ul> >- * </p> > * > * @see org.eclipse.ocl.cst.CSTPackage#getNullLiteralExpCS() > * @model >@@ -36,32 +30,6 @@ > * @noextend This interface is not intended to be extended by clients. > */ > public interface NullLiteralExpCS >- extends LiteralExpCS { >- >- /** >- * Returns the value of the '<em><b>Symbol</b></em>' attribute. >- * <!-- begin-user-doc --> >- * <p> >- * If the meaning of the '<em>Symbol</em>' attribute isn't clear, >- * there really should be more of a description here... >- * </p> >- * <!-- end-user-doc --> >- * @return the value of the '<em>Symbol</em>' attribute. >- * @see #setSymbol(String) >- * @see org.eclipse.ocl.cst.CSTPackage#getNullLiteralExpCS_Symbol() >- * @model >- * @generated >- */ >- String getSymbol(); >- >- /** >- * Sets the value of the '{@link org.eclipse.ocl.cst.NullLiteralExpCS#getSymbol <em>Symbol</em>}' attribute. >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @param value the new value of the '<em>Symbol</em>' attribute. >- * @see #getSymbol() >- * @generated >- */ >- void setSymbol(String value); >+ extends SimpleNameCS, LiteralExpCS { > > } // NullLiteralExpCS >Index: src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java,v >retrieving revision 1.32 >diff -u -r1.32 AbstractOCLAnalyzer.java >--- src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java 4 Oct 2009 11:15:51 -0000 1.32 >+++ src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java 8 Oct 2009 11:53:26 -0000 >@@ -10,7 +10,7 @@ > * Contributors: > * IBM - Initial API and implementation > * E.D.Willink - refactored to separate from OCLAnalyzer and OCLParser >- * - Bugs 237126, 245586, 213886, 242236, 259818, 259819 >+ * - Bugs 184048, 237126, 245586, 213886, 242236, 259818, 259819 > * Adolfo Sánchez-Barbudo Herrera - Bug 237441 > * Zeligsoft - Bugs 243526, 243079, 245586 (merging and docs), 213886, 179990, > * 255599, 251349, 242236, 259740 >@@ -19,7 +19,7 @@ > * > * </copyright> > * >- * $Id: AbstractOCLAnalyzer.java,v 1.32 2009/10/04 11:15:51 ewillink Exp $ >+ * $Id: AbstractOCLAnalyzer.java,v 1.30 2009/09/04 13:40:43 ewillink Exp $ > */ > package org.eclipse.ocl.parser; > >@@ -89,7 +89,6 @@ > import org.eclipse.ocl.cst.RealLiteralExpCS; > import org.eclipse.ocl.cst.SimpleNameCS; > import org.eclipse.ocl.cst.SimpleTypeEnum; >-import org.eclipse.ocl.cst.StateExpCS; > import org.eclipse.ocl.cst.StringLiteralExpCS; > import org.eclipse.ocl.cst.TupleLiteralExpCS; > import org.eclipse.ocl.cst.TupleTypeCS; >@@ -290,14 +289,6 @@ > case OCLParsersym.TK_collectNested : > case OCLParsersym.TK_sortedBy : > case OCLParsersym.TK_closure : >- case OCLParsersym.TK_oclIsKindOf : >- case OCLParsersym.TK_oclIsTypeOf : >- case OCLParsersym.TK_oclAsType : >- case OCLParsersym.TK_oclIsNew : >- case OCLParsersym.TK_oclIsUndefined : >- case OCLParsersym.TK_oclIsInvalid : >- case OCLParsersym.TK_oclIsInState : >- case OCLParsersym.TK_allInstances : > case OCLParsersym.TK_String : > case OCLParsersym.TK_Integer : > case OCLParsersym.TK_UnlimitedNatural : >@@ -705,7 +696,7 @@ > initASTMapping(packageEnv, createDummyPackage(env, > packageDeclarationCS), packageDeclarationCS); > } else { >- pathname = createSequenceOfNames(pathNameCS.getSimpleNames()); >+ pathname = createSequenceOfNames(pathNameCS, null); > try { > packageEnv = createPackageContext(getOCLEnvironment(), pathname); > if (packageEnv != null) { >@@ -826,8 +817,7 @@ > > O operation = null; > C classifier = null; >- EList<String> className = createSequenceOfNames(operationCS.getPathNameCS() >- .getSimpleNames()); >+ EList<String> className = createSequenceOfNames(operationCS.getPathNameCS(), null); > String operationName = operationCS.getSimpleNameCS().getValue(); > EList<String> qualifiedOperationName = new BasicEList<String>(); > qualifiedOperationName.addAll(className); >@@ -1132,8 +1122,7 @@ > Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env, > List<CT> constraints) { > >- EList<String> pathName = createSequenceOfNames(propertyContextCS.getPathNameCS() >- .getSimpleNames()); >+ EList<String> pathName = createSequenceOfNames(propertyContextCS.getPathNameCS(), null); > C owner = lookupClassifier(propertyContextCS.getPathNameCS(), env, > pathName); > >@@ -1348,7 +1337,7 @@ > Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> result = null; > > PathNameCS pathNameCS = classifierContextDeclCS.getPathNameCS(); >- EList<String> pathName = createSequenceOfNames(pathNameCS.getSimpleNames()); >+ EList<String> pathName = createSequenceOfNames(pathNameCS, null); > C type = lookupClassifier(pathNameCS, env, pathName); > > if (type == null) { >@@ -1757,7 +1746,7 @@ > astNode = primitiveTypeCS(((PrimitiveTypeCS) typeCS).getType(), env); > typeCS.setAst(astNode); > } else if (typeCS instanceof PathNameCS) { >- EList<String> pathName = createSequenceOfNames(((PathNameCS) typeCS).getSimpleNames()); >+ EList<String> pathName = createSequenceOfNames((PathNameCS) typeCS, null); > astNode = lookupClassifier(typeCS, env, pathName); > if (astNode == null) { > String message = OCLMessages.bind( >@@ -1789,9 +1778,10 @@ > * @param env > * the OCL environment > * @return a <code>StateExp</code> representing the state >+ * @since 3.0 > */ > protected StateExp<C, S> stateExpCS(OCLExpression<C> source, >- StateExpCS stateExpCS, >+ CSTNode stateExpCS, EList<String> statePath, > Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) { > > C sourceType = null; >@@ -1801,8 +1791,6 @@ > > S state = null; > >- EList<String> statePath = createSequenceOfNames(stateExpCS.getSimpleNames()); >- > if (!statePath.isEmpty()) { > // to support content-assist, we can parse an expression that > // has no state, to provide suggestions for the first part >@@ -3283,8 +3271,7 @@ > > OCLExpression<C> astNode = null; > >- List<SimpleNameCS> simpleNames = enumLiteralExpCS.getPathNameCS().getSimpleNames(); >- EList<String> sequenceOfNames = createSequenceOfNames(simpleNames); >+ EList<String> sequenceOfNames = createSequenceOfNames(enumLiteralExpCS.getPathNameCS(), null); > String lastToken = enumLiteralExpCS.getSimpleNameCS().getValue(); > > EL literal = null; >@@ -4009,111 +3996,25 @@ > OperationCallExpCS operationCallExpCS, > Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) { > >- if (ParsingOptions.getValue(env, ParsingOptions.WARN_OF_XOR_OR_AND_PRECEDENCE_CHANGE)) { >- checkForXorOrAndPrecedenceHazard(operationCallExpCS); >- } >- >- OperationCallExp<C, O> astNode = null; >- >- List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>(); >- // boolean isMarkedPre = false; >- >- String name = operationCallExpCS.getSimpleNameCS().getValue(); > int operator = operationCallExpCS.getAccessor().getValue(); >- >- /* >- * The type of the operation is specified by a path expression or self, >- * or by an explicit source expression. The source expression may be a >- * collection type (-> operation) or a regular navigation expression (. >- * operation) >- */ >- OCLExpression<C> source = null; > if (operator == DotOrArrowEnum.ARROW) { >- source = getCollectionSourceExpression(operationCallExpCS >- .getSource(), env); >- } else { >- OCLExpressionCS sourceCS = operationCallExpCS.getSource(); >- >- if (sourceCS instanceof PathNameCS) { >- // static operation call >- PathNameCS pathName = (PathNameCS) sourceCS; >- >- EList<String> pathNames = createSequenceOfNames(pathName >- .getSimpleNames()); >- C sourceType = lookupClassifier(sourceCS, env, pathNames); >- if (sourceType == null) { >- String message = OCLMessages.bind( >- OCLMessages.UnrecognizedType_ERROR_, pathNames); >- ERROR(sourceCS, "operatonCallExpCS", message);//$NON-NLS-1$ >- } else { >- source = typeCS(sourceCS, env, sourceType); >- } >- } else { >- source = oclExpressionCS(operationCallExpCS.getSource(), env); >- } >+ return arrowOperationCallExpCS(operationCallExpCS, env); >+ } >+ OCLExpressionCS sourceCS = operationCallExpCS.getSource(); >+ if ((sourceCS == null) && (operationCallExpCS.getPathNameCS() != null)) { >+ return staticOperationCallExpCS(operationCallExpCS, env); > } >- > String operationName = operationCallExpCS.getSimpleNameCS().getValue(); >- > if (PredefinedType.OCL_IS_IN_STATE_NAME.equals(operationName)) { >- if (operationCallExpCS.getArguments().size() != 1) { >- String message = OCLMessages.bind( >- OCLMessages.IsInStateSignature_ERROR_, >- computeInputString(operationCallExpCS)); >- ERROR(operationCallExpCS, "operationCallExpCS", message);//$NON-NLS-1$ >- } >- >- if (!operationCallExpCS.getArguments().isEmpty()) { >- OCLExpressionCS arg = operationCallExpCS.getArguments().get(0); >- >- if (arg instanceof StateExpCS) { >- args.add(stateExpCS(source, (StateExpCS) arg, env)); >- } else { >- String message = OCLMessages.bind( >- OCLMessages.IsInStateSignature_ERROR_, >- computeInputString(operationCallExpCS)); >- ERROR(arg, "operationCallExpCS", message);//$NON-NLS-1$ >- } >- } >- } else { >- for (OCLExpressionCS arg : operationCallExpCS.getArguments()) { >- OCLExpression<C> argExpr = oclExpressionCS(arg, env); >- if (argExpr == null) { >- argExpr = createDummyInvalidLiteralExp(env, arg); >- initASTMapping(env, argExpr, arg); >- } >- args.add(argExpr); >- } >+ return oclIsInStateOperationCallExpCS(operationCallExpCS, env); > } >- >- if (source == null) { // create an implicit source >- Variable<C, PM> implicitSource = lookupImplicitSourceForOperation( >- operationCallExpCS, env, args, operationName); >- VariableExp<C, PM> vexp = createVariableExp(env, >- operationCallExpCS, implicitSource); >- >- if (implicitSource == null) { >- String errMessage = name + "(";//$NON-NLS-1$ >- for (int i = 0; i < args.size(); i++) { >- if (i > 0) { >- errMessage += ", ";//$NON-NLS-1$ >- } >- errMessage += uml.getName(args.get(i).getType()); >- } >- errMessage += ")";//$NON-NLS-1$ >- String message = OCLMessages.bind( >- OCLMessages.IllegalSignature_ERROR_, errMessage); >- ERROR(operationCallExpCS, "operationCallExpCS", message); //$NON-NLS-1$ >- } >- >- if (implicitSource != null) { >- vexp.setType(implicitSource.getType()); >- vexp.setReferredVariable(implicitSource); >- } else { >- vexp.setType(getOclVoid()); >- } >- >- source = vexp; >+ if (ParsingOptions.getValue(env, ParsingOptions.WARN_OF_XOR_OR_AND_PRECEDENCE_CHANGE)) { >+ checkForXorOrAndPrecedenceHazard(operationCallExpCS); >+ } >+ OCLExpression<C> source = oclExpressionCS(operationCallExpCS.getSource(), env); >+ List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env); >+ if (source == null) { // create an implicit source >+ source = createImplicitSource(operationCallExpCS, env, args); > } > > /* >@@ -4134,7 +4035,7 @@ > // if the sourceType is a TypeType then this must be a static operation > boolean isStatic = operationSourceType instanceof TypeType<?, ?>; > >- astNode = genOperationCallExp(env, operationCallExpCS, >+ OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS, > "operationCallExpCS", operationName,//$NON-NLS-1$ > source, operationSourceType, args); > if (isStatic) { >@@ -4173,6 +4074,214 @@ > return result; > } > >+ /** >+ * @since 3.0 >+ */ >+ protected OCLExpression<C> createImplicitSource(OperationCallExpCS operationCallExpCS, >+ Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env, >+ List<OCLExpression<C>> args) { >+ >+ String operationName = operationCallExpCS.getSimpleNameCS().getValue(); >+ Variable<C, PM> implicitSource = lookupImplicitSourceForOperation( >+ operationCallExpCS, env, args, operationName); >+ VariableExp<C, PM> vexp = createVariableExp(env, operationCallExpCS, implicitSource); >+ >+ if (implicitSource == null) { >+ String errMessage = operationName + "(";//$NON-NLS-1$ >+ for (int i = 0; i < args.size(); i++) { >+ if (i > 0) { >+ errMessage += ", ";//$NON-NLS-1$ >+ } >+ errMessage += uml.getName(args.get(i).getType()); >+ } >+ errMessage += ")";//$NON-NLS-1$ >+ String message = OCLMessages.bind( >+ OCLMessages.IllegalSignature_ERROR_, errMessage); >+ ERROR(operationCallExpCS, "operationCallExpCS", message); //$NON-NLS-1$ >+ } >+ >+ if (implicitSource != null) { >+ vexp.setType(implicitSource.getType()); >+ vexp.setReferredVariable(implicitSource); >+ } else { >+ vexp.setType(getOclVoid()); >+ } >+ return vexp; >+ } >+ >+ /** >+ * OperationCallExpCS for an -> >+ * >+ * @param operationCallExpCS >+ * the <code>OperationCallExpCS</code> <code>CSTNode</code> >+ * @param env >+ * the OCL environment >+ * @return the parsed <code>OCLExpression</code> >+ * @since 3.0 >+ */ >+ protected OCLExpression<C> arrowOperationCallExpCS( >+ OperationCallExpCS operationCallExpCS, >+ Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) { >+ >+ OCLExpression<C> source = getCollectionSourceExpression(operationCallExpCS.getSource(), env); >+ List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env); >+ >+ String operationName = operationCallExpCS.getSimpleNameCS().getValue(); >+ C operationSourceType = source.getType(); >+ OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS, >+ "operationCallExpCS", operationName,//$NON-NLS-1$ >+ source, operationSourceType, args); >+ >+ initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS()); >+ >+ if (isErrorNode(source)) { >+ // don't attempt to parse navigation from an unparseable source >+ markAsErrorNode(astNode); >+ } >+ >+ return astNode; >+ } >+ /** >+ * OperationCallExpCS for oclIsInState >+ * >+ * @param operationCallExpCS >+ * the <code>OperationCallExpCS</code> <code>CSTNode</code> >+ * @param env >+ * the OCL environment >+ * @return the parsed <code>OCLExpression</code> >+ * @since 3.0 >+ */ >+ protected OCLExpression<C> oclIsInStateOperationCallExpCS( >+ OperationCallExpCS operationCallExpCS, >+ Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) { >+ if (operationCallExpCS.getArguments().size() != 1) { >+ String message = OCLMessages.bind( >+ OCLMessages.IsInStateSignature_ERROR_, >+ computeInputString(operationCallExpCS)); >+ ERROR(operationCallExpCS, "operationCallExpCS", message);//$NON-NLS-1$ >+ } >+ >+ OCLExpression<C> source = oclExpressionCS(operationCallExpCS.getSource(), env); >+ List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>(); >+ if (!operationCallExpCS.getArguments().isEmpty()) { >+ OCLExpressionCS arg = operationCallExpCS.getArguments().get(0); >+ if (arg instanceof VariableExpCS) { >+ VariableExpCS stateName = (VariableExpCS) arg; >+ EList<String> statePath = createSequenceOfNames(null, stateName.getSimpleNameCS()); >+ args.add(stateExpCS(source, stateName, statePath, env)); >+ } else if (arg instanceof EnumLiteralExpCS) { >+ EnumLiteralExpCS stateName = (EnumLiteralExpCS) arg; >+ EList<String> statePath = createSequenceOfNames(stateName.getPathNameCS(), stateName.getSimpleNameCS()); >+ args.add(stateExpCS(source, stateName, statePath, env)); >+ } else { >+ String message = OCLMessages.bind( >+ OCLMessages.IsInStateSignature_ERROR_, >+ computeInputString(operationCallExpCS)); >+ ERROR(arg, "operationCallExpCS", message);//$NON-NLS-1$ >+ } >+ } >+ if (source == null) { // create an implicit source >+ source = createImplicitSource(operationCallExpCS, env, args); >+ } >+ C operationSourceType = source.getType(); >+ String operationName = operationCallExpCS.getSimpleNameCS().getValue(); >+ OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS, >+ "operationCallExpCS", operationName,//$NON-NLS-1$ >+ source, operationSourceType, args); >+ astNode.setMarkedPre(isAtPre(operationCallExpCS)); >+ initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS()); >+ if (isErrorNode(source)) { >+ // don't attempt to parse navigation from an unparseable source >+ markAsErrorNode(astNode); >+ } >+ return astNode; >+ } >+ >+ /** >+ * @since 3.0 >+ */ >+ protected OCLExpression<C> staticOperationCallExpCS( >+ OperationCallExpCS operationCallExpCS, >+ Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) { >+ >+ OCLExpression<C> source = null; >+// OCLExpressionCS sourceCS = operationCallExpCS.getSource(); >+ PathNameCS pathNameCS = operationCallExpCS.getPathNameCS(); >+ >+ EList<String> pathNames = createSequenceOfNames(pathNameCS, null); >+ C sourceType = lookupClassifier(pathNameCS, env, pathNames); >+ if (sourceType == null) { >+ String message = OCLMessages.bind( >+ OCLMessages.UnrecognizedType_ERROR_, pathNames); >+ ERROR(operationCallExpCS, "operatonCallExpCS", message);//$NON-NLS-1$ >+ } else { >+ source = typeCS(pathNameCS, env, sourceType); >+ } >+ >+ String operationName = operationCallExpCS.getSimpleNameCS().getValue(); >+ >+ List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env); >+ >+ /* >+ * If the source type is a collection and operator is ".", then there is >+ * an implicit COLLECT operator. >+ */ >+ C operationSourceType = source.getType(); >+ >+ // if the sourceType is a TypeType then this must be a static operation >+ boolean isStatic = operationSourceType instanceof TypeType<?, ?>; >+ >+ OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS, >+ "operationCallExpCS", operationName,//$NON-NLS-1$ >+ source, operationSourceType, args); >+ if (isStatic) { >+ @SuppressWarnings("unchecked") >+ TypeType<C, O> typeType = (TypeType<C, O>) operationSourceType; >+ O operation = astNode.getReferredOperation(); >+ >+ // operation must either be defined by the TypeType (e.g., >+ // allInstances()) >+ // or be a static operation of the referred classifier >+ if (!(typeType.oclOperations().contains(operation) || uml >+ .isStatic(operation))) { >+ >+ String message = OCLMessages.bind( >+ OCLMessages.NonStaticOperation_ERROR_, operationName); >+ ERROR(astNode, "operationCallExpCS", message);//$NON-NLS-1$ >+ } >+ } >+ >+// astNode.setMarkedPre(isAtPre(operationCallExpCS)); >+ >+ initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS()); >+ >+ OCLExpression<C> result = astNode; >+ >+ if (isErrorNode(source)) { >+ // don't attempt to parse navigation from an unparseable source >+ markAsErrorNode(result); >+ } >+ >+ return result; >+} >+ >+ /** >+ * @since 3.0 >+ */ >+ protected List<OCLExpression<C>> argumentsCS(OperationCallExpCS operationCallExpCS, >+ Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) { >+ List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>(); >+ for (OCLExpressionCS arg : operationCallExpCS.getArguments()) { >+ OCLExpression<C> argExpr = oclExpressionCS(arg, env); >+ if (argExpr == null) { >+ argExpr = createDummyInvalidLiteralExp(env, arg); >+ initASTMapping(env, argExpr, arg); >+ } >+ args.add(argExpr); >+ } >+ return args; >+ } >+ > private void checkForXorOrAndPrecedenceHazard(OperationCallExpCS operationCallExpCS) { > String parentOperationName = operationCallExpCS.getSimpleNameCS().getValue(); > if ("xor".equals(parentOperationName)) { //$NON-NLS-1$ >@@ -4849,6 +4958,7 @@ > /** > * @since 3.0 > */ >+ @Deprecated // Temporary compatibility with 3.0.0M1 > public static EList<String> createSequenceOfNames(List<SimpleNameCS> simpleNames) { > EList<String> sequenceOfNames = new BasicEList<String>(); > for (SimpleNameCS simpleName : simpleNames) >@@ -4857,6 +4967,21 @@ > } > > /** >+ * @since 3.0 >+ */ >+ public static EList<String> createSequenceOfNames(PathNameCS pathNameCS, SimpleNameCS simpleNameCS) { >+ EList<String> sequenceOfNames = new BasicEList<String>(); >+ if (pathNameCS != null) { >+ for (SimpleNameCS simpleName : pathNameCS.getSimpleNames()) >+ sequenceOfNames.add(simpleName.getValue()); >+ } >+ if (simpleNameCS != null) { >+ sequenceOfNames.add(simpleNameCS.getValue()); >+ } >+ return sequenceOfNames; >+ } >+ >+ /** > * Queries whether the specified name is escaped with an initial underscore > * (<code>'_'</code>) character. > * >Index: src/org/eclipse/ocl/parser/OCLParser.g >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLParser.g,v >retrieving revision 1.5 >diff -u -r1.5 OCLParser.g >--- src/org/eclipse/ocl/parser/OCLParser.g 4 Sep 2009 13:40:43 -0000 1.5 >+++ src/org/eclipse/ocl/parser/OCLParser.g 8 Oct 2009 11:53:27 -0000 >@@ -63,19 +63,6 @@ > ./ > $End > >-$KeyWords >- context >- package >- >- -- >- -- the following are not used in the OCL concrete syntax, but >- -- are defined as reserved words in the OCL 2.0 Spec 7.4.9 >- -- and were removed in the OCL 2.1 RTF 09-05-02. >- -- >- attr >- oper >-$End >- > $Rules > -- opt = optional > -- m = multiple >@@ -142,13 +129,14 @@ > contextDeclCS -> operationContextDeclCS > contextDeclCS -> propertyContextCS > >- propertyContextCS ::= context pathNameCS '::' simpleNameCS ':' typeCS initOrDerValueCSm >+ propertyContextCS ::= context qualifiedPathNameCS ':' typeCS initOrDerValueCSm > /.$BeginJava >- EList<InitOrDerValueCS> list = (EList<InitOrDerValueCS>)$getSym(7); >+ PathNameCS pathNameCS = (PathNameCS)$getSym(2); >+ EList<InitOrDerValueCS> list = (EList<InitOrDerValueCS>)$getSym(5); > CSTNode result = createPropertyContextCS( >- (PathNameCS)$getSym(2), >- (SimpleNameCS)$getSym(4), >- (TypeCS)$getSym(6), >+ pathNameCS, >+ removeLastSimpleNameCS(pathNameCS), >+ (TypeCS)$getSym(4), > list > ); > setOffsets(result, getIToken($getToken(1)), list.get(list.size()-1)); >Index: src/org/eclipse/ocl/parser/AbstractOCLParser.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLParser.java,v >retrieving revision 1.8 >diff -u -r1.8 AbstractOCLParser.java >--- src/org/eclipse/ocl/parser/AbstractOCLParser.java 4 Sep 2009 13:40:43 -0000 1.8 >+++ src/org/eclipse/ocl/parser/AbstractOCLParser.java 8 Oct 2009 11:53:26 -0000 >@@ -40,6 +40,7 @@ > import org.eclipse.ocl.cst.DefCS; > import org.eclipse.ocl.cst.DefExpressionCS; > import org.eclipse.ocl.cst.DerValueCS; >+import org.eclipse.ocl.cst.DotOrArrowEnum; > import org.eclipse.ocl.cst.EnumLiteralExpCS; > import org.eclipse.ocl.cst.FeatureCallExpCS; > import org.eclipse.ocl.cst.IfExpCS; >@@ -71,7 +72,6 @@ > import org.eclipse.ocl.cst.RealLiteralExpCS; > import org.eclipse.ocl.cst.SimpleNameCS; > import org.eclipse.ocl.cst.SimpleTypeEnum; >-import org.eclipse.ocl.cst.StateExpCS; > import org.eclipse.ocl.cst.StringLiteralExpCS; > import org.eclipse.ocl.cst.TupleLiteralExpCS; > import org.eclipse.ocl.cst.TupleTypeCS; >@@ -274,12 +274,17 @@ > SimpleTypeEnum.IDENTIFIER_LITERAL, simpleName), list, typeCS); > } > >- protected OperationCallExpCS createOperationCallExpCS( >- OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, >+ /** >+ * @since 3.0 >+ */ >+ private OperationCallExpCS createOperationCallExpCS( >+ OCLExpressionCS oclExpressionCS, DotOrArrowEnum dotOrArrow, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, > IsMarkedPreCS isMarkedPreCS, EList<OCLExpressionCS> arguments) { > OperationCallExpCS result = CSTFactory.eINSTANCE > .createOperationCallExpCS(); > result.setSource(oclExpressionCS); >+ result.setAccessor(dotOrArrow); >+ result.setPathNameCS(pathNameCS); > result.setSimpleNameCS(simpleNameCS); > result.getArguments().addAll(arguments); > >@@ -305,38 +310,37 @@ > return atPreCS != null; > } > >+ /** >+ * @since 3.0 >+ */ > protected OperationCallExpCS createOperationCallExpCS( > OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, > EList<OCLExpressionCS> arguments) { >- return createOperationCallExpCS(oclExpressionCS, simpleNameCS, >+ return createOperationCallExpCS(oclExpressionCS, null, null, simpleNameCS, > null, arguments); > } > >- protected OperationCallExpCS createOperationCallExpCS( >- SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, >+ /** >+ * @since 3.0 >+ */ >+ protected OperationCallExpCS createArrowOperationCallExpCS( >+ OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, > EList<OCLExpressionCS> arguments) { >- return createOperationCallExpCS(null, simpleNameCS, isMarkedPreCS, >+ return createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.ARROW_LITERAL, null, simpleNameCS, isMarkedPreCS, > arguments); > } > >- protected OperationCallExpCS createOperationCallExpCS( >- SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, >- StateExpCS stateExpCS) { >- OperationCallExpCS result = CSTFactory.eINSTANCE >- .createOperationCallExpCS(); >- result.setSimpleNameCS(simpleNameCS); >- result.getArguments().add(stateExpCS); >- >- if (isAtPre(isMarkedPreCS)) { >- result.setIsMarkedPreCS(isMarkedPreCS); >+ /** >+ * @since 3.0 >+ */ >+ protected OperationCallExpCS createDotOperationCallExpCS( >+ OCLExpressionCS oclExpressionCS, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, >+ EList<OCLExpressionCS> arguments) { >+ OperationCallExpCS result = createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.DOT_LITERAL, pathNameCS, simpleNameCS, >+ isMarkedPreCS, arguments); >+ if (oclExpressionCS != null) { >+ result.setIsAtomic(true); > } >- >- return result; >- } >- >- protected StateExpCS createStateExpCS(PathNameCS pathName) { >- StateExpCS result = CSTFactory.eINSTANCE.createStateExpCS(); >- result.getSimpleNames().addAll(pathName.getSimpleNames()); > return result; > } > >@@ -364,7 +368,7 @@ > String value) { > PrimitiveTypeCS result = CSTFactory.eINSTANCE.createPrimitiveTypeCS(); > result.setType(type); >- result.setValue(value); >+ result.setValue(unquote(value)); > return result; > } > >@@ -385,10 +389,47 @@ > return path; > } > >+ /** >+ * @since 3.0 >+ */ >+ protected SimpleNameCS removeLastSimpleNameCS(PathNameCS path) { >+ EList<SimpleNameCS> simpleNames = path.getSimpleNames(); >+ SimpleNameCS name = simpleNames.remove(simpleNames.size()-1); >+ setOffsets(path, path, simpleNames.get(simpleNames.size()-1)); >+ return name; >+ } >+ > protected PathNameCS createPathNameCS() { > return CSTFactory.eINSTANCE.createPathNameCS(); > } > >+ /** >+ * @since 3.0 >+ */ >+ protected PathNameCS createPathNamePrefixCS(PathNameCS pathNameCS) { >+ EList<SimpleNameCS> simpleNames = pathNameCS.getSimpleNames(); >+ int size = simpleNames.size(); >+ PathNameCS prefixPathNameCS = CSTFactory.eINSTANCE.createPathNameCS(); >+ if (size > 1) { >+ for (int i = 0; i < size-1; i++) { >+ extendPathNameCS(prefixPathNameCS, simpleNames.get(i)); >+ } >+ setOffsets(prefixPathNameCS, prefixPathNameCS.getSimpleNames().get(0), prefixPathNameCS.getSimpleNames().get(size-2)); >+ } >+ return prefixPathNameCS; >+ } >+ /** >+ * @since 3.0 >+ */ >+ protected SimpleNameCS getPathNameSuffixCS(PathNameCS pathNameCS) { >+ EList<SimpleNameCS> simpleNames = pathNameCS.getSimpleNames(); >+ int size = simpleNames.size(); >+ return size > 0 ? simpleNames.get(size-1) : null; >+ } >+ >+ /** >+ * @since 3.0 >+ */ > protected EnumLiteralExpCS createEnumLiteralExpCS(PathNameCS pathNameCS, > SimpleNameCS simpleNameCS) { > EnumLiteralExpCS result = CSTFactory.eINSTANCE.createEnumLiteralExpCS(); >@@ -398,22 +439,14 @@ > } > > /** >- * @deprecated Use {@link #createEnumLiteralExpCS(PathNameCS, SimpleNameCS)} >- * , instead. >+ * @since 3.0 > */ >- @Deprecated >- protected EnumLiteralExpCS createEnumLiteralExpCS(PathNameCS pathNameCS, >- String simpleName) { >- return createEnumLiteralExpCS(pathNameCS, createSimpleNameCS( >- SimpleTypeEnum.IDENTIFIER_LITERAL, simpleName)); >- } >- > protected CollectionLiteralExpCS createCollectionLiteralExpCS( >- CollectionTypeIdentifierEnum type, >+ CollectionTypeCS typeCS, > EList<CollectionLiteralPartCS> collectionLiteralParts) { > CollectionLiteralExpCS result = CSTFactory.eINSTANCE > .createCollectionLiteralExpCS(); >- result.setCollectionType(type); >+ result.setCollectionType(typeCS.getCollectionTypeIdentifier()); > result.getCollectionLiteralParts().addAll(collectionLiteralParts); > return result; > } >@@ -500,6 +533,8 @@ > protected BooleanLiteralExpCS createBooleanLiteralExpCS(String string) { > BooleanLiteralExpCS result = CSTFactory.eINSTANCE > .createBooleanLiteralExpCS(); >+ result.setValue(string); >+ result.setType(SimpleTypeEnum.KEYWORD_LITERAL); > result.setSymbol(string); > result.setBooleanSymbol(Boolean.valueOf(string)); > return result; >@@ -507,21 +542,29 @@ > > protected NullLiteralExpCS createNullLiteralExpCS(String string) { > NullLiteralExpCS result = CSTFactory.eINSTANCE.createNullLiteralExpCS(); >- result.setSymbol(string); >+ result.setValue(string); >+ result.setType(SimpleTypeEnum.KEYWORD_LITERAL); > return result; > } > > protected InvalidLiteralExpCS createInvalidLiteralExpCS(String string) { > InvalidLiteralExpCS result = CSTFactory.eINSTANCE > .createInvalidLiteralExpCS(); >- result.setSymbol(string); >+ result.setValue(string); >+ result.setType(SimpleTypeEnum.KEYWORD_LITERAL); > return result; > } > >- protected IteratorExpCS createIteratorExpCS(SimpleNameCS simpleNameCS, >+ /** >+ * @since 3.0 >+ */ >+ protected IteratorExpCS createIteratorExpCS( >+ OCLExpressionCS source, SimpleNameCS simpleNameCS, > VariableCS variable1, VariableCS variable2, > OCLExpressionCS oclExpressionCS) { > IteratorExpCS result = CSTFactory.eINSTANCE.createIteratorExpCS(); >+ result.setSource(source); >+ result.setAccessor(DotOrArrowEnum.ARROW_LITERAL); > result.setSimpleNameCS(simpleNameCS); > result.setVariable1(variable1); > result.setVariable2(variable2); >@@ -529,10 +572,16 @@ > return result; > } > >- protected IterateExpCS createIterateExpCS(SimpleNameCS simpleNameCS, >+ /** >+ * @since 3.0 >+ */ >+ protected IterateExpCS createIterateExpCS( >+ OCLExpressionCS source, SimpleNameCS simpleNameCS, > VariableCS variable1, VariableCS variable2, > OCLExpressionCS oclExpressionCS) { > IterateExpCS result = CSTFactory.eINSTANCE.createIterateExpCS(); >+ result.setSource(source); >+ result.setAccessor(DotOrArrowEnum.ARROW_LITERAL); > result.setSimpleNameCS(simpleNameCS); > result.setVariable1(variable1); > result.setVariable2(variable2); >@@ -540,20 +589,24 @@ > return result; > } > >- protected VariableCS createVariableCS(String varName, TypeCS typeCS, >- OCLExpressionCS oclExpressionCS) { >+ /** >+ * @since 3.0 >+ */ >+ protected VariableCS createVariableCS(String varName) { > VariableCS result = CSTFactory.eINSTANCE.createVariableCS(); > result.setName(unquote(varName)); >- result.setTypeCS(typeCS); >- result.setInitExpression(oclExpressionCS); > return result; > } > >+ /** >+ * @since 3.0 >+ */ > protected CollectionTypeCS createCollectionTypeCS( >- CollectionTypeIdentifierEnum collectionType, TypeCS typeCS) { >+ CollectionTypeIdentifierEnum collectionType, String value) { > CollectionTypeCS result = CSTFactory.eINSTANCE.createCollectionTypeCS(); >+ result.setType(SimpleTypeEnum.IDENTIFIER_LITERAL); >+ result.setValue(unquote(value)); > result.setCollectionTypeIdentifier(collectionType); >- result.setTypeCS(typeCS); > return result; > } > >@@ -563,10 +616,15 @@ > return result; > } > >+ /** >+ * @since 3.0 >+ */ > protected FeatureCallExpCS createFeatureCallExpCS( >- SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments, >+ OCLExpressionCS source, SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments, > IsMarkedPreCS isMarkedPreCS) { > FeatureCallExpCS result = CSTFactory.eINSTANCE.createFeatureCallExpCS(); >+ result.setSource(source); >+ result.setAccessor(DotOrArrowEnum.DOT_LITERAL); > result.setSimpleNameCS(simpleNameCS); > result.getArguments().addAll(arguments); > >@@ -602,9 +660,13 @@ > return result; > } > >- protected MessageExpCS createMessageExpCS(boolean hasSent, >+ /** >+ * @since 3.0 >+ */ >+ protected MessageExpCS createMessageExpCS(OCLExpressionCS target, boolean hasSent, > SimpleNameCS simpleNameCS, EList<OCLMessageArgCS> oclMessageArgs) { > MessageExpCS result = CSTFactory.eINSTANCE.createMessageExpCS(); >+ result.setTarget(target); > result.setKind(hasSent > ? MessageExpKind.HAS_SENT_LITERAL > : MessageExpKind.SENT_LITERAL); >Index: src/org/eclipse/ocl/parser/OCLKWLexer.g >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLKWLexer.g,v >retrieving revision 1.4 >diff -u -r1.4 OCLKWLexer.g >--- src/org/eclipse/ocl/parser/OCLKWLexer.g 2 Oct 2009 20:55:33 -0000 1.4 >+++ src/org/eclipse/ocl/parser/OCLKWLexer.g 8 Oct 2009 11:53:27 -0000 >@@ -12,7 +12,7 @@ > -- * > -- * </copyright> > -- * >--- * $Id: OCLKWLexer.g,v 1.4 2009/10/02 20:55:33 ewillink Exp $ >+-- * $Id: OCLKWLexer.g,v 1.3 2009/09/04 08:27:07 ewillink Exp $ > -- */ > -- > -- The OCL KeyWord Lexer >@@ -50,10 +50,11 @@ > * Contributors: > * IBM - Initial API and implementation > * E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling >+ * E.D.Willink - Bug 285633 static definitions > $copyright_contributions > * </copyright> > * >- * $Id: OCLKWLexer.g,v 1.4 2009/10/02 20:55:33 ewillink Exp $ >+ * $Id: OCLKWLexer.g,v 1.3 2009/09/04 08:27:07 ewillink Exp $ > */ > ./ > $End >@@ -101,14 +102,6 @@ > null > invalid > -- return -- don't need a keyword for LPG purposes >- >- -- >- -- the following are not used in the OCL concrete syntax, but >- -- are defined as reserved words in the OCL 2.0 Spec 7.4.9 >- -- and were removed in the OCL 2.1 RTF 09-05-02. >- -- >- attr >- oper > > -- > -- the following were introduced in the OCL 2.1 RTF 09-05-02. >@@ -144,15 +137,6 @@ > -- > closure > >- oclIsKindOf >- oclIsTypeOf >- oclAsType >- oclIsNew >- oclIsUndefined >- oclIsInvalid >- oclIsInState >- allInstances >- > String > Integer > UnlimitedNatural >@@ -429,54 +413,6 @@ > $setResult($_closure); > $EndAction > ./ >- >- | o c l I s K i n d O f >- /.$BeginAction >- $setResult($_oclIsKindOf); >- $EndAction >- ./ >- >- | o c l I s T y p e O f >- /.$BeginAction >- $setResult($_oclIsTypeOf); >- $EndAction >- ./ >- >- | o c l A s T y p e >- /.$BeginAction >- $setResult($_oclAsType); >- $EndAction >- ./ >- >- | o c l I s N e w >- /.$BeginAction >- $setResult($_oclIsNew); >- $EndAction >- ./ >- >- | o c l I s U n d e f i n e d >- /.$BeginAction >- $setResult($_oclIsUndefined); >- $EndAction >- ./ >- >- | o c l I s I n v a l i d >- /.$BeginAction >- $setResult($_oclIsInvalid); >- $EndAction >- ./ >- >- | o c l I s I n S t a t e >- /.$BeginAction >- $setResult($_oclIsInState); >- $EndAction >- ./ >- >- | a l l I n s t a n c e s >- /.$BeginAction >- $setResult($_allInstances); >- $EndAction >- ./ > > | S t r i n g > /.$BeginAction >@@ -550,18 +486,6 @@ > $EndAction > ./ > >- | a t t r >- /.$BeginAction >- $setResult($_attr); >- $EndAction >- ./ >- >- | o p e r >- /.$BeginAction >- $setResult($_oper); >- $EndAction >- ./ >- > | s t a t i c > /.$BeginAction > $setResult($_static); >Index: src/org/eclipse/ocl/parser/EssentialOCL.g >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/EssentialOCL.g,v >retrieving revision 1.12 >diff -u -r1.12 EssentialOCL.g >--- src/org/eclipse/ocl/parser/EssentialOCL.g 4 Oct 2009 11:15:51 -0000 1.12 >+++ src/org/eclipse/ocl/parser/EssentialOCL.g 8 Oct 2009 11:53:27 -0000 >@@ -12,7 +12,7 @@ > -- * > -- * </copyright> > -- * >--- * $Id: EssentialOCL.g,v 1.12 2009/10/04 11:15:51 ewillink Exp $ >+-- * $Id: EssentialOCL.g,v 1.10 2009/09/04 13:40:43 ewillink Exp $ > -- */ > -- > -- The EssentialOCL Parser >@@ -193,12 +193,12 @@ > * IBM - Initial API and implementation > * E.D.Willink - Elimination of some shift-reduce conflicts > * E.D.Willink - Remove unnecessary warning suppression >- * E.D.Willink - Bugs 225493, 243976, 259818, 282882, 287993, 288040 >+ * E.D.Willink - Bugs 184048, 225493, 243976, 259818, 282882, 287993, 288040 > * Borland - Bug 242880 > $copyright_contributions > * </copyright> > * >- * $Id: EssentialOCL.g,v 1.12 2009/10/04 11:15:51 ewillink Exp $ >+ * $Id: EssentialOCL.g,v 1.10 2009/09/04 13:40:43 ewillink Exp $ > */ > ./ > $End >@@ -208,8 +208,8 @@ > import org.eclipse.emf.common.util.EList; > import org.eclipse.ocl.cst.CSTNode; > import org.eclipse.ocl.cst.CallExpCS; >+ import org.eclipse.ocl.cst.CollectionTypeCS; > import org.eclipse.ocl.cst.CollectionTypeIdentifierEnum; >- import org.eclipse.ocl.cst.DotOrArrowEnum; > import org.eclipse.ocl.cst.IntegerLiteralExpCS; > import org.eclipse.ocl.cst.IsMarkedPreCS; > import org.eclipse.ocl.cst.MessageExpCS; >@@ -219,7 +219,6 @@ > import org.eclipse.ocl.cst.PathNameCS; > import org.eclipse.ocl.cst.SimpleNameCS; > import org.eclipse.ocl.cst.SimpleTypeEnum; >- import org.eclipse.ocl.cst.StateExpCS; > import org.eclipse.ocl.cst.StringLiteralExpCS; > import org.eclipse.ocl.cst.TypeCS; > import org.eclipse.ocl.cst.VariableCS; >@@ -239,49 +238,65 @@ > $End > > $KeyWords >- self >- inv >- pre >- post >- endpackage >- def >- if >- then >+ -- EssentialOCL keywords >+ and > else > endif >- and >- or >- xor >- not >+ if > implies >- let > in >- true >- false >+ let >+ not >+ or >+ then >+ xor >+ >+ -- CompleteOCL keywords >+ body >+ context >+ def >+ derive >+ endpackage >+ init >+ inv >+ package >+ post >+ pre >+ static > > -- > -- the following appear to have been omitted from the list of > -- OCL reserved words in Section 7.4.9. They will be treated > -- as unreserved for compliance > -- >- body >- derive >- init >+ false > null > invalid >--- return -- don't need a keyword for LPG purposes >+ self >+ true > >- -- >- -- the remainder of the LPG keywords are defined as such for the >- -- purpose of constructing the CST grammar. They are not OCL >- -- reserved words >- -- > Set > Bag > Sequence > Collection > OrderedSet > >+ String >+ Integer >+ UnlimitedNatural >+ Real >+ Boolean >+ Tuple >+ OclAny >+ OclVoid >+ OclInvalid >+ OclMessage >+ >+ -- >+ -- the remainder of the LPG keywords are defined as such for the >+ -- purpose of constructing the CST grammar. They are not OCL >+ -- reserved words >+ -- > iterate > forAll > exists >@@ -296,26 +311,6 @@ > sortedBy > > closure >- >- oclIsKindOf >- oclIsTypeOf >- oclAsType >- oclIsNew >- oclIsUndefined >- oclIsInvalid >- oclIsInState >- allInstances >- >- String >- Integer >- UnlimitedNatural >- Real >- Boolean >- Tuple >- OclAny >- OclVoid >- OclInvalid >- OclMessage > $End > > $Identifier >@@ -399,28 +394,24 @@ > -- and are commonly used in models such as the UML metamodel, itself > -- > >- binaryIdentifier -> oclIsUndefined >- binaryIdentifier -> oclIsInvalid >- binaryIdentifier -> oclIsNew >- binaryIdentifier -> oclAsType >- binaryIdentifier -> oclIsKindOf >- binaryIdentifier -> oclIsTypeOf >- binaryIdentifier -> EQUAL >- binaryIdentifier -> NOT_EQUAL >- binaryIdentifier -> PLUS >- binaryIdentifier -> MULTIPLY >- binaryIdentifier -> DIVIDE >- binaryIdentifier -> GREATER >- binaryIdentifier -> LESS >- binaryIdentifier -> GREATER_EQUAL >- binaryIdentifier -> LESS_EQUAL >- binaryIdentifier -> and >- binaryIdentifier -> or >- binaryIdentifier -> xor >+ binaryKeyword -> and >+ binaryKeyword -> or >+ binaryKeyword -> xor >+ binaryPunctuation -> EQUAL >+ binaryPunctuation -> NOT_EQUAL >+ binaryPunctuation -> PLUS >+ binaryPunctuation -> MULTIPLY >+ binaryPunctuation -> DIVIDE >+ binaryPunctuation -> GREATER >+ binaryPunctuation -> LESS >+ binaryPunctuation -> GREATER_EQUAL >+ binaryPunctuation -> LESS_EQUAL > >- unaryIdentifier -> MINUS >- unaryIdentifier -> not >+ unaryKeyword -> not >+ unaryPunctuation -> MINUS > >+ iterateIdentifier -> iterate >+ > iteratorIdentifier -> forAll > iteratorIdentifier -> exists > iteratorIdentifier -> isUnique >@@ -433,29 +424,27 @@ > iteratorIdentifier -> sortedBy > iteratorIdentifier -> closure > >- keywordAsIdentifier1 -> iterate >- keywordAsIdentifier1 -> iteratorIdentifier >- keywordAsIdentifier1 -> allInstances >- keywordAsIdentifier1 -> body >- keywordAsIdentifier1 -> derive >- keywordAsIdentifier1 -> init >- keywordAsIdentifier1 -> Set >- keywordAsIdentifier1 -> Bag >- keywordAsIdentifier1 -> Sequence >- keywordAsIdentifier1 -> Collection >- keywordAsIdentifier1 -> OrderedSet >- -------- >- keywordAsIdentifier -> keywordAsIdentifier1 >- keywordAsIdentifier -> null >+ reservedKeyword -> binaryKeyword >+ reservedKeyword -> unaryKeyword >+ -- Eliminate these for EssentialOCL >+ reservedKeyword -> body >+ reservedKeyword -> context >+ reservedKeyword -> def >+ reservedKeyword -> derive >+ reservedKeyword -> endpackage >+ reservedKeyword -> init >+ reservedKeyword -> inv >+ reservedKeyword -> package >+ reservedKeyword -> post >+ reservedKeyword -> pre >+ reservedKeyword -> static > >- binaryName -> simpleNameCS >- binaryName ::= binaryIdentifier >- /.$NewCase./ >- keywordAsName ::= keywordAsIdentifier >- /.$NewCase./ >- keywordAsName1 ::= keywordAsIdentifier1 >+ reservedPunctuation -> binaryPunctuation >+ reservedPunctuation -> unaryPunctuation >+ >+ reservedKeywordCS ::= reservedKeyword > /.$NewCase./ >- unaryName ::= unaryIdentifier >+ reservedPunctuationCS ::= reservedPunctuation > /.$BeginJava > SimpleNameCS result = createSimpleNameCS( > SimpleTypeEnum.IDENTIFIER_LITERAL, >@@ -466,11 +455,9 @@ > $EndJava > ./ > >- iterateName ::= iterate >+ iterateNameCS ::= iterateIdentifier > /.$NewCase./ >- iteratorName ::= iteratorIdentifier >- /.$NewCase./ >- oclIsInStateName ::= oclIsInState >+ iteratorNameCS ::= iteratorIdentifier > /.$BeginJava > SimpleNameCS result = createSimpleNameCS( > SimpleTypeEnum.KEYWORD_LITERAL, >@@ -481,12 +468,40 @@ > $EndJava > ./ > >+ literalSimpleNameCS -> booleanLiteralExpCS >+ literalSimpleNameCS -> invalidLiteralExpCS >+ literalSimpleNameCS -> nullLiteralExpCS >+ >+ notIteratorNorReservedSimpleNameCS -> collectionTypeIdentifierCS >+-- notIteratorNorReservedSimpleNameCS -> iterateNameCS >+-- notIteratorNorReservedSimpleNameCS -> iteratorNameCS >+ notIteratorNorReservedSimpleNameCS -> literalSimpleNameCS >+-- notIteratorNorReservedSimpleNameCS -> reservedKeywordCS >+ notIteratorNorReservedSimpleNameCS -> simpleIdentifierCS >+ >+ notLiteralNorReservedSimpleNameCS -> collectionTypeIdentifierCS >+ notLiteralNorReservedSimpleNameCS -> iterateNameCS >+ notLiteralNorReservedSimpleNameCS -> iteratorNameCS >+-- notLiteralNorReservedSimpleNameCS -> literalSimpleNameCS >+-- notLiteralNorReservedSimpleNameCS -> reservedKeywordCS >+ notLiteralNorReservedSimpleNameCS -> simpleIdentifierCS -- IDENTIFIER, self, primitiveTypeCS >+ >+ notReservedSimpleNameCS -> notLiteralNorReservedSimpleNameCS >+ notReservedSimpleNameCS -> literalSimpleNameCS >+ >+ simpleNameCS -> notReservedSimpleNameCS >+ simpleNameCS -> reservedKeywordCS >+ >+ operationOrNotReservedSimpleNameCS -> notReservedSimpleNameCS >+ operationOrNotReservedSimpleNameCS -> reservedKeywordCS >+ operationOrNotReservedSimpleNameCS -> reservedPunctuationCS >+ > -- > -- the 'operationCS' non-terminal is not referenced in this grammar > -- > operationCS -> operationCS1 > operationCS -> operationCS2 >- operationCS1 ::= IDENTIFIER '(' parametersCSopt ')' ':' typeCSopt >+ operationCS1 ::= notReservedSimpleNameCS '(' variableListCSopt ')' ':' typeCSopt > /.$BeginJava > CSTNode result = createOperationCS( > getTokenText($getToken(1)), >@@ -501,42 +516,25 @@ > $setResult(result); > $EndJava > ./ >- operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ')' ':' typeCSopt >+ operationCS2 ::= qualifiedPathNameCS '(' variableListCSopt ')' ':' typeCSopt > /.$BeginJava >+ PathNameCS pathNameCS = (PathNameCS)$getSym(1); >+ TypeCS typeCS = (TypeCS)$getSym(6); > CSTNode result = createOperationCS( >- (PathNameCS)$getSym(1), >- (SimpleNameCS)$getSym(3), >- (EList)$getSym(5), >- (TypeCS)$getSym(8) >+ pathNameCS, >+ removeLastSimpleNameCS(pathNameCS), >+ (EList)$getSym(3), >+ typeCS > ); >- if ($getSym(8) != null) { >- setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(8)); >+ if (typeCS != null) { >+ setOffsets(result, pathNameCS, typeCS); > } else { >- setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(7))); >+ setOffsets(result, pathNameCS, getIToken($getToken(5))); > } > $setResult(result); > $EndJava > ./ > >- >- parametersCSopt ::= $empty >- /.$EmptyListAction./ >- parametersCSopt -> parametersCS >- parametersCS ::= variableCS >- /.$BeginJava >- EList result = new BasicEList(); >- result.add($getSym(1)); >- $setResult(result); >- $EndJava >- ./ >- parametersCS ::= parametersCS ',' variableCS >- /.$BeginJava >- EList result = (EList)$getSym(1); >- result.add($getSym(3)); >- $setResult(result); >- $EndJava >- ./ >- > simpleNameCSopt ::= $empty > /.$NullAction./ > simpleNameCSopt -> simpleNameCS >@@ -583,28 +581,24 @@ > equalityWithLet ::= equalityExpCS '<>' relationalWithLet > /.$NewCase./ > >- relationalExpCS -> ifExpCSPrec >- -- Note that ifExp already embeds let, so we needn't deal with it here >+ relationalExpCS -> additiveExpCS > relationalWithLet -> additiveWithLet >- relationalExpCS ::= relationalExpCS '>' ifExpCSPrec >+ relationalExpCS ::= relationalExpCS '>' additiveExpCS > /.$NewCase./ > relationalWithLet ::= relationalExpCS '>' additiveWithLet > /.$NewCase./ >- relationalExpCS ::= relationalExpCS '<' ifExpCSPrec >+ relationalExpCS ::= relationalExpCS '<' additiveExpCS > /.$NewCase./ > relationalWithLet ::= relationalExpCS '<' additiveWithLet > /.$NewCase./ >- relationalExpCS ::= relationalExpCS '>=' ifExpCSPrec >+ relationalExpCS ::= relationalExpCS '>=' additiveExpCS > /.$NewCase./ > relationalWithLet ::= relationalExpCS '>=' additiveWithLet > /.$NewCase./ >- relationalExpCS ::= relationalExpCS '<=' ifExpCSPrec >+ relationalExpCS ::= relationalExpCS '<=' additiveExpCS > /.$NewCase./ > relationalWithLet ::= relationalExpCS '<=' additiveWithLet > /.$NewCase./ >- >- ifExpCSPrec -> additiveExpCS >- ifExpCSPrec -> ifExpCS > > additiveExpCS -> multiplicativeExpCS > additiveWithLet -> multiplicativeWithLet >@@ -680,22 +674,8 @@ > ./ > > dotArrowExpCS -> oclExpCS >- dotArrowExpCS ::= dotArrowExpCS callExpCS >- /.$BeginJava >- CallExpCS result = (CallExpCS)$getSym(2); >- result.setSource((OCLExpressionCS)$getSym(1)); >- setOffsets(result, (CSTNode)$getSym(1), result); >- $setResult(result); >- $EndJava >- ./ >- dotArrowExpCS ::= dotArrowExpCS messageExpCS >- /.$BeginJava >- MessageExpCS result = (MessageExpCS)$getSym(2); >- result.setTarget((OCLExpressionCS)$getSym(1)); >- setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2)); >- $setResult(result); >- $EndJava >- ./ >+ dotArrowExpCS -> callExpCS >+ dotArrowExpCS -> oclMessageExpCS > dotArrowExpCS ::= NUMERIC_OPERATION '(' argumentsCSopt ')' > /.$BeginJava > // NUMERIC_OPERATION -> Integer '.' Identifier >@@ -739,25 +719,11 @@ > $EndJava > ./ > >- -- static operation call (@pre is not permitted in this context) >- dotArrowExpCS ::= pathNameCS '::' simpleNameCS '(' argumentsCSopt ')' >- /.$BeginJava >- OperationCallExpCS result = createOperationCallExpCS( >- (PathNameCS)$getSym(1), >- (SimpleNameCS)$getSym(3), >- (EList)$getSym(5) >- ); >- setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6))); >- result.setAccessor(DotOrArrowEnum.DOT_LITERAL); >- $setResult(result); >- $EndJava >- ./ >- >- >- oclExpCS -> variableExpCS >+ oclExpCS -> ifExpCS >+ oclExpCS -> associationClassCallExpCS > oclExpCS -> literalExpCS >- oclExpCS -> operationCallExpCS >- oclExpCS -> keywordOperationCallExpCS >+ oclExpCS -> operationCallExpCS_DF >+ oclExpCS -> operationCallExpCS_G > > oclExpCS ::= '(' oclExpressionCS ')' > /.$BeginJava >@@ -770,9 +736,7 @@ > $EndJava > ./ > >- variableExpCS ::= simpleNameCS isMarkedPreCS >- /.$NewCase./ >- variableExpCS ::= keywordAsName1 isMarkedPreCS >+ associationClassCallExpCS ::= notLiteralNorReservedSimpleNameCS isMarkedPreCSopt > /.$BeginJava > IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2); > CSTNode result = createVariableExpCS( >@@ -788,9 +752,7 @@ > $setResult(result); > $EndJava > ./ >- variableExpCS ::= simpleNameCS '[' argumentsCS ']' isMarkedPreCS >- /.$NewCase./ >- variableExpCS ::= keywordAsName1 '[' argumentsCS ']' isMarkedPreCS >+ associationClassCallExpCS ::= notReservedSimpleNameCS '[' argumentsCS ']' isMarkedPreCSopt > /.$BeginJava > IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5); > CSTNode result = createVariableExpCS( >@@ -807,9 +769,8 @@ > $EndJava > ./ > >- >- simpleNameCS -> primitiveTypeCS >- simpleNameCS ::= self >+ simpleIdentifierCS -> primitiveTypeCS >+ simpleIdentifierCS ::= self > /.$BeginJava > CSTNode result = createSimpleNameCS( > SimpleTypeEnum.SELF_LITERAL, >@@ -819,7 +780,6 @@ > $setResult(result); > $EndJava > ./ >- simpleNameCS -> simpleIdentifierCS > simpleIdentifierCS ::= IDENTIFIER > /.$BeginJava > CSTNode result = createSimpleNameCS( >@@ -922,7 +882,7 @@ > $EndJava > ./ > >- pathNameCS ::= simpleIdentifierCS >+ pathNameCS ::= notReservedSimpleNameCS > /.$BeginJava > SimpleNameCS simpleName = (SimpleNameCS)$getSym(1); > PathNameCS result = createPathNameCS(simpleName); >@@ -930,7 +890,7 @@ > $setResult(result); > $EndJava > ./ >- pathNameCS ::= pathNameCS '::' simpleNameCS >+ qualifiedPathNameCS ::= pathNameCS '::' notReservedSimpleNameCS > /.$BeginJava > PathNameCS result = (PathNameCS)$getSym(1); > SimpleNameCS simpleName = (SimpleNameCS)$getSym(3); >@@ -939,14 +899,7 @@ > $setResult(result); > $EndJava > ./ >- >- pathNameCSOpt ::= $empty >- /.$BeginJava >- CSTNode result = createPathNameCS(); >- $setResult(result); >- $EndJava >- ./ >- pathNameCSOpt -> pathNameCS >+ pathNameCS -> qualifiedPathNameCS > > literalExpCS -> enumLiteralExpCS > literalExpCS -> collectionLiteralExpCS >@@ -957,54 +910,79 @@ > > -- also covers the case of static attribute call, in which > -- case @pre is not allowed anyway >- enumLiteralExpCS ::= pathNameCS '::' keywordAsName >- /.$NewCase./ >- enumLiteralExpCS ::= pathNameCS '::' simpleNameCS >+ enumLiteralExpCS ::= qualifiedPathNameCS > /.$BeginJava >+ PathNameCS pathNameCS = (PathNameCS)$getSym(1); >+ SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS); > CSTNode result = createEnumLiteralExpCS( >- (PathNameCS)$getSym(1), >- (SimpleNameCS)$getSym(3) >+ pathNameCS, >+ simpleNameCS > ); >- setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3)); >+ setOffsets(result, pathNameCS, simpleNameCS); > $setResult(result); > $EndJava > ./ > > collectionLiteralExpCS ::= collectionTypeIdentifierCS '{' collectionLiteralPartsCSopt '}' > /.$BeginJava >- Object[] objs = (Object[])$getSym(1); >+ CollectionTypeCS typeCS = (CollectionTypeCS)$getSym(1); > CSTNode result = createCollectionLiteralExpCS( >- (CollectionTypeIdentifierEnum)objs[1], >+ typeCS, > (EList)$getSym(3) > ); >- setOffsets(result, (IToken)objs[0], getIToken($getToken(4))); >+ setOffsets(result, typeCS, getIToken($getToken(4))); > $setResult(result); > $EndJava > ./ > > collectionTypeIdentifierCS ::= Set > /.$BeginJava >- $setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.SET_LITERAL}); >+ SimpleNameCS result = createCollectionTypeCS( >+ CollectionTypeIdentifierEnum.SET_LITERAL, >+ getTokenText($getToken(1)) >+ ); >+ setOffsets(result, getIToken($getToken(1))); >+ $setResult(result); > $EndJava > ./ > collectionTypeIdentifierCS ::= Bag > /.$BeginJava >- $setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.BAG_LITERAL}); >+ SimpleNameCS result = createCollectionTypeCS( >+ CollectionTypeIdentifierEnum.BAG_LITERAL, >+ getTokenText($getToken(1)) >+ ); >+ setOffsets(result, getIToken($getToken(1))); >+ $setResult(result); > $EndJava > ./ > collectionTypeIdentifierCS ::= Sequence > /.$BeginJava >- $setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.SEQUENCE_LITERAL}); >+ SimpleNameCS result = createCollectionTypeCS( >+ CollectionTypeIdentifierEnum.SEQUENCE_LITERAL, >+ getTokenText($getToken(1)) >+ ); >+ setOffsets(result, getIToken($getToken(1))); >+ $setResult(result); > $EndJava > ./ > collectionTypeIdentifierCS ::= Collection > /.$BeginJava >- $setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.COLLECTION_LITERAL}); >+ SimpleNameCS result = createCollectionTypeCS( >+ CollectionTypeIdentifierEnum.COLLECTION_LITERAL, >+ getTokenText($getToken(1)) >+ ); >+ setOffsets(result, getIToken($getToken(1))); >+ $setResult(result); > $EndJava > ./ > collectionTypeIdentifierCS ::= OrderedSet > /.$BeginJava >- $setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL}); >+ SimpleNameCS result = createCollectionTypeCS( >+ CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL, >+ getTokenText($getToken(1)) >+ ); >+ setOffsets(result, getIToken($getToken(1))); >+ $setResult(result); > $EndJava > ./ > >@@ -1147,143 +1125,128 @@ > $EndJava > ./ > >- >- callExpCS ::= '->' featureCallExpCS >- /.$NewCase./ >- callExpCS ::= '->' loopExpCS >- /.$BeginJava >- CallExpCS result = (CallExpCS)$getSym(2); >- result.setAccessor(DotOrArrowEnum.ARROW_LITERAL); >- $setResult(result); >- $EndJava >- ./ >- callExpCS ::= '.' keywordOperationCallExpCS >- /.$NewCase./ >- callExpCS ::= '.' featureCallExpCS >- /.$BeginJava >- CallExpCS result = (CallExpCS)$getSym(2); >- result.setAccessor(DotOrArrowEnum.DOT_LITERAL); >- if (result instanceof OperationCallExpCS) { >- ((OperationCallExpCS)result).setIsAtomic(true); >- } >- $setResult(result); >- $EndJava >- ./ >+ callExpCS -> loopExpCS >+ callExpCS -> propertyCallExpCS >+ callExpCS -> operationCallExpCS_B >+ callExpCS -> operationCallExpCS_CE >+ callExpCS -> operationCallExpCS_IJ > > loopExpCS -> iteratorExpCS > loopExpCS -> iterateExpCS > >- iteratorExpCS ::= iteratorName '(' oclExpressionCS ')' >+ iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' oclExpressionCS ')' > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); > CSTNode result = createIteratorExpCS( >+ source, > simpleNameCS, > null, > null, >- (OCLExpressionCS)$getSym(3) >+ (OCLExpressionCS)$getSym(5) > ); >- setOffsets(result, simpleNameCS, getIToken($getToken(4))); >+ setOffsets(result, source, getIToken($getToken(6))); > $setResult(result); > $EndJava > ./ >- iteratorExpCS ::= iteratorName '(' variableCS '|' oclExpressionCS ')' >+ iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' variableCS '|' oclExpressionCS ')' > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); > CSTNode result = createIteratorExpCS( >+ source, > simpleNameCS, >- (VariableCS)$getSym(3), >+ (VariableCS)$getSym(5), > null, >- (OCLExpressionCS)$getSym(5) >+ (OCLExpressionCS)$getSym(7) > ); >- setOffsets(result, simpleNameCS, getIToken($getToken(6))); >+ setOffsets(result, source, getIToken($getToken(8))); > $setResult(result); > $EndJava > ./ >- iteratorExpCS ::= iteratorName '(' variableCS ',' variableCS '|' oclExpressionCS ')' >+ iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' variableCS ',' variableCS '|' oclExpressionCS ')' > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); > CSTNode result = createIteratorExpCS( >+ source, > simpleNameCS, >- (VariableCS)$getSym(3), > (VariableCS)$getSym(5), >- (OCLExpressionCS)$getSym(7) >+ (VariableCS)$getSym(7), >+ (OCLExpressionCS)$getSym(9) > ); >- setOffsets(result, simpleNameCS, getIToken($getToken(8))); >+ setOffsets(result, source, getIToken($getToken(10))); > $setResult(result); > $EndJava > ./ > >- iterateExpCS ::= iterateName '(' variableCS '|' oclExpressionCS ')' >+ iterateExpCS ::= dotArrowExpCS '->' iterateNameCS '(' variableCS '|' oclExpressionCS ')' > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); > CSTNode result = createIterateExpCS( >+ source, > simpleNameCS, >- (VariableCS)$getSym(3), >+ (VariableCS)$getSym(5), > null, >- (OCLExpressionCS)$getSym(5) >+ (OCLExpressionCS)$getSym(7) > ); >- setOffsets(result, simpleNameCS, getIToken($getToken(6))); >+ setOffsets(result, source, getIToken($getToken(8))); > $setResult(result); > $EndJava > ./ >- iterateExpCS ::= iterateName '(' variableCS ';' variableCS '|' oclExpressionCS ')' >+ iterateExpCS ::= dotArrowExpCS '->' iterateNameCS '(' variableCS ';' variableCS '|' oclExpressionCS ')' > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); > CSTNode result = createIterateExpCS( >+ source, > simpleNameCS, >- (VariableCS)$getSym(3), > (VariableCS)$getSym(5), >- (OCLExpressionCS)$getSym(7) >+ (VariableCS)$getSym(7), >+ (OCLExpressionCS)$getSym(9) > ); >- setOffsets(result, simpleNameCS, getIToken($getToken(8))); >+ setOffsets(result, source, getIToken($getToken(10))); > $setResult(result); > $EndJava > ./ >- >- variableCS ::= IDENTIFIER >+ >+ -- Merging these as notReservedSimpleNameCS gives conflicts; why? LPG bug ?? >+ variableNameCS ::= booleanLiteralExpCS >+ /.$NewCase./ >+ variableNameCS ::= invalidLiteralExpCS >+ /.$NewCase./ >+ variableNameCS ::= nullLiteralExpCS >+ /.$NewCase./ >+ variableNameCS ::= notLiteralNorReservedSimpleNameCS > /.$BeginJava >- CSTNode result = createVariableCS( >- getTokenText($getToken(1)), >- null, >- null >- ); >- setOffsets(result, getIToken($getToken(1))); >+ SimpleNameCS name = (SimpleNameCS)$getSym(1); >+ CSTNode result = createVariableCS(name.getValue()); >+ setOffsets(result, name); > $setResult(result); > $EndJava > ./ >- typedVariableCS ::= IDENTIFIER ':' typeCS >+ typedVariableCS ::= variableNameCS ':' typeCS > /.$BeginJava >- CSTNode result = createVariableCS( >- getTokenText($getToken(1)), >- (TypeCS)$getSym(3), >- null >- ); >- setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3)); >+ VariableCS result = (VariableCS)$getSym(1); >+ TypeCS type = (TypeCS)$getSym(3); >+ result.setTypeCS(type); >+ setOffsets(result, result, type); > $setResult(result); > $EndJava > ./ >+ variableCS -> variableNameCS > variableCS -> typedVariableCS >- variableCS ::= IDENTIFIER ':' typeCS '=' oclExpressionCS >- /.$BeginJava >- CSTNode result = createVariableCS( >- getTokenText($getToken(1)), >- (TypeCS)$getSym(3), >- (OCLExpressionCS)$getSym(5) >- ); >- setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(5)); >- $setResult(result); >- $EndJava >- ./ >- >+ variableCS2 -> variableCS > -- this form of variable declaration is only used in tuple literals >- variableCS2 ::= IDENTIFIER '=' oclExpressionCS >+ variableCS2 ::= variableNameCS '=' oclExpressionCS >+ /.$NewCase./ >+ variableCS ::= typedVariableCS '=' oclExpressionCS > /.$BeginJava >- CSTNode result = createVariableCS( >- getTokenText($getToken(1)), >- null, >- (OCLExpressionCS)$getSym(3) >- ); >- setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3)); >+ VariableCS result = (VariableCS)$getSym(1); >+ OCLExpressionCS initExpression = (OCLExpressionCS)$getSym(3); >+ result.setInitExpression(initExpression); >+ setOffsets(result, result, initExpression); > $setResult(result); > $EndJava > ./ >@@ -1292,22 +1255,26 @@ > /.$NullAction./ > typeCSopt -> typeCS > >- -- the order of these rules is important! Try to match primitives >- -- first, then tuples (more complex), and finally collections. >- -- Looking for type names in the Ecore model is a last resort >- typeCS -> primitiveTypeCS > typeCS -> tupleTypeCS > typeCS -> collectionTypeCS >- typeCS -> pathNameCS >+ typeCS -> qualifiedPathNameCS >+ typeCS ::= notReservedSimpleNameCS -- covers primitiveTypeCS >+ /.$BeginJava >+ CSTNode result = (CSTNode)$getSym(1); >+ if (!(result instanceof TypeCS)) { >+ PathNameCS pathNameCS = createPathNameCS((SimpleNameCS)result); >+ setOffsets(pathNameCS, result); >+ result = pathNameCS; >+ } >+ $setResult(result); >+ $EndJava >+ ./ > > collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ')' > /.$BeginJava >- Object[] objs = (Object[])$getSym(1); >- CSTNode result = createCollectionTypeCS( >- (CollectionTypeIdentifierEnum)objs[1], >- (TypeCS)$getSym(3) >- ); >- setOffsets(result, (IToken)objs[0], getIToken($getToken(4))); >+ CollectionTypeCS result = (CollectionTypeCS)$getSym(1); >+ result.setTypeCS((TypeCS)$getSym(3)); >+ setOffsets(result, result, getIToken($getToken(4))); > $setResult(result); > $EndJava > ./ >@@ -1324,6 +1291,8 @@ > variableListCSopt ::= $empty > /.$EmptyListAction./ > variableListCSopt -> variableListCS >+ variableListCS2 ::= variableCS2 >+ /.$NewCase./ > variableListCS ::= variableCS > /.$BeginJava > EList result = new BasicEList(); >@@ -1331,6 +1300,8 @@ > $setResult(result); > $EndJava > ./ >+ variableListCS2 ::= variableListCS2 ',' variableCS2 >+ /.$NewCase./ > variableListCS ::= variableListCS ',' variableCS > /.$BeginJava > EList result = (EList)$getSym(1); >@@ -1339,42 +1310,38 @@ > $EndJava > ./ > >- -- this form of variable declaration list is only used in tuple literals >- variableListCS2 ::= variableCS2 >- /.$NewCase./ >- variableListCS2 ::= variableCS >+ operationCallExpCS_B ::= dotArrowExpCS '->' notIteratorNorReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')' > /.$BeginJava >- EList result = new BasicEList(); >- result.add($getSym(1)); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CSTNode result = createArrowOperationCallExpCS( >+ source, >+ (SimpleNameCS)$getSym(3), >+ (IsMarkedPreCS)$getSym(4), >+ (EList)$getSym(6) >+ ); >+ setOffsets(result, source, getIToken($getToken(7))); > $setResult(result); > $EndJava > ./ >- variableListCS2 ::= variableListCS2 ',' variableCS2 >- /.$NewCase./ >- variableListCS2 ::= variableListCS2 ',' variableCS >+ operationCallExpCS_CE ::= dotArrowExpCS '.' operationOrNotReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')' > /.$BeginJava >- EList result = (EList)$getSym(1); >- result.add($getSym(3)); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CSTNode result = createDotOperationCallExpCS( >+ source, >+ null, >+ (SimpleNameCS)$getSym(3), >+ (IsMarkedPreCS)$getSym(4), >+ (EList)$getSym(6) >+ ); >+ setOffsets(result, getIToken($getToken(1)), getIToken($getToken(7))); > $setResult(result); > $EndJava > ./ >- >- -- covers attributeCallExpCS and navigationCallExpCS >- featureCallExpCS -> attrOrNavCallExpCS >- >- featureCallExpCS -> operationCallExpCS >- featureCallExpCS ::= unaryName isMarkedPreCS '(' argumentsCSopt ')' >- /.$NewCase./ >- -- even though these operations do not use @pre or do not accept multiple arguments >- -- in order to get better error reporting, the rule signature must comply with >- -- the full rule of an operationCallExpCS >- -- the alternative would be to remove these as keywords, but then the parser >- -- would accept variable declarations where the var can be named "oclIsNew" for example >- operationCallExpCS ::= binaryName isMarkedPreCS '(' argumentsCSopt ')' >- /.$NewCase./ >- keywordOperationCallExpCS ::= keywordAsName isMarkedPreCS '(' argumentsCSopt ')' >+ operationCallExpCS_DF ::= notReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')' > /.$BeginJava >- CSTNode result = createOperationCallExpCS( >+ CSTNode result = createDotOperationCallExpCS( >+ null, >+ null, > (SimpleNameCS)$getSym(1), > (IsMarkedPreCS)$getSym(2), > (EList)$getSym(4) >@@ -1383,70 +1350,79 @@ > $setResult(result); > $EndJava > ./ >- >- stateExpCS ::= pathNameCSOpt >+ operationCallExpCS_G ::= qualifiedPathNameCS '(' argumentsCSopt ')' > /.$BeginJava > PathNameCS pathNameCS = (PathNameCS)$getSym(1); >- StateExpCS result = createStateExpCS(pathNameCS); >- setOffsets(result, pathNameCS); >+ OperationCallExpCS result = createDotOperationCallExpCS( >+ null, >+ pathNameCS, >+ removeLastSimpleNameCS(pathNameCS), >+ null, >+ (EList)$getSym(3) >+ ); >+ setOffsets(result, pathNameCS, getIToken($getToken(4))); > $setResult(result); > $EndJava > ./ >- -- FIXME StateExpCS creates a needless irregularity; unwrap its content as an argument list >- operationCallExpCS ::= oclIsInStateName isMarkedPreCS '(' stateExpCS ')' >+ operationCallExpCS_IJ ::= dotArrowExpCS '.' qualifiedPathNameCS isMarkedPreCSopt '(' argumentsCSopt ')' > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); >- CSTNode result = createOperationCallExpCS( >- simpleNameCS, >- (IsMarkedPreCS)$getSym(2), >- (StateExpCS)$getSym(4) >+ PathNameCS pathNameCS = (PathNameCS)$getSym(3); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CallExpCS result = createDotOperationCallExpCS( >+ source, >+ pathNameCS, >+ removeLastSimpleNameCS(pathNameCS), >+ (IsMarkedPreCS)$getSym(4), >+ (EList)$getSym(6) > ); >- setOffsets(result, simpleNameCS, getIToken($getToken(5))); >+ setOffsets(result, source, getIToken($getToken(7))); > $setResult(result); > $EndJava >- ./ >+ ./ > >- attrOrNavCallExpCS ::= simpleNameCS isMarkedPreCS >- /.$NewCase./ >- attrOrNavCallExpCS ::= keywordAsName isMarkedPreCS >+ propertyCallExpCS ::= dotArrowExpCS '.' notReservedSimpleNameCS isMarkedPreCSopt > /.$BeginJava >- IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(4); > CSTNode result = createFeatureCallExpCS( >- (SimpleNameCS)$getSym(1), >+ source, >+ (SimpleNameCS)$getSym(3), > new BasicEList(), > isMarkedPreCS > ); > if (isMarkedPreCS != null) { >- setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2)); >+ setOffsets(result, source, isMarkedPreCS); > } else { >- setOffsets(result, (CSTNode)$getSym(1)); >+ setOffsets(result, source, (SimpleNameCS)$getSym(3)); > } > $setResult(result); > $EndJava > ./ >- attrOrNavCallExpCS ::= simpleNameCS '[' argumentsCS ']' isMarkedPreCS >+ propertyCallExpCS ::= dotArrowExpCS '.' notReservedSimpleNameCS '[' argumentsCS ']' isMarkedPreCSopt > /.$BeginJava >- IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(7); > CSTNode result = createFeatureCallExpCS( >- (SimpleNameCS)$getSym(1), >- (EList)$getSym(3), >+ source, >+ (SimpleNameCS)$getSym(3), >+ (EList)$getSym(5), > isMarkedPreCS > ); > if (isMarkedPreCS != null) { >- setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(5)); >+ setOffsets(result, source, isMarkedPreCS); > } else { >- setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4))); >+ setOffsets(result, source, getIToken($getToken(6))); > } > $setResult(result); > $EndJava > ./ > >- isMarkedPreCS ::= $empty >+ isMarkedPreCSopt ::= $empty > /.$BeginJava > $setResult(null); > $EndJava > ./ >- isMarkedPreCS ::= '@pre' >+ isMarkedPreCSopt ::= '@pre' > /.$BeginJava > CSTNode result = createIsMarkedPreCS(); > setOffsets(result, getIToken($getToken(1))); >@@ -1496,16 +1472,18 @@ > $EndJava > ./ > >- messageExpCS ::= '^' simpleNameCS '(' oclMessageArgumentsCSopt ')' >+ oclMessageExpCS ::= dotArrowExpCS '^' simpleNameCS '(' oclMessageArgumentsCSopt ')' > /.$NewCase./ >- messageExpCS ::= '^^' simpleNameCS '(' oclMessageArgumentsCSopt ')' >+ oclMessageExpCS ::= dotArrowExpCS '^^' simpleNameCS '(' oclMessageArgumentsCSopt ')' > /.$BeginJava >- CSTNode result = createMessageExpCS( >- getIToken($getToken(1)).getKind() == $sym_type.TK_CARET, >- (SimpleNameCS)$getSym(2), >- (EList<OCLMessageArgCS>)$getSym(4) >+ OCLExpressionCS target = (OCLExpressionCS)$getSym(1); >+ MessageExpCS result = createMessageExpCS( >+ target, >+ getIToken($getToken(2)).getKind() == $sym_type.TK_CARET, >+ (SimpleNameCS)$getSym(3), >+ (EList<OCLMessageArgCS>)$getSym(5) > ); >- setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5))); >+ setOffsets(result, target, getIToken($getToken(6))); > $setResult(result); > $EndJava > ./ >Index: model/OCLCST.genmodel >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/model/OCLCST.genmodel,v >retrieving revision 1.12 >diff -u -r1.12 OCLCST.genmodel >--- model/OCLCST.genmodel 4 Oct 2009 11:17:23 -0000 1.12 >+++ model/OCLCST.genmodel 8 Oct 2009 11:53:20 -0000 >@@ -256,12 +256,8 @@ > <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/BooleanLiteralExpCS"> > <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/BooleanLiteralExpCS/booleanSymbol"/> > </genClasses> >- <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/NullLiteralExpCS"> >- <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/NullLiteralExpCS/symbol"/> >- </genClasses> >- <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/InvalidLiteralExpCS"> >- <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/InvalidLiteralExpCS/symbol"/> >- </genClasses> >+ <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/NullLiteralExpCS"/> >+ <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/InvalidLiteralExpCS"/> > <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/CollectionRangeCS"> > <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true" > createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/CollectionRangeCS/lastExpressionCS"/> >@@ -290,11 +286,9 @@ > createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/FeatureCallExpCS/isMarkedPreCS"/> > </genClasses> > <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OperationCallExpCS"> >- <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/OperationCallExpCS/isAtomic"/> >- </genClasses> >- <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/StateExpCS"> > <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true" >- createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/StateExpCS/simpleNames"/> >+ createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/OperationCallExpCS/pathNameCS"/> >+ <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/OperationCallExpCS/isAtomic"/> > </genClasses> > <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OCLDocumentCS"> > <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true" >Index: model/OCLCST.ecore >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/model/OCLCST.ecore,v >retrieving revision 1.12 >diff -u -r1.12 OCLCST.ecore >--- model/OCLCST.ecore 4 Oct 2009 11:17:23 -0000 1.12 >+++ model/OCLCST.ecore 8 Oct 2009 11:53:20 -0000 >@@ -163,7 +163,7 @@ > <eStructuralFeatures xsi:type="ecore:EReference" name="variables" lowerBound="1" > upperBound="-1" eType="#//cst/VariableCS" containment="true"/> > </eClassifiers> >- <eClassifiers xsi:type="ecore:EClass" name="CollectionTypeCS" eSuperTypes="#//cst/TypeCS"> >+ <eClassifiers xsi:type="ecore:EClass" name="CollectionTypeCS" eSuperTypes="#//cst/SimpleNameCS #//cst/TypeCS"> > <eStructuralFeatures xsi:type="ecore:EAttribute" name="collectionTypeIdentifier" > eType="#//cst/CollectionTypeIdentifierEnum"/> > <eStructuralFeatures xsi:type="ecore:EReference" name="typeCS" eType="#//cst/TypeCS" >@@ -257,15 +257,11 @@ > <eStructuralFeatures xsi:type="ecore:EAttribute" name="unescapedStringSymbol" > eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> > </eClassifiers> >- <eClassifiers xsi:type="ecore:EClass" name="BooleanLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS"> >+ <eClassifiers xsi:type="ecore:EClass" name="BooleanLiteralExpCS" eSuperTypes="#//cst/SimpleNameCS #//cst/PrimitiveLiteralExpCS"> > <eStructuralFeatures xsi:type="ecore:EAttribute" name="booleanSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/> > </eClassifiers> >- <eClassifiers xsi:type="ecore:EClass" name="NullLiteralExpCS" eSuperTypes="#//cst/LiteralExpCS"> >- <eStructuralFeatures xsi:type="ecore:EAttribute" name="symbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> >- </eClassifiers> >- <eClassifiers xsi:type="ecore:EClass" name="InvalidLiteralExpCS" eSuperTypes="#//cst/LiteralExpCS"> >- <eStructuralFeatures xsi:type="ecore:EAttribute" name="symbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> >- </eClassifiers> >+ <eClassifiers xsi:type="ecore:EClass" name="NullLiteralExpCS" eSuperTypes="#//cst/SimpleNameCS #//cst/LiteralExpCS"/> >+ <eClassifiers xsi:type="ecore:EClass" name="InvalidLiteralExpCS" eSuperTypes="#//cst/SimpleNameCS #//cst/LiteralExpCS"/> > <eClassifiers xsi:type="ecore:EClass" name="CollectionRangeCS" eSuperTypes="#//cst/CollectionLiteralPartCS"> > <eStructuralFeatures xsi:type="ecore:EReference" name="lastExpressionCS" eType="#//cst/OCLExpressionCS" > containment="true"> >@@ -303,13 +299,11 @@ > containment="true"/> > </eClassifiers> > <eClassifiers xsi:type="ecore:EClass" name="OperationCallExpCS" eSuperTypes="#//cst/FeatureCallExpCS"> >+ <eStructuralFeatures xsi:type="ecore:EReference" name="pathNameCS" eType="#//cst/PathNameCS" >+ containment="true"/> > <eStructuralFeatures xsi:type="ecore:EAttribute" name="isAtomic" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject" > defaultValueLiteral="false"/> > </eClassifiers> >- <eClassifiers xsi:type="ecore:EClass" name="StateExpCS" eSuperTypes="#//cst/TypeCS"> >- <eStructuralFeatures xsi:type="ecore:EReference" name="simpleNames" upperBound="-1" >- eType="#//cst/SimpleNameCS" containment="true"/> >- </eClassifiers> > <eClassifiers xsi:type="ecore:EClass" name="OCLDocumentCS" eSuperTypes="#//cst/CSTNode"> > <eStructuralFeatures xsi:type="ecore:EReference" name="packageDeclarations" > ordered="false" upperBound="-1" eType="#//cst/PackageDeclarationCS" containment="true"/> >Index: model/OCLCST.uml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/model/OCLCST.uml,v >retrieving revision 1.9 >diff -u -r1.9 OCLCST.uml >--- model/OCLCST.uml 4 Oct 2009 11:17:23 -0000 1.9 >+++ model/OCLCST.uml 8 Oct 2009 11:53:21 -0000 >@@ -2,6 +2,7 @@ > <xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Ecore="http://www.eclipse.org/uml2/schemas/Ecore/4" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Ecore/4 pathmap://UML_PROFILES/Ecore.profile.uml#_B7dOIMEREduRdatXodjBjA"> > <uml:Model xmi:id="_qdx8sQ8fEduhWtVvKtiQ7w" name="ocl"> > <packagedElement xmi:type="uml:Package" xmi:id="_qdx8sP8fEduhWtVvKtiQ7w" name="cst"> >+ <elementImport xmi:id="_5DyD0LD5Ed6LkdYdYK9_JA"/> > <packageImport xmi:id="_CSYeEI2GEd2mlKUM3HGxZg"> > <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#_0"/> > </packageImport> >@@ -353,6 +354,7 @@ > <ownedEnd xmi:id="_qdx9lP8fEduhWtVvKtiQ7w" type="_qdx9j_8fEduhWtVvKtiQ7w" association="_qdx9k_8fEduhWtVvKtiQ7w"/> > </packagedElement> > <packagedElement xmi:type="uml:Class" xmi:id="_qdx9lf8fEduhWtVvKtiQ7w" name="CollectionTypeCS"> >+ <generalization xmi:id="_2NUGIJw2Ed6az7Hq7e93gA" general="_qdx83P8fEduhWtVvKtiQ7w"/> > <generalization xmi:id="_qdx9lv8fEduhWtVvKtiQ7w" general="_qdx8xP8fEduhWtVvKtiQ7w"/> > <ownedAttribute xmi:id="_qdx9l_8fEduhWtVvKtiQ7w" name="collectionTypeIdentifier" visibility="public" type="_qdx9m_8fEduhWtVvKtiQ7w" isOrdered="true"> > <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx9mP8fEduhWtVvKtiQ7w"/> >@@ -549,6 +551,7 @@ > </ownedAttribute> > </packagedElement> > <packagedElement xmi:type="uml:Class" xmi:id="_qdx-E_8fEduhWtVvKtiQ7w" name="BooleanLiteralExpCS"> >+ <generalization xmi:id="_HVRk0LKtEd6RC43VVMBX9w" general="_qdx83P8fEduhWtVvKtiQ7w"/> > <generalization xmi:id="_qdx-FP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/> > <ownedAttribute xmi:id="_qdx-Ff8fEduhWtVvKtiQ7w" name="booleanSymbol" visibility="public" isOrdered="true"> > <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EBooleanObject"/> >@@ -556,18 +559,12 @@ > </ownedAttribute> > </packagedElement> > <packagedElement xmi:type="uml:Class" xmi:id="_qdx-F_8fEduhWtVvKtiQ7w" name="NullLiteralExpCS"> >+ <generalization xmi:id="_GYa7ALKtEd6RC43VVMBX9w" general="_qdx83P8fEduhWtVvKtiQ7w"/> > <generalization xmi:id="_qdx-GP8fEduhWtVvKtiQ7w" general="_qdx93f8fEduhWtVvKtiQ7w"/> >- <ownedAttribute xmi:id="_qdx-Gf8fEduhWtVvKtiQ7w" name="symbol" visibility="public" isOrdered="true"> >- <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EString"/> >- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Gv8fEduhWtVvKtiQ7w"/> >- </ownedAttribute> > </packagedElement> > <packagedElement xmi:type="uml:Class" xmi:id="_qdx-G_8fEduhWtVvKtiQ7w" name="InvalidLiteralExpCS"> >+ <generalization xmi:id="_9073ALKsEd6RC43VVMBX9w" general="_qdx83P8fEduhWtVvKtiQ7w"/> > <generalization xmi:id="_qdx-HP8fEduhWtVvKtiQ7w" general="_qdx93f8fEduhWtVvKtiQ7w"/> >- <ownedAttribute xmi:id="_qdx-Hf8fEduhWtVvKtiQ7w" name="symbol" visibility="public" isOrdered="true"> >- <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EString"/> >- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Hv8fEduhWtVvKtiQ7w"/> >- </ownedAttribute> > </packagedElement> > <packagedElement xmi:type="uml:Class" xmi:id="_qdx-H_8fEduhWtVvKtiQ7w" name="CollectionRangeCS"> > <generalization xmi:id="_qdx-IP8fEduhWtVvKtiQ7w" general="_qdx98P8fEduhWtVvKtiQ7w"/> >@@ -652,17 +649,13 @@ > </packagedElement> > <packagedElement xmi:type="uml:Class" xmi:id="_qdx-Vf8fEduhWtVvKtiQ7w" name="OperationCallExpCS"> > <generalization xmi:id="_qdx-Vv8fEduhWtVvKtiQ7w" general="_qdx-Sv8fEduhWtVvKtiQ7w"/> >- <ownedAttribute xmi:id="_306UMJXiEd6Wx-S3aeq4Aw" name="isAtomic" visibility="public" isOrdered="true"> >- <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EBooleanObject"/> >- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_306UMZXiEd6Wx-S3aeq4Aw"/> >- <defaultValue xmi:type="uml:LiteralString" xmi:id="_8lGFsJXiEd6Wx-S3aeq4Aw" value="false"/> >+ <ownedAttribute xmi:id="_uREjQJrAEd6qQcRgrpdjbQ" name="pathNameCS" type="_qdx8v_8fEduhWtVvKtiQ7w" isOrdered="true" aggregation="composite"> >+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_uREjQZrAEd6qQcRgrpdjbQ"/> > </ownedAttribute> >- </packagedElement> >- <packagedElement xmi:type="uml:Class" xmi:id="_qdx-V_8fEduhWtVvKtiQ7w" name="StateExpCS"> >- <generalization xmi:id="_qdx-WP8fEduhWtVvKtiQ7w" general="_qdx8xP8fEduhWtVvKtiQ7w"/> >- <ownedAttribute xmi:id="_pS7AEJPiEd6yA_hAShwLtA" name="simpleNames" type="_qdx83P8fEduhWtVvKtiQ7w" isOrdered="true" aggregation="composite"> >- <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_pS7AEZPiEd6yA_hAShwLtA" value="*"/> >- <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_pS7AEpPiEd6yA_hAShwLtA"/> >+ <ownedAttribute xmi:id="_z9V7sLI8Ed6kyPEWd5jeqw" name="isAtomic" visibility="public" isOrdered="true"> >+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EBooleanObject"/> >+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_z9V7sbI8Ed6kyPEWd5jeqw"/> >+ <defaultValue xmi:type="uml:LiteralString" xmi:id="_3WtEMLI8Ed6kyPEWd5jeqw" value="false"/> > </ownedAttribute> > </packagedElement> > <packagedElement xmi:type="uml:PrimitiveType" xmi:id="_tvVQwI2FEd2mlKUM3HGxZg" name="IToken"/> >@@ -839,9 +832,9 @@ > <Ecore:EClass xmi:id="_qfsogP8fEduhWtVvKtiQ7w" base_Class="_qdx-E_8fEduhWtVvKtiQ7w"/> > <Ecore:EAttribute xmi:id="_qfsogf8fEduhWtVvKtiQ7w" base_Property="_qdx-Ff8fEduhWtVvKtiQ7w"/> > <Ecore:EClass xmi:id="_qfsogv8fEduhWtVvKtiQ7w" base_Class="_qdx-F_8fEduhWtVvKtiQ7w"/> >- <Ecore:EAttribute xmi:id="_qfsog_8fEduhWtVvKtiQ7w" base_Property="_qdx-Gf8fEduhWtVvKtiQ7w"/> >+ <Ecore:EAttribute xmi:id="_qfsog_8fEduhWtVvKtiQ7w"/> > <Ecore:EClass xmi:id="_qfsohP8fEduhWtVvKtiQ7w" base_Class="_qdx-G_8fEduhWtVvKtiQ7w"/> >- <Ecore:EAttribute xmi:id="_qfsohf8fEduhWtVvKtiQ7w" base_Property="_qdx-Hf8fEduhWtVvKtiQ7w"/> >+ <Ecore:EAttribute xmi:id="_qfsohf8fEduhWtVvKtiQ7w"/> > <Ecore:EClass xmi:id="_qfsohv8fEduhWtVvKtiQ7w" base_Class="_qdx-H_8fEduhWtVvKtiQ7w"/> > <Ecore:EReference xmi:id="_qfsoh_8fEduhWtVvKtiQ7w" xmlName="lastOclExpressionCS" base_Property="_qdx-If8fEduhWtVvKtiQ7w"/> > <Ecore:EClass xmi:id="_qfsoiP8fEduhWtVvKtiQ7w" base_Class="_qdx-Jf8fEduhWtVvKtiQ7w"/> >@@ -862,7 +855,7 @@ > <Ecore:EReference xmi:id="_qf-8Jf8fEduhWtVvKtiQ7w" base_Property="_qdx-TP8fEduhWtVvKtiQ7w"/> > <Ecore:EReference xmi:id="_qf-8Jv8fEduhWtVvKtiQ7w" base_Property="_qdx-T_8fEduhWtVvKtiQ7w"/> > <Ecore:EClass xmi:id="_qf-8J_8fEduhWtVvKtiQ7w" base_Class="_qdx-Vf8fEduhWtVvKtiQ7w"/> >- <Ecore:EClass xmi:id="_qf-8KP8fEduhWtVvKtiQ7w" base_Class="_qdx-V_8fEduhWtVvKtiQ7w"/> >+ <Ecore:EClass xmi:id="_qf-8KP8fEduhWtVvKtiQ7w"/> > <Ecore:EAttribute xmi:id="_qf-8Kf8fEduhWtVvKtiQ7w"/> > <Ecore:EDataType xmi:id="_wn-44I2FEd2mlKUM3HGxZg" instanceClassName="lpg.lpgjavaruntime.IToken" base_PrimitiveType="_tvVQwI2FEd2mlKUM3HGxZg"/> > <Ecore:EAttribute xmi:id="_qkehgI2JEd2mlKUM3HGxZg" isTransient="true" base_Property="_PkTnII2GEd2mlKUM3HGxZg"/> >Index: src/org/eclipse/ocl/parser/backtracking/OCLParserErrors.g >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/backtracking/OCLParserErrors.g,v >retrieving revision 1.2 >diff -u -r1.2 OCLParserErrors.g >--- src/org/eclipse/ocl/parser/backtracking/OCLParserErrors.g 4 Sep 2009 13:40:44 -0000 1.2 >+++ src/org/eclipse/ocl/parser/backtracking/OCLParserErrors.g 8 Oct 2009 11:53:27 -0000 >@@ -55,11 +55,7 @@ > ./ > defExpressionCS ::= IDENTIFIER ERROR_Colon > /.$BeginJava >- VariableCS variableCS = createVariableCS( >- getTokenText($getToken(1)), >- null, >- null >- ); >+ VariableCS variableCS = createVariableCS(getTokenText($getToken(1))); > setOffsets(variableCS, getIToken($getToken(1)), getIToken($getToken(2))); > CSTNode result = createDefExpressionCS( > variableCS, >Index: src/org/eclipse/ocl/parser/backtracking/EssentialOCLErrors.g >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/backtracking/EssentialOCLErrors.g,v >retrieving revision 1.2 >diff -u -r1.2 EssentialOCLErrors.g >--- src/org/eclipse/ocl/parser/backtracking/EssentialOCLErrors.g 4 Sep 2009 13:40:44 -0000 1.2 >+++ src/org/eclipse/ocl/parser/backtracking/EssentialOCLErrors.g 8 Oct 2009 11:53:27 -0000 >@@ -57,10 +57,10 @@ > $EndJava > ./ > >- attrOrNavCallExpCS ::= simpleNameCS '[' argumentsCS ERROR_TOKEN >+ associationClassCallExpCS ::= notReservedSimpleNameCS '[' argumentsCS ERROR_TOKEN > /.$BeginJava > reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RBRACK); >- CSTNode result = createFeatureCallExpCS( >+ CSTNode result = createVariableExpCS( > (SimpleNameCS)$getSym(1), > (EList)$getSym(3), > null >@@ -69,45 +69,47 @@ > $setResult(result); > $EndJava > ./ >- >- collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ERROR_TOKEN >+ propertyCallExpCS ::= dotArrowExpCS '.' notReservedSimpleNameCS '[' argumentsCS ERROR_TOKEN > /.$BeginJava >- reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN); >- Object[] objs = (Object[])$getSym(1); >- CSTNode result = createCollectionTypeCS( >- (CollectionTypeIdentifierEnum)objs[1], >- (TypeCS)$getSym(3) >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CallExpCS result = createFeatureCallExpCS( >+ source, >+ (SimpleNameCS)$getSym(3), >+ (EList)$getSym(5), >+ null > ); >- setOffsets(result, (IToken)objs[0], getIToken($getToken(4))); >+ setOffsets(result, source, getIToken($getToken(6))); > $setResult(result); > $EndJava > ./ >- collectionTypeCS ::= collectionTypeIdentifierCS ERROR_TOKEN >+ propertyCallExpCS ::= dotArrowExpCS '.' ERROR_SimpleNameCS '[' argumentsCS ']' isMarkedPreCSopt > /.$BeginJava >- reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN); >- Object[] objs = (Object[])$getSym(1); >- CSTNode result = createCollectionTypeCS( >- (CollectionTypeIdentifierEnum)objs[1], >- null >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(7); >+ CallExpCS result = createFeatureCallExpCS( >+ source, >+ (SimpleNameCS)$getSym(3), >+ (EList)$getSym(5), >+ isMarkedPreCS > ); >- setOffsets(result, (IToken)objs[0], getIToken($getToken(2))); >+ if (isMarkedPreCS != null) { >+ setOffsets(result, source, isMarkedPreCS); >+ } else { >+ setOffsets(result, source, getIToken($getToken(6))); >+ } > $setResult(result); > $EndJava > ./ >- >- dotArrowExpCS ::= pathNameCS '::' ERROR_SimpleNameCS '(' argumentsCSopt ')' >+ >+ collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ERROR_TOKEN > /.$BeginJava >- OperationCallExpCS result = createOperationCallExpCS( >- (PathNameCS)$getSym(1), >- (SimpleNameCS)$getSym(3), >- (EList)$getSym(5) >- ); >- setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6))); >- result.setAccessor(DotOrArrowEnum.DOT_LITERAL); >+ reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN); >+ CollectionTypeCS result = (CollectionTypeCS)dtParser.getSym(1); >+ result.setTypeCS((TypeCS)dtParser.getSym(3)); >+ setOffsets(result, result, getIToken($getToken(4))); > $setResult(result); > $EndJava > ./ >--- FIXME dotArrowExpCS ::= NUMERIC_OPERATION ERROR_SimpleNameCS > > enumLiteralExpCS ::= pathNameCS '::' ERROR_SimpleNameCS > /.$BeginJava >@@ -122,34 +124,106 @@ > $EndJava > ./ > >- featureCallExpCS ::= unaryName ERROR_IsMarkedPreCS '(' argumentsCSopt ')' >- /.$NewCase./ >- keywordOperationCallExpCS ::= keywordAsName ERROR_IsMarkedPreCS '(' argumentsCSopt ')' >- /.$NewCase./ >- operationCallExpCS ::= binaryName ERROR_IsMarkedPreCS '(' argumentsCSopt ')' >+ operationCallExpCS_B ::= dotArrowExpCS '->' ERROR_SimpleNameCS '(' argumentsCSopt ')' > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); >- CSTNode result = createOperationCallExpCS( >- simpleNameCS, >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CallExpCS result = createArrowOperationCallExpCS( >+ source, >+ (SimpleNameCS)$getSym(3), >+ (IsMarkedPreCS)null, >+ (EList)$getSym(5) >+ ); >+ setOffsets(result, source, getIToken($getToken(6))); >+ $setResult(result); >+ $EndJava >+ ./ >+ >+ operationCallExpCS_CE ::= dotArrowExpCS '.' ERROR_SimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')' >+ /.$BeginJava >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CallExpCS result = createDotOperationCallExpCS( >+ source, >+ null, >+ (SimpleNameCS)$getSym(3), >+ (IsMarkedPreCS)$getSym(4), >+ (EList)$getSym(6) >+ ); >+ setOffsets(result, source, getIToken($getToken(7))); >+ $setResult(result); >+ $EndJava >+ ./ >+ operationCallExpCS_CE ::= dotArrowExpCS '.' operationOrNotReservedSimpleNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')' >+ /.$BeginJava >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CallExpCS result = createDotOperationCallExpCS( >+ source, >+ null, >+ (SimpleNameCS)$getSym(3), >+ (IsMarkedPreCS)$getSym(4), >+ (EList)$getSym(6) >+ ); >+ setOffsets(result, source, getIToken($getToken(7))); >+ $setResult(result); >+ $EndJava >+ ./ >+ >+ operationCallExpCS_DF ::= notReservedSimpleNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')' >+ /.$BeginJava >+ CSTNode result = createDotOperationCallExpCS( >+ null, >+ null, >+ (SimpleNameCS)$getSym(1), > (IsMarkedPreCS)$getSym(2), > (EList)$getSym(4) > ); >- setOffsets(result, simpleNameCS, getIToken($getToken(5))); >+ setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5))); > $setResult(result); > $EndJava > ./ >- operationCallExpCS ::= oclIsInStateName ERROR_IsMarkedPreCS '(' stateExpCS ')' >+ >+ operationCallExpCS_G ::= pathNameCS '::' ERROR_SimpleNameCS '(' argumentsCSopt ')' > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1); >- CSTNode result = createOperationCallExpCS( >- simpleNameCS, >- (IsMarkedPreCS)$getSym(2), >- (StateExpCS)$getSym(4) >+ OperationCallExpCS result = createDotOperationCallExpCS( >+ null, >+ (PathNameCS)$getSym(1), >+ (SimpleNameCS)$getSym(3), >+ null, >+ (EList)$getSym(5) > ); >- setOffsets(result, simpleNameCS, getIToken($getToken(5))); >+ setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6))); > $setResult(result); > $EndJava > ./ >+ >+ operationCallExpCS_IJ ::= dotArrowExpCS '.' qualifiedPathNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')' >+ /.$BeginJava >+ PathNameCS pathName = (PathNameCS)$getSym(3); >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CallExpCS result = createDotOperationCallExpCS( >+ source, >+ pathName, >+ removeLastSimpleNameCS(pathName), >+ (IsMarkedPreCS)$getSym(4), >+ (EList)$getSym(6) >+ ); >+ setOffsets(result, source, getIToken($getToken(7))); >+ $setResult(result); >+ $EndJava >+ ./ >+ operationCallExpCS_IJ ::= dotArrowExpCS '.' pathNameCS '::' ERROR_SimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')' >+ /.$BeginJava >+ OCLExpressionCS source = (OCLExpressionCS)$getSym(1); >+ CallExpCS result = createDotOperationCallExpCS( >+ source, >+ (PathNameCS)$getSym(3), >+ (SimpleNameCS)$getSym(5), >+ (IsMarkedPreCS)$getSym(6), >+ (EList)$getSym(8) >+ ); >+ setOffsets(result, source, getIToken($getToken(9))); >+ $setResult(result); >+ $EndJava >+ ./ > > ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS ERROR_TOKEN > /.$BeginJava >@@ -200,31 +274,35 @@ > $EndJava > ./ > >- messageExpCS ::= '^' simpleNameCS ERROR_TOKEN >+ oclMessageExpCS ::= dotArrowExpCS '^' simpleNameCS ERROR_TOKEN > /.$NewCase./ >- messageExpCS ::= '^^' simpleNameCS ERROR_TOKEN >+ oclMessageExpCS ::= dotArrowExpCS '^^' simpleNameCS ERROR_TOKEN > /.$BeginJava >- reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS); >- CSTNode result = createMessageExpCS( >- getIToken($getToken(1)).getKind() == $sym_type.TK_CARET, >- (SimpleNameCS)$getSym(2), >+ reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS); >+ OCLExpressionCS target = (OCLExpressionCS)$getSym(1); >+ MessageExpCS result = createMessageExpCS( >+ target, >+ getIToken($getToken(2)).getKind() == $sym_type.TK_CARET, >+ (SimpleNameCS)$getSym(3), > new BasicEList<OCLMessageArgCS>() > ); >- setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3))); >+ setOffsets(result, target, getIToken($getToken(4))); > $setResult(result); > $EndJava > ./ >- messageExpCS ::= '^' ERROR_SimpleNameCS >+ oclMessageExpCS ::= dotArrowExpCS '^' ERROR_SimpleNameCS > /.$NewCase./ >- messageExpCS ::= '^^' ERROR_SimpleNameCS >+ oclMessageExpCS ::= dotArrowExpCS '^^' ERROR_SimpleNameCS > /.$BeginJava >- SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(2); >- CSTNode result = createMessageExpCS( >- getIToken($getToken(1)).getKind() == $sym_type.TK_CARET, >+ SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3); >+ OCLExpressionCS target = (OCLExpressionCS)$getSym(1); >+ MessageExpCS result = createMessageExpCS( >+ target, >+ getIToken($getToken(2)).getKind() == $sym_type.TK_CARET, > simpleNameCS, > new BasicEList<OCLMessageArgCS>() > ); >- setOffsets(result, getIToken($getToken(1)), simpleNameCS); >+ setOffsets(result, target, simpleNameCS); > $setResult(result); > $EndJava > ./ >@@ -246,7 +324,7 @@ > $EndJava > ./ > >- operationCS1 ::= IDENTIFIER '(' parametersCSopt ')' ERROR_Colon >+ operationCS1 ::= notReservedSimpleNameCS '(' variableListCSopt ')' ERROR_Colon > /.$BeginJava > CSTNode result = createOperationCS( > getTokenText($getToken(1)), >@@ -257,7 +335,7 @@ > $setResult(result); > $EndJava > ./ >- operationCS1 ::= IDENTIFIER '(' parametersCSopt ERROR_TOKEN >+ operationCS1 ::= notReservedSimpleNameCS '(' variableListCSopt ERROR_TOKEN > /.$BeginJava > reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN); > CSTNode result = createOperationCS( >@@ -269,7 +347,7 @@ > $setResult(result); > $EndJava > ./ >- operationCS1 ::= IDENTIFIER ERROR_TOKEN >+ operationCS1 ::= notReservedSimpleNameCS ERROR_TOKEN > /.$BeginJava > reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN); > CSTNode result = createOperationCS( >@@ -293,44 +371,44 @@ > $setResult(result); > $EndJava > ./ >- operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ')' ERROR_Colon >+ operationCS2 ::= qualifiedPathNameCS '(' variableListCSopt ')' ERROR_Colon > /.$BeginJava > PathNameCS pathNameCS = (PathNameCS)$getSym(1); > CSTNode result = createOperationCS( > pathNameCS, >- (SimpleNameCS)$getSym(3), >- (EList)$getSym(5), >- (TypeCS)$getSym(8) >+ removeLastSimpleNameCS(pathNameCS), >+ (EList)$getSym(3), >+ null > ); >- setOffsets(result, pathNameCS, getIToken($getToken(7))); >+ setOffsets(result, pathNameCS, getIToken($getToken(5))); > $setResult(result); > $EndJava > ./ >- operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ERROR_TOKEN >+ operationCS2 ::= qualifiedPathNameCS '(' variableListCSopt ERROR_TOKEN > /.$BeginJava > reportErrorTokenMessage($getToken(6), OCLParserErrors.MISSING_RPAREN); > PathNameCS pathNameCS = (PathNameCS)$getSym(1); > CSTNode result = createOperationCS( > pathNameCS, >- (SimpleNameCS)$getSym(3), >- (EList)$getSym(5), >+ removeLastSimpleNameCS(pathNameCS), >+ (EList)$getSym(3), > null > ); >- setOffsets(result, pathNameCS, getIToken($getToken(7))); >+ setOffsets(result, pathNameCS, getIToken($getToken(4))); > $setResult(result); > $EndJava > ./ >- operationCS2 ::= pathNameCS '::' simpleNameCS ERROR_TOKEN >+ operationCS2 ::= qualifiedPathNameCS ERROR_TOKEN > /.$BeginJava > reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_LPAREN); > PathNameCS pathNameCS = (PathNameCS)$getSym(1); > CSTNode result = createOperationCS( > pathNameCS, >- (SimpleNameCS)$getSym(3), >+ removeLastSimpleNameCS(pathNameCS), > new BasicEList(), > null > ); >- setOffsets(result, pathNameCS, getIToken($getToken(4))); >+ setOffsets(result, pathNameCS, getIToken($getToken(2))); > $setResult(result); > $EndJava > ./ >@@ -375,33 +453,15 @@ > $EndJava > ./ > >- variableCS ::= IDENTIFIER ERROR_TOKEN >- /.$BeginJava >- reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE); >- CSTNode result = createVariableCS( >- getTokenText($getToken(1)), >- null, >- null >- ); >- setOffsets(result, getIToken($getToken(1)), getIToken($getToken(2))); >- $setResult(result); >- $EndJava >- ./ >- >- variableExpCS ::= simpleNameCS '[' argumentsCS ERROR_TOKEN >- /.$NewCase./ >- variableExpCS ::= keywordAsName1 '[' argumentsCS ERROR_TOKEN >- /.$BeginJava >- reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RBRACK); >- CSTNode result = createVariableExpCS( >- (SimpleNameCS)$getSym(1), >- (EList)$getSym(3), >- null >- ); >- setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4))); >- $setResult(result); >- $EndJava >- ./ >+-- variableCS ::= notLiteralNorReservedSimpleNameCS ERROR_TOKEN >+-- /.$BeginJava >+-- reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE); >+-- SimpleNameCS name = (SimpleNameCS)$getSym(1); >+-- CSTNode result = createVariableCS(name.getValue()); >+-- setOffsets(result, getIToken($getToken(1)), getIToken($getToken(2))); >+-- $setResult(result); >+-- $EndJava >+-- ./ > > variableListCS ::= ERROR_TOKEN > /.$NewCase./ >Index: src/org/eclipse/ocl/cst/util/CSTAdapterFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/util/CSTAdapterFactory.java,v >retrieving revision 1.7 >diff -u -r1.7 CSTAdapterFactory.java >--- src/org/eclipse/ocl/cst/util/CSTAdapterFactory.java 4 Sep 2009 13:40:44 -0000 1.7 >+++ src/org/eclipse/ocl/cst/util/CSTAdapterFactory.java 8 Oct 2009 11:53:24 -0000 >@@ -67,7 +67,6 @@ > import org.eclipse.ocl.cst.PropertyContextCS; > import org.eclipse.ocl.cst.RealLiteralExpCS; > import org.eclipse.ocl.cst.SimpleNameCS; >-import org.eclipse.ocl.cst.StateExpCS; > import org.eclipse.ocl.cst.StringLiteralExpCS; > import org.eclipse.ocl.cst.TupleLiteralExpCS; > import org.eclipse.ocl.cst.TupleTypeCS; >@@ -383,11 +382,6 @@ > } > > @Override >- public Adapter caseStateExpCS(StateExpCS object) { >- return createStateExpCSAdapter(); >- } >- >- @Override > public Adapter caseOCLDocumentCS(OCLDocumentCS object) { > return createOCLDocumentCSAdapter(); > } >@@ -1014,20 +1008,6 @@ > } > > /** >- * Creates a new adapter for an object of class '{@link org.eclipse.ocl.cst.StateExpCS <em>State Exp CS</em>}'. >- * <!-- begin-user-doc --> >- * This default implementation returns null so that we can easily ignore cases; >- * it's useful to ignore a case when inheritance will catch all the cases anyway. >- * <!-- end-user-doc --> >- * @return the new adapter. >- * @see org.eclipse.ocl.cst.StateExpCS >- * @generated >- */ >- public Adapter createStateExpCSAdapter() { >- return null; >- } >- >- /** > * Creates a new adapter for an object of class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'. > * <!-- begin-user-doc --> > * This default implementation returns null so that we can easily ignore cases; >Index: src/org/eclipse/ocl/cst/util/CSTSwitch.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/cst/util/CSTSwitch.java,v >retrieving revision 1.6 >diff -u -r1.6 CSTSwitch.java >--- src/org/eclipse/ocl/cst/util/CSTSwitch.java 4 Sep 2009 13:40:44 -0000 1.6 >+++ src/org/eclipse/ocl/cst/util/CSTSwitch.java 8 Oct 2009 11:53:25 -0000 >@@ -67,7 +67,6 @@ > import org.eclipse.ocl.cst.PropertyContextCS; > import org.eclipse.ocl.cst.RealLiteralExpCS; > import org.eclipse.ocl.cst.SimpleNameCS; >-import org.eclipse.ocl.cst.StateExpCS; > import org.eclipse.ocl.cst.StringLiteralExpCS; > import org.eclipse.ocl.cst.TupleLiteralExpCS; > import org.eclipse.ocl.cst.TupleTypeCS; >@@ -401,6 +400,8 @@ > CollectionTypeCS collectionTypeCS = (CollectionTypeCS) theEObject; > T result = caseCollectionTypeCS(collectionTypeCS); > if (result == null) >+ result = caseSimpleNameCS(collectionTypeCS); >+ if (result == null) > result = caseTypeCS(collectionTypeCS); > if (result == null) > result = caseOCLExpressionCS(collectionTypeCS); >@@ -588,6 +589,8 @@ > BooleanLiteralExpCS booleanLiteralExpCS = (BooleanLiteralExpCS) theEObject; > T result = caseBooleanLiteralExpCS(booleanLiteralExpCS); > if (result == null) >+ result = caseSimpleNameCS(booleanLiteralExpCS); >+ if (result == null) > result = casePrimitiveLiteralExpCS(booleanLiteralExpCS); > if (result == null) > result = caseLiteralExpCS(booleanLiteralExpCS); >@@ -603,6 +606,8 @@ > NullLiteralExpCS nullLiteralExpCS = (NullLiteralExpCS) theEObject; > T result = caseNullLiteralExpCS(nullLiteralExpCS); > if (result == null) >+ result = caseSimpleNameCS(nullLiteralExpCS); >+ if (result == null) > result = caseLiteralExpCS(nullLiteralExpCS); > if (result == null) > result = caseOCLExpressionCS(nullLiteralExpCS); >@@ -616,6 +621,8 @@ > InvalidLiteralExpCS invalidLiteralExpCS = (InvalidLiteralExpCS) theEObject; > T result = caseInvalidLiteralExpCS(invalidLiteralExpCS); > if (result == null) >+ result = caseSimpleNameCS(invalidLiteralExpCS); >+ if (result == null) > result = caseLiteralExpCS(invalidLiteralExpCS); > if (result == null) > result = caseOCLExpressionCS(invalidLiteralExpCS); >@@ -718,19 +725,6 @@ > result = defaultCase(theEObject); > return result; > } >- case CSTPackage.STATE_EXP_CS : { >- StateExpCS stateExpCS = (StateExpCS) theEObject; >- T result = caseStateExpCS(stateExpCS); >- if (result == null) >- result = caseTypeCS(stateExpCS); >- if (result == null) >- result = caseOCLExpressionCS(stateExpCS); >- if (result == null) >- result = caseCSTNode(stateExpCS); >- if (result == null) >- result = defaultCase(theEObject); >- return result; >- } > case CSTPackage.OCL_DOCUMENT_CS : { > OCLDocumentCS oclDocumentCS = (OCLDocumentCS) theEObject; > T result = caseOCLDocumentCS(oclDocumentCS); >@@ -1452,21 +1446,6 @@ > } > > /** >- * Returns the result of interpreting the object as an instance of '<em>State Exp CS</em>'. >- * <!-- begin-user-doc --> >- * This implementation returns null; >- * returning a non-null result will terminate the switch. >- * <!-- end-user-doc --> >- * @param object the target of the switch. >- * @return the result of interpreting the object as an instance of '<em>State Exp CS</em>'. >- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) >- * @generated >- */ >- public T caseStateExpCS(StateExpCS object) { >- return null; >- } >- >- /** > * Returns the result of interpreting the object as an instance of '<em>OCL Document CS</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; >Index: src/org/eclipse/ocl/internal/helper/OCLSyntaxHelper.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/helper/OCLSyntaxHelper.java,v >retrieving revision 1.15 >diff -u -r1.15 OCLSyntaxHelper.java >--- src/org/eclipse/ocl/internal/helper/OCLSyntaxHelper.java 4 Sep 2009 13:40:43 -0000 1.15 >+++ src/org/eclipse/ocl/internal/helper/OCLSyntaxHelper.java 8 Oct 2009 11:53:25 -0000 >@@ -825,7 +825,7 @@ > } > > /** >- * Gets the type of token at the specified index in the list of tokens >+ * Gets the token at the specified index in the list of tokens > * represented by the given text. Token indices count from zero, with > * negative indices counting backwards from the last token (-1 is the last, > * -2 the next-to-last, etc.). >@@ -834,11 +834,11 @@ > * @param tokenIndex the token index to look at (negative indices count > * backwards from the end) > * >- * @return the token type at the index, or {@link OCLParsersym#TK_EOF_TOKEN} >+ * @return the token at the index, or null > * if there is no token at the specified index > */ >- private int tokenAt(String text, int tokenIndex) { >- int result = OCLParsersym.TK_EOF_TOKEN; >+ private IToken tokenAt(String text, int tokenIndex) { >+ IToken result = null; > List<IToken> tokens = tokenize(text); > > if (tokenIndex < 0) { >@@ -846,7 +846,7 @@ > } > > if ((tokenIndex >= 0) && (tokenIndex < tokens.size())) { >- result = tokens.get(tokenIndex).getKind(); >+ result = tokens.get(tokenIndex); > } > > return result; >@@ -963,7 +963,7 @@ > if (iter.hasPrevious()) { > prev = iter.previous(); > >- if (prev.getKind() == OCLParsersym.TK_oclIsInState) { >+ if (isOclIsInState(prev)) { > syntaxHelpStringSuffix = OCL_IS_IN_STATE; > position = prev.getStartOffset(); > break; >@@ -1000,7 +1000,7 @@ > result = getPathChoices(pathName); > } > } else if (txt.endsWith("(") // known BMP code point //$NON-NLS-1$ >- && (tokenAt(txt, -2) == OCLParsersym.TK_oclIsInState)) { >+ && isOclIsInState(tokenAt(txt, -2))) { > > syntaxHelpStringSuffix = OCL_IS_IN_STATE; > >@@ -1076,6 +1076,14 @@ > > return result; > } >+ >+ protected boolean isOclIsInState(IToken token) { >+ if (token == null) >+ return false; >+ if (token.getKind() != OCLParsersym.TK_IDENTIFIER) >+ return false; >+ return PredefinedType.OCL_IS_IN_STATE_NAME.equals(token.toString()); >+ } > > /** > * Disposes not only the specified <tt>object</tt> but all of the objects
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 184048
:
146988
|
149024
| 149105