Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 184048 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ocl/ecore/tests/BasicOCLTest.java (+26 lines)
Lines 271-276 Link Here
271
		assertFalse(check(expr, eCls));
271
		assertFalse(check(expr, eCls));
272
	}
272
	}
273
	
273
	
274
	public void testIfExpressions_184048() {
275
		EClass eCls = EcoreFactory.eINSTANCE.createEClass();
276
		eCls.setName("bar"); //$NON-NLS-1$
277
		
278
		OCLExpression<EClassifier> expr = parse(
279
			"package ecore context EClass " + //$NON-NLS-1$
280
			"inv: if self.abstract then name = 'bar' else name <> 'bar' endif ->asSequence()->at(1)" + //$NON-NLS-1$
281
			"endpackage "); //$NON-NLS-1$
282
		
283
		assertFalse(check(expr, eCls));
284
		
285
		eCls.setAbstract(true);
286
		
287
		assertTrue(check(expr, eCls));
288
		
289
		eCls.setName("foo"); //$NON-NLS-1$
290
		
291
		assertFalse(check(expr, eCls));
292
		
293
		OCLExpression<EClassifier> expr2 = parse(
294
			"package ecore context EClass " + //$NON-NLS-1$
295
			"inv: 7 = 1 + let a : String = invalid in 1 + if self.oclIsUndefined() then 1 else 5 endif " + //$NON-NLS-1$
296
			"endpackage "); //$NON-NLS-1$
297
		assertTrue(check(expr2, eCls));
298
	}
299
	
274
	public void testLetExpressions() {
300
	public void testLetExpressions() {
275
		EClass eCls = EcoreFactory.eINSTANCE.createEClass();
301
		EClass eCls = EcoreFactory.eINSTANCE.createEClass();
276
		eCls.setName("foo"); //$NON-NLS-1$
302
		eCls.setName("foo"); //$NON-NLS-1$
(-)src/org/eclipse/ocl/cst/impl/StateExpCSImpl.java (-170 lines)
Removed Link Here
1
/**
2
 * <copyright>
3
 * 
4
 * Copyright (c) 2005, 2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - Bug 243976
13
 *
14
 * </copyright>
15
 *
16
 * $Id: StateExpCSImpl.java,v 1.4 2009/09/04 13:40:43 ewillink Exp $
17
 */
18
package org.eclipse.ocl.cst.impl;
19
20
import java.util.Collection;
21
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.EList;
24
import org.eclipse.emf.ecore.EClass;
25
import org.eclipse.emf.ecore.InternalEObject;
26
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
27
import org.eclipse.emf.ecore.util.InternalEList;
28
import org.eclipse.ocl.cst.CSTPackage;
29
import org.eclipse.ocl.cst.SimpleNameCS;
30
import org.eclipse.ocl.cst.StateExpCS;
31
32
/**
33
 * <!-- begin-user-doc -->
34
 * An implementation of the model object '<em><b>State Exp CS</b></em>'.
35
 * <!-- end-user-doc -->
36
 * <p>
37
 * The following features are implemented:
38
 * <ul>
39
 *   <li>{@link org.eclipse.ocl.cst.impl.StateExpCSImpl#getSimpleNames <em>Simple Names</em>}</li>
40
 * </ul>
41
 * </p>
42
 *
43
 * @generated
44
 */
45
public class StateExpCSImpl
46
		extends TypeCSImpl
47
		implements StateExpCS {
48
49
	/**
50
	 * The cached value of the '{@link #getSimpleNames() <em>Simple Names</em>}' containment reference list.
51
	 * <!-- begin-user-doc -->
52
	 * @since 3.0
53
	 * <!-- end-user-doc -->
54
	 * @see #getSimpleNames()
55
	 * @generated
56
	 * @ordered
57
	 */
58
	protected EList<SimpleNameCS> simpleNames;
59
60
	/**
61
	 * <!-- begin-user-doc -->
62
	 * <!-- end-user-doc -->
63
	 * @generated
64
	 */
65
	protected StateExpCSImpl() {
66
		super();
67
	}
68
69
	/**
70
	 * <!-- begin-user-doc -->
71
	 * <!-- end-user-doc -->
72
	 * @generated
73
	 */
74
	@Override
75
	protected EClass eStaticClass() {
76
		return CSTPackage.Literals.STATE_EXP_CS;
77
	}
78
79
	/**
80
	 * <!-- begin-user-doc -->
81
	 * @since 3.0
82
	 * <!-- end-user-doc -->
83
	 * @generated
84
	 */
85
	public EList<SimpleNameCS> getSimpleNames() {
86
		if (simpleNames == null) {
87
			simpleNames = new EObjectContainmentEList<SimpleNameCS>(
88
				SimpleNameCS.class, this, CSTPackage.STATE_EXP_CS__SIMPLE_NAMES);
89
		}
90
		return simpleNames;
91
	}
92
93
	/**
94
	 * <!-- begin-user-doc -->
95
	 * <!-- end-user-doc -->
96
	 * @generated
97
	 */
98
	@Override
99
	public NotificationChain eInverseRemove(InternalEObject otherEnd,
100
			int featureID, NotificationChain msgs) {
101
		switch (featureID) {
102
			case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES :
103
				return ((InternalEList<?>) getSimpleNames()).basicRemove(
104
					otherEnd, msgs);
105
		}
106
		return super.eInverseRemove(otherEnd, featureID, msgs);
107
	}
108
109
	/**
110
	 * <!-- begin-user-doc -->
111
	 * <!-- end-user-doc -->
112
	 * @generated
113
	 */
114
	@Override
115
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
116
		switch (featureID) {
117
			case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES :
118
				return getSimpleNames();
119
		}
120
		return super.eGet(featureID, resolve, coreType);
121
	}
122
123
	/**
124
	 * <!-- begin-user-doc -->
125
	 * <!-- end-user-doc -->
126
	 * @generated
127
	 */
128
	@SuppressWarnings("unchecked")
129
	@Override
130
	public void eSet(int featureID, Object newValue) {
131
		switch (featureID) {
132
			case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES :
133
				getSimpleNames().clear();
134
				getSimpleNames().addAll(
135
					(Collection<? extends SimpleNameCS>) newValue);
136
				return;
137
		}
138
		super.eSet(featureID, newValue);
139
	}
140
141
	/**
142
	 * <!-- begin-user-doc -->
143
	 * <!-- end-user-doc -->
144
	 * @generated
145
	 */
146
	@Override
147
	public void eUnset(int featureID) {
148
		switch (featureID) {
149
			case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES :
150
				getSimpleNames().clear();
151
				return;
152
		}
153
		super.eUnset(featureID);
154
	}
155
156
	/**
157
	 * <!-- begin-user-doc -->
158
	 * <!-- end-user-doc -->
159
	 * @generated
160
	 */
161
	@Override
162
	public boolean eIsSet(int featureID) {
163
		switch (featureID) {
164
			case CSTPackage.STATE_EXP_CS__SIMPLE_NAMES :
165
				return simpleNames != null && !simpleNames.isEmpty();
166
		}
167
		return super.eIsSet(featureID);
168
	}
169
170
} //StateExpCSImpl
(-)src/org/eclipse/ocl/cst/impl/CSTPackageImpl.java (-39 / +18 lines)
Lines 19-24 Link Here
19
package org.eclipse.ocl.cst.impl;
19
package org.eclipse.ocl.cst.impl;
20
20
21
import lpg.lpgjavaruntime.IToken;
21
import lpg.lpgjavaruntime.IToken;
22
22
import org.eclipse.emf.ecore.EAttribute;
23
import org.eclipse.emf.ecore.EAttribute;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EDataType;
25
import org.eclipse.emf.ecore.EDataType;
Lines 76-82 Link Here
76
import org.eclipse.ocl.cst.RealLiteralExpCS;
77
import org.eclipse.ocl.cst.RealLiteralExpCS;
77
import org.eclipse.ocl.cst.SimpleNameCS;
78
import org.eclipse.ocl.cst.SimpleNameCS;
78
import org.eclipse.ocl.cst.SimpleTypeEnum;
79
import org.eclipse.ocl.cst.SimpleTypeEnum;
79
import org.eclipse.ocl.cst.StateExpCS;
80
import org.eclipse.ocl.cst.StringLiteralExpCS;
80
import org.eclipse.ocl.cst.StringLiteralExpCS;
81
import org.eclipse.ocl.cst.TupleLiteralExpCS;
81
import org.eclipse.ocl.cst.TupleLiteralExpCS;
82
import org.eclipse.ocl.cst.TupleTypeCS;
82
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 401-413 Link Here
401
	 * <!-- end-user-doc -->
401
	 * <!-- end-user-doc -->
402
	 * @generated
402
	 * @generated
403
	 */
403
	 */
404
	private EClass stateExpCSEClass = null;
405
406
	/**
407
	 * <!-- begin-user-doc -->
408
	 * <!-- end-user-doc -->
409
	 * @generated
410
	 */
411
	private EClass oclDocumentCSEClass = null;
404
	private EClass oclDocumentCSEClass = null;
412
405
413
	/**
406
	/**
Lines 1508-1513 Link Here
1508
1501
1509
	/**
1502
	/**
1510
	 * <!-- begin-user-doc -->
1503
	 * <!-- begin-user-doc -->
1504
	 * @since 3.0
1505
	 * <!-- end-user-doc -->
1506
	 * @generated
1507
	 */
1508
	public EReference getOperationCallExpCS_PathNameCS() {
1509
		return (EReference) operationCallExpCSEClass.getEStructuralFeatures()
1510
			.get(0);
1511
	}
1512
1513
	/**
1514
	 * <!-- begin-user-doc -->
1511
	 * <!-- end-user-doc -->
1515
	 * <!-- end-user-doc -->
1512
	 * @generated
1516
	 * @generated
1513
	 */
1517
	 */
Lines 1567-1591 Link Here
1567
1571
1568
	/**
1572
	/**
1569
	 * <!-- begin-user-doc -->
1573
	 * <!-- begin-user-doc -->
1570
	 * <!-- end-user-doc -->
1571
	 * @generated
1572
	 */
1573
	public EClass getStateExpCS() {
1574
		return stateExpCSEClass;
1575
	}
1576
1577
	/**
1578
	 * <!-- begin-user-doc -->
1579
	 * @since 3.0
1580
	 * <!-- end-user-doc -->
1581
	 * @generated
1582
	 */
1583
	public EReference getStateExpCS_SimpleNames() {
1584
		return (EReference) stateExpCSEClass.getEStructuralFeatures().get(0);
1585
	}
1586
1587
	/**
1588
	 * <!-- begin-user-doc -->
1589
	 * @since 1.3
1574
	 * @since 1.3
1590
	 * <!-- end-user-doc -->
1575
	 * <!-- end-user-doc -->
1591
	 * @generated
1576
	 * @generated
Lines 2079-2087 Link Here
2079
			FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS);
2064
			FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS);
2080
2065
2081
		operationCallExpCSEClass = createEClass(OPERATION_CALL_EXP_CS);
2066
		operationCallExpCSEClass = createEClass(OPERATION_CALL_EXP_CS);
2082
2067
		createEReference(operationCallExpCSEClass,
2083
		stateExpCSEClass = createEClass(STATE_EXP_CS);
2068
			OPERATION_CALL_EXP_CS__PATH_NAME_CS);
2084
		createEReference(stateExpCSEClass, STATE_EXP_CS__SIMPLE_NAMES);
2085
2069
2086
		oclDocumentCSEClass = createEClass(OCL_DOCUMENT_CS);
2070
		oclDocumentCSEClass = createEClass(OCL_DOCUMENT_CS);
2087
		createEReference(oclDocumentCSEClass,
2071
		createEReference(oclDocumentCSEClass,
Lines 2153-2158 Link Here
2153
		primitiveTypeCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2137
		primitiveTypeCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2154
		primitiveTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2138
		primitiveTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2155
		tupleTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2139
		tupleTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2140
		collectionTypeCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2156
		collectionTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2141
		collectionTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2157
		letExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS());
2142
		letExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS());
2158
		ifExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS());
2143
		ifExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS());
Lines 2187-2193 Link Here
2187
		featureCallExpCSEClass.getESuperTypes().add(this.getCallExpCS());
2172
		featureCallExpCSEClass.getESuperTypes().add(this.getCallExpCS());
2188
		operationCallExpCSEClass.getESuperTypes().add(
2173
		operationCallExpCSEClass.getESuperTypes().add(
2189
			this.getFeatureCallExpCS());
2174
			this.getFeatureCallExpCS());
2190
		stateExpCSEClass.getESuperTypes().add(this.getTypeCS());
2191
		oclDocumentCSEClass.getESuperTypes().add(this.getCSTNode());
2175
		oclDocumentCSEClass.getESuperTypes().add(this.getCSTNode());
2192
2176
2193
		// Initialize classes and features; add operations and parameters
2177
		// Initialize classes and features; add operations and parameters
Lines 2792-2807 Link Here
2792
			operationCallExpCSEClass,
2776
			operationCallExpCSEClass,
2793
			OperationCallExpCS.class,
2777
			OperationCallExpCS.class,
2794
			"OperationCallExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2778
			"OperationCallExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2795
2796
		initEClass(
2797
			stateExpCSEClass,
2798
			StateExpCS.class,
2799
			"StateExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2800
		initEReference(
2779
		initEReference(
2801
			getStateExpCS_SimpleNames(),
2780
			getOperationCallExpCS_PathNameCS(),
2802
			this.getSimpleNameCS(),
2781
			this.getPathNameCS(),
2803
			null,
2782
			null,
2804
			"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$
2783
			"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$
2805
2784
2806
		initEClass(
2785
		initEClass(
2807
			oclDocumentCSEClass,
2786
			oclDocumentCSEClass,
(-)src/org/eclipse/ocl/cst/impl/CSTFactoryImpl.java (-15 / +2 lines)
Lines 18-31 Link Here
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import lpg.lpgjavaruntime.IToken;
20
import lpg.lpgjavaruntime.IToken;
21
21
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EDataType;
23
import org.eclipse.emf.ecore.EDataType;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.emf.ecore.EPackage;
25
import org.eclipse.emf.ecore.EPackage;
25
import org.eclipse.emf.ecore.impl.EFactoryImpl;
26
import org.eclipse.emf.ecore.impl.EFactoryImpl;
26
import org.eclipse.emf.ecore.plugin.EcorePlugin;
27
import org.eclipse.emf.ecore.plugin.EcorePlugin;
27
28
import org.eclipse.ocl.cst.*;
28
//import org.eclipse.ocl.cst.*;
29
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
29
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
30
import org.eclipse.ocl.cst.CSTFactory;
30
import org.eclipse.ocl.cst.CSTFactory;
31
import org.eclipse.ocl.cst.CSTPackage;
31
import org.eclipse.ocl.cst.CSTPackage;
Lines 70-76 Link Here
70
import org.eclipse.ocl.cst.RealLiteralExpCS;
70
import org.eclipse.ocl.cst.RealLiteralExpCS;
71
import org.eclipse.ocl.cst.SimpleNameCS;
71
import org.eclipse.ocl.cst.SimpleNameCS;
72
import org.eclipse.ocl.cst.SimpleTypeEnum;
72
import org.eclipse.ocl.cst.SimpleTypeEnum;
73
import org.eclipse.ocl.cst.StateExpCS;
74
import org.eclipse.ocl.cst.StringLiteralExpCS;
73
import org.eclipse.ocl.cst.StringLiteralExpCS;
75
import org.eclipse.ocl.cst.TupleLiteralExpCS;
74
import org.eclipse.ocl.cst.TupleLiteralExpCS;
76
import org.eclipse.ocl.cst.TupleTypeCS;
75
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 209-216 Link Here
209
				return createFeatureCallExpCS();
208
				return createFeatureCallExpCS();
210
			case CSTPackage.OPERATION_CALL_EXP_CS :
209
			case CSTPackage.OPERATION_CALL_EXP_CS :
211
				return createOperationCallExpCS();
210
				return createOperationCallExpCS();
212
			case CSTPackage.STATE_EXP_CS :
213
				return createStateExpCS();
214
			case CSTPackage.OCL_DOCUMENT_CS :
211
			case CSTPackage.OCL_DOCUMENT_CS :
215
				return createOCLDocumentCS();
212
				return createOCLDocumentCS();
216
			default :
213
			default :
Lines 677-692 Link Here
677
674
678
	/**
675
	/**
679
	 * <!-- begin-user-doc -->
676
	 * <!-- begin-user-doc -->
680
	 * <!-- end-user-doc -->
681
	 * @generated
682
	 */
683
	public StateExpCS createStateExpCS() {
684
		StateExpCSImpl stateExpCS = new StateExpCSImpl();
685
		return stateExpCS;
686
	}
687
688
	/**
689
	 * <!-- begin-user-doc -->
690
	 * @since 1.3
677
	 * @since 1.3
691
	 * <!-- end-user-doc -->
678
	 * <!-- end-user-doc -->
692
	 * @generated
679
	 * @generated
(-)src/org/eclipse/ocl/cst/impl/CollectionTypeCSImpl.java (-1 / +1 lines)
Lines 42-48 Link Here
42
 * @generated
42
 * @generated
43
 */
43
 */
44
public class CollectionTypeCSImpl
44
public class CollectionTypeCSImpl
45
		extends TypeCSImpl
45
		extends SimpleNameCSImpl
46
		implements CollectionTypeCS {
46
		implements CollectionTypeCS {
47
47
48
	/**
48
	/**
(-)src/org/eclipse/ocl/cst/impl/OperationCallExpCSImpl.java (+154 lines)
Lines 17-31 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import org.eclipse.emf.common.notify.Notification;
21
import org.eclipse.emf.common.notify.NotificationChain;
20
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.InternalEObject;
24
import org.eclipse.emf.ecore.impl.ENotificationImpl;
21
import org.eclipse.ocl.cst.CSTPackage;
25
import org.eclipse.ocl.cst.CSTPackage;
22
import org.eclipse.ocl.cst.OperationCallExpCS;
26
import org.eclipse.ocl.cst.OperationCallExpCS;
27
import org.eclipse.ocl.cst.PathNameCS;
23
28
24
/**
29
/**
25
 * <!-- begin-user-doc -->
30
 * <!-- begin-user-doc -->
26
 * An implementation of the model object '<em><b>Operation Call Exp CS</b></em>'.
31
 * An implementation of the model object '<em><b>Operation Call Exp CS</b></em>'.
27
 * <!-- end-user-doc -->
32
 * <!-- end-user-doc -->
28
 * <p>
33
 * <p>
34
 * The following features are implemented:
35
 * <ul>
36
 *   <li>{@link org.eclipse.ocl.cst.impl.OperationCallExpCSImpl#getPathNameCS <em>Path Name CS</em>}</li>
37
 * </ul>
29
 * </p>
38
 * </p>
30
 *
39
 *
31
 * @generated
40
 * @generated
Lines 35-40 Link Here
35
		implements OperationCallExpCS {
44
		implements OperationCallExpCS {
36
45
37
	/**
46
	/**
47
	 * The cached value of the '{@link #getPathNameCS() <em>Path Name CS</em>}' containment reference.
48
	 * <!-- begin-user-doc -->
49
	 * @since 3.0
50
	 * <!-- end-user-doc -->
51
	 * @see #getPathNameCS()
52
	 * @generated
53
	 * @ordered
54
	 */
55
	protected PathNameCS pathNameCS;
56
57
	/**
38
	 * <!-- begin-user-doc -->
58
	 * <!-- begin-user-doc -->
39
	 * <!-- end-user-doc -->
59
	 * <!-- end-user-doc -->
40
	 * @generated
60
	 * @generated
Lines 53-56 Link Here
53
		return CSTPackage.Literals.OPERATION_CALL_EXP_CS;
73
		return CSTPackage.Literals.OPERATION_CALL_EXP_CS;
54
	}
74
	}
55
75
76
	/**
77
	 * <!-- begin-user-doc -->
78
	 * @since 3.0
79
	 * <!-- end-user-doc -->
80
	 * @generated
81
	 */
82
	public PathNameCS getPathNameCS() {
83
		return pathNameCS;
84
	}
85
86
	/**
87
	 * <!-- begin-user-doc -->
88
	 * @since 3.0
89
	 * <!-- end-user-doc -->
90
	 * @generated
91
	 */
92
	public NotificationChain basicSetPathNameCS(PathNameCS newPathNameCS,
93
			NotificationChain msgs) {
94
		PathNameCS oldPathNameCS = pathNameCS;
95
		pathNameCS = newPathNameCS;
96
		if (eNotificationRequired()) {
97
			ENotificationImpl notification = new ENotificationImpl(this,
98
				Notification.SET,
99
				CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, oldPathNameCS,
100
				newPathNameCS);
101
			if (msgs == null)
102
				msgs = notification;
103
			else
104
				msgs.add(notification);
105
		}
106
		return msgs;
107
	}
108
109
	/**
110
	 * <!-- begin-user-doc -->
111
	 * @since 3.0
112
	 * <!-- end-user-doc -->
113
	 * @generated
114
	 */
115
	public void setPathNameCS(PathNameCS newPathNameCS) {
116
		if (newPathNameCS != pathNameCS) {
117
			NotificationChain msgs = null;
118
			if (pathNameCS != null)
119
				msgs = ((InternalEObject) pathNameCS).eInverseRemove(this,
120
					EOPPOSITE_FEATURE_BASE
121
						- CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, null,
122
					msgs);
123
			if (newPathNameCS != null)
124
				msgs = ((InternalEObject) newPathNameCS).eInverseAdd(this,
125
					EOPPOSITE_FEATURE_BASE
126
						- CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, null,
127
					msgs);
128
			msgs = basicSetPathNameCS(newPathNameCS, msgs);
129
			if (msgs != null)
130
				msgs.dispatch();
131
		} else if (eNotificationRequired())
132
			eNotify(new ENotificationImpl(this, Notification.SET,
133
				CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, newPathNameCS,
134
				newPathNameCS));
135
	}
136
137
	/**
138
	 * <!-- begin-user-doc -->
139
	 * <!-- end-user-doc -->
140
	 * @generated
141
	 */
142
	@Override
143
	public NotificationChain eInverseRemove(InternalEObject otherEnd,
144
			int featureID, NotificationChain msgs) {
145
		switch (featureID) {
146
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
147
				return basicSetPathNameCS(null, msgs);
148
		}
149
		return super.eInverseRemove(otherEnd, featureID, msgs);
150
	}
151
152
	/**
153
	 * <!-- begin-user-doc -->
154
	 * <!-- end-user-doc -->
155
	 * @generated
156
	 */
157
	@Override
158
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
159
		switch (featureID) {
160
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
161
				return getPathNameCS();
162
		}
163
		return super.eGet(featureID, resolve, coreType);
164
	}
165
166
	/**
167
	 * <!-- begin-user-doc -->
168
	 * <!-- end-user-doc -->
169
	 * @generated
170
	 */
171
	@Override
172
	public void eSet(int featureID, Object newValue) {
173
		switch (featureID) {
174
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
175
				setPathNameCS((PathNameCS) newValue);
176
				return;
177
		}
178
		super.eSet(featureID, newValue);
179
	}
180
181
	/**
182
	 * <!-- begin-user-doc -->
183
	 * <!-- end-user-doc -->
184
	 * @generated
185
	 */
186
	@Override
187
	public void eUnset(int featureID) {
188
		switch (featureID) {
189
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
190
				setPathNameCS((PathNameCS) null);
191
				return;
192
		}
193
		super.eUnset(featureID);
194
	}
195
196
	/**
197
	 * <!-- begin-user-doc -->
198
	 * <!-- end-user-doc -->
199
	 * @generated
200
	 */
201
	@Override
202
	public boolean eIsSet(int featureID) {
203
		switch (featureID) {
204
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
205
				return pathNameCS != null;
206
		}
207
		return super.eIsSet(featureID);
208
	}
209
56
} //OperationCallExpCSImpl
210
} //OperationCallExpCSImpl
(-)src/org/eclipse/ocl/cst/StateExpCS.java (-60 lines)
Removed Link Here
1
/**
2
 * <copyright>
3
 * 
4
 * Copyright (c) 2005, 2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved. This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 *
10
 * Contributors:
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - Bug 243976
13
 *
14
 * </copyright>
15
 *
16
 * $Id: StateExpCS.java,v 1.4 2009/09/04 13:40:44 ewillink Exp $
17
 */
18
package org.eclipse.ocl.cst;
19
20
import org.eclipse.emf.common.util.EList;
21
22
/**
23
 * <!-- begin-user-doc -->
24
 * A representation of the model object '<em><b>State Exp CS</b></em>'.
25
 * <!-- end-user-doc -->
26
 *
27
 * <p>
28
 * The following features are supported:
29
 * <ul>
30
 *   <li>{@link org.eclipse.ocl.cst.StateExpCS#getSimpleNames <em>Simple Names</em>}</li>
31
 * </ul>
32
 * </p>
33
 *
34
 * @see org.eclipse.ocl.cst.CSTPackage#getStateExpCS()
35
 * @model
36
 * @generated
37
 * @noimplement This interface is not intended to be implemented by clients.
38
 * @noextend This interface is not intended to be extended by clients.
39
 */
40
public interface StateExpCS
41
		extends TypeCS {
42
43
	/**
44
	 * Returns the value of the '<em><b>Simple Names</b></em>' containment reference list.
45
	 * The list contents are of type {@link org.eclipse.ocl.cst.SimpleNameCS}.
46
	 * <!-- begin-user-doc -->
47
	 * <p>
48
	 * If the meaning of the '<em>Simple Names</em>' containment reference list isn't clear,
49
	 * there really should be more of a description here...
50
	 * </p>
51
	 * @since 3.0
52
	 * <!-- end-user-doc -->
53
	 * @return the value of the '<em>Simple Names</em>' containment reference list.
54
	 * @see org.eclipse.ocl.cst.CSTPackage#getStateExpCS_SimpleNames()
55
	 * @model containment="true"
56
	 * @generated
57
	 */
58
	EList<SimpleNameCS> getSimpleNames();
59
60
} // StateExpCS
(-)src/org/eclipse/ocl/cst/OperationCallExpCS.java (+35 lines)
Lines 22-27 Link Here
22
 * A representation of the model object '<em><b>Operation Call Exp CS</b></em>'.
22
 * A representation of the model object '<em><b>Operation Call Exp CS</b></em>'.
23
 * <!-- end-user-doc -->
23
 * <!-- end-user-doc -->
24
 *
24
 *
25
 * <p>
26
 * The following features are supported:
27
 * <ul>
28
 *   <li>{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}</li>
29
 * </ul>
30
 * </p>
25
 *
31
 *
26
 * @see org.eclipse.ocl.cst.CSTPackage#getOperationCallExpCS()
32
 * @see org.eclipse.ocl.cst.CSTPackage#getOperationCallExpCS()
27
 * @model
33
 * @model
Lines 31-34 Link Here
31
 */
37
 */
32
public interface OperationCallExpCS
38
public interface OperationCallExpCS
33
		extends FeatureCallExpCS {
39
		extends FeatureCallExpCS {
40
41
	/**
42
	 * Returns the value of the '<em><b>Path Name CS</b></em>' containment reference.
43
	 * <!-- begin-user-doc -->
44
	 * <p>
45
	 * If the meaning of the '<em>Path Name CS</em>' containment reference isn't clear,
46
	 * there really should be more of a description here...
47
	 * </p>
48
	 * @since 3.0
49
	 * @since 3.0
50
	 * <!-- end-user-doc -->
51
	 * @return the value of the '<em>Path Name CS</em>' containment reference.
52
	 * @see #setPathNameCS(PathNameCS)
53
	 * @see org.eclipse.ocl.cst.CSTPackage#getOperationCallExpCS_PathNameCS()
54
	 * @model containment="true"
55
	 * @generated
56
	 */
57
	PathNameCS getPathNameCS();
58
59
	/**
60
	 * Sets the value of the '{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}' containment reference.
61
	 * <!-- begin-user-doc -->
62
	 * @since 3.0
63
	 * <!-- end-user-doc -->
64
	 * @param value the new value of the '<em>Path Name CS</em>' containment reference.
65
	 * @see #getPathNameCS()
66
	 * @generated
67
	 */
68
	void setPathNameCS(PathNameCS value);
34
} // OperationCallExpCS
69
} // OperationCallExpCS
(-)src/org/eclipse/ocl/cst/CSTFactory.java (-9 lines)
Lines 419-433 Link Here
419
	OperationCallExpCS createOperationCallExpCS();
419
	OperationCallExpCS createOperationCallExpCS();
420
420
421
	/**
421
	/**
422
	 * Returns a new object of class '<em>State Exp CS</em>'.
423
	 * <!-- begin-user-doc -->
424
	 * <!-- end-user-doc -->
425
	 * @return a new object of class '<em>State Exp CS</em>'.
426
	 * @generated
427
	 */
428
	StateExpCS createStateExpCS();
429
430
	/**
431
	 * Returns a new object of class '<em>OCL Document CS</em>'.
422
	 * Returns a new object of class '<em>OCL Document CS</em>'.
432
	 * <!-- begin-user-doc -->
423
	 * <!-- begin-user-doc -->
433
	 * @since 1.3
424
	 * @since 1.3
(-)src/org/eclipse/ocl/cst/CollectionTypeCS.java (-1 / +1 lines)
Lines 37-43 Link Here
37
 * @noextend This interface is not intended to be extended by clients.
37
 * @noextend This interface is not intended to be extended by clients.
38
 */
38
 */
39
public interface CollectionTypeCS
39
public interface CollectionTypeCS
40
		extends TypeCS {
40
		extends SimpleNameCS, TypeCS {
41
41
42
	/**
42
	/**
43
	 * Returns the value of the '<em><b>Collection Type Identifier</b></em>' attribute.
43
	 * Returns the value of the '<em><b>Collection Type Identifier</b></em>' attribute.
(-)src/org/eclipse/ocl/cst/CSTPackage.java (-118 / +47 lines)
Lines 2229-2235 Link Here
2229
	 * @ordered
2229
	 * @ordered
2230
	 * @noreference This field is not intended to be referenced by clients.
2230
	 * @noreference This field is not intended to be referenced by clients.
2231
	 */
2231
	 */
2232
	int COLLECTION_TYPE_CS__START_OFFSET = TYPE_CS__START_OFFSET;
2232
	int COLLECTION_TYPE_CS__START_OFFSET = SIMPLE_NAME_CS__START_OFFSET;
2233
2233
2234
	/**
2234
	/**
2235
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
2235
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
Lines 2239-2245 Link Here
2239
	 * @ordered
2239
	 * @ordered
2240
	 * @noreference This field is not intended to be referenced by clients.
2240
	 * @noreference This field is not intended to be referenced by clients.
2241
	 */
2241
	 */
2242
	int COLLECTION_TYPE_CS__END_OFFSET = TYPE_CS__END_OFFSET;
2242
	int COLLECTION_TYPE_CS__END_OFFSET = SIMPLE_NAME_CS__END_OFFSET;
2243
2243
2244
	/**
2244
	/**
2245
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
2245
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
Lines 2249-2255 Link Here
2249
	 * @ordered
2249
	 * @ordered
2250
	 * @noreference This field is not intended to be referenced by clients.
2250
	 * @noreference This field is not intended to be referenced by clients.
2251
	 */
2251
	 */
2252
	int COLLECTION_TYPE_CS__START_TOKEN = TYPE_CS__START_TOKEN;
2252
	int COLLECTION_TYPE_CS__START_TOKEN = SIMPLE_NAME_CS__START_TOKEN;
2253
2253
2254
	/**
2254
	/**
2255
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
2255
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
Lines 2259-2265 Link Here
2259
	 * @ordered
2259
	 * @ordered
2260
	 * @noreference This field is not intended to be referenced by clients.
2260
	 * @noreference This field is not intended to be referenced by clients.
2261
	 */
2261
	 */
2262
	int COLLECTION_TYPE_CS__END_TOKEN = TYPE_CS__END_TOKEN;
2262
	int COLLECTION_TYPE_CS__END_TOKEN = SIMPLE_NAME_CS__END_TOKEN;
2263
2263
2264
	/**
2264
	/**
2265
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
2265
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
Lines 2269-2275 Link Here
2269
	 * @ordered
2269
	 * @ordered
2270
	 * @noreference This field is not intended to be referenced by clients.
2270
	 * @noreference This field is not intended to be referenced by clients.
2271
	 */
2271
	 */
2272
	int COLLECTION_TYPE_CS__AST = TYPE_CS__AST;
2272
	int COLLECTION_TYPE_CS__AST = SIMPLE_NAME_CS__AST;
2273
2274
	/**
2275
	 * The feature id for the '<em><b>Value</b></em>' attribute.
2276
	 * <!-- begin-user-doc -->
2277
	 * <!-- end-user-doc -->
2278
	 * @generated
2279
	 * @ordered
2280
	 * @noreference This field is not intended to be referenced by clients.
2281
	 */
2282
	int COLLECTION_TYPE_CS__VALUE = SIMPLE_NAME_CS__VALUE;
2283
2284
	/**
2285
	 * The feature id for the '<em><b>Type</b></em>' attribute.
2286
	 * <!-- begin-user-doc -->
2287
	 * <!-- end-user-doc -->
2288
	 * @generated
2289
	 * @ordered
2290
	 * @noreference This field is not intended to be referenced by clients.
2291
	 */
2292
	int COLLECTION_TYPE_CS__TYPE = SIMPLE_NAME_CS__TYPE;
2273
2293
2274
	/**
2294
	/**
2275
	 * The feature id for the '<em><b>Collection Type Identifier</b></em>' attribute.
2295
	 * The feature id for the '<em><b>Collection Type Identifier</b></em>' attribute.
Lines 2279-2285 Link Here
2279
	 * @ordered
2299
	 * @ordered
2280
	 * @noreference This field is not intended to be referenced by clients.
2300
	 * @noreference This field is not intended to be referenced by clients.
2281
	 */
2301
	 */
2282
	int COLLECTION_TYPE_CS__COLLECTION_TYPE_IDENTIFIER = TYPE_CS_FEATURE_COUNT + 0;
2302
	int COLLECTION_TYPE_CS__COLLECTION_TYPE_IDENTIFIER = SIMPLE_NAME_CS_FEATURE_COUNT + 0;
2283
2303
2284
	/**
2304
	/**
2285
	 * The feature id for the '<em><b>Type CS</b></em>' containment reference.
2305
	 * The feature id for the '<em><b>Type CS</b></em>' containment reference.
Lines 2289-2295 Link Here
2289
	 * @ordered
2309
	 * @ordered
2290
	 * @noreference This field is not intended to be referenced by clients.
2310
	 * @noreference This field is not intended to be referenced by clients.
2291
	 */
2311
	 */
2292
	int COLLECTION_TYPE_CS__TYPE_CS = TYPE_CS_FEATURE_COUNT + 1;
2312
	int COLLECTION_TYPE_CS__TYPE_CS = SIMPLE_NAME_CS_FEATURE_COUNT + 1;
2293
2313
2294
	/**
2314
	/**
2295
	 * The number of structural features of the '<em>Collection Type CS</em>' class.
2315
	 * The number of structural features of the '<em>Collection Type CS</em>' class.
Lines 2299-2305 Link Here
2299
	 * @ordered
2319
	 * @ordered
2300
	 * @noreference This field is not intended to be referenced by clients.
2320
	 * @noreference This field is not intended to be referenced by clients.
2301
	 */
2321
	 */
2302
	int COLLECTION_TYPE_CS_FEATURE_COUNT = TYPE_CS_FEATURE_COUNT + 2;
2322
	int COLLECTION_TYPE_CS_FEATURE_COUNT = SIMPLE_NAME_CS_FEATURE_COUNT + 2;
2303
2323
2304
	/**
2324
	/**
2305
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.LetExpCSImpl <em>Let Exp CS</em>}' class.
2325
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.LetExpCSImpl <em>Let Exp CS</em>}' class.
Lines 4637-4731 Link Here
4637
	int OPERATION_CALL_EXP_CS__IS_MARKED_PRE_CS = FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS;
4657
	int OPERATION_CALL_EXP_CS__IS_MARKED_PRE_CS = FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS;
4638
4658
4639
	/**
4659
	/**
4640
	 * The number of structural features of the '<em>Operation Call Exp CS</em>' class.
4660
	 * The feature id for the '<em><b>Path Name CS</b></em>' containment reference.
4641
	 * <!-- begin-user-doc -->
4642
	 * <!-- end-user-doc -->
4643
	 * @generated
4644
	 * @ordered
4645
	 * @noreference This field is not intended to be referenced by clients.
4646
	 */
4647
	int OPERATION_CALL_EXP_CS_FEATURE_COUNT = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 0;
4648
4649
	/**
4650
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.StateExpCSImpl <em>State Exp CS</em>}' class.
4651
	 * <!-- begin-user-doc -->
4652
	 * <!-- end-user-doc -->
4653
	 * @see org.eclipse.ocl.cst.impl.StateExpCSImpl
4654
	 * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getStateExpCS()
4655
	 * @generated
4656
	 * @noreference This field is not intended to be referenced by clients.
4657
	 */
4658
	int STATE_EXP_CS = 49;
4659
4660
	/**
4661
	 * The feature id for the '<em><b>Start Offset</b></em>' attribute.
4662
	 * <!-- begin-user-doc -->
4663
	 * <!-- end-user-doc -->
4664
	 * @generated
4665
	 * @ordered
4666
	 * @noreference This field is not intended to be referenced by clients.
4667
	 */
4668
	int STATE_EXP_CS__START_OFFSET = TYPE_CS__START_OFFSET;
4669
4670
	/**
4671
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
4672
	 * <!-- begin-user-doc -->
4673
	 * <!-- end-user-doc -->
4674
	 * @generated
4675
	 * @ordered
4676
	 * @noreference This field is not intended to be referenced by clients.
4677
	 */
4678
	int STATE_EXP_CS__END_OFFSET = TYPE_CS__END_OFFSET;
4679
4680
	/**
4681
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
4682
	 * <!-- begin-user-doc -->
4683
	 * <!-- end-user-doc -->
4684
	 * @generated
4685
	 * @ordered
4686
	 * @noreference This field is not intended to be referenced by clients.
4687
	 */
4688
	int STATE_EXP_CS__START_TOKEN = TYPE_CS__START_TOKEN;
4689
4690
	/**
4691
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
4692
	 * <!-- begin-user-doc -->
4693
	 * <!-- end-user-doc -->
4694
	 * @generated
4695
	 * @ordered
4696
	 * @noreference This field is not intended to be referenced by clients.
4697
	 */
4698
	int STATE_EXP_CS__END_TOKEN = TYPE_CS__END_TOKEN;
4699
4700
	/**
4701
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
4702
	 * <!-- begin-user-doc -->
4703
	 * <!-- end-user-doc -->
4704
	 * @generated
4705
	 * @ordered
4706
	 * @noreference This field is not intended to be referenced by clients.
4707
	 */
4708
	int STATE_EXP_CS__AST = TYPE_CS__AST;
4709
4710
	/**
4711
	 * The feature id for the '<em><b>Simple Names</b></em>' containment reference list.
4712
	 * <!-- begin-user-doc -->
4661
	 * <!-- begin-user-doc -->
4713
	 * <!-- end-user-doc -->
4662
	 * <!-- end-user-doc -->
4714
	 * @generated
4663
	 * @generated
4715
	 * @ordered
4664
	 * @ordered
4716
	 * @noreference This field is not intended to be referenced by clients.
4665
	 * @noreference This field is not intended to be referenced by clients.
4717
	 */
4666
	 */
4718
	int STATE_EXP_CS__SIMPLE_NAMES = TYPE_CS_FEATURE_COUNT + 0;
4667
	int OPERATION_CALL_EXP_CS__PATH_NAME_CS = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 0;
4719
4668
4720
	/**
4669
	/**
4721
	 * The number of structural features of the '<em>State Exp CS</em>' class.
4670
	 * The number of structural features of the '<em>Operation Call Exp CS</em>' class.
4722
	 * <!-- begin-user-doc -->
4671
	 * <!-- begin-user-doc -->
4723
	 * <!-- end-user-doc -->
4672
	 * <!-- end-user-doc -->
4724
	 * @generated
4673
	 * @generated
4725
	 * @ordered
4674
	 * @ordered
4726
	 * @noreference This field is not intended to be referenced by clients.
4675
	 * @noreference This field is not intended to be referenced by clients.
4727
	 */
4676
	 */
4728
	int STATE_EXP_CS_FEATURE_COUNT = TYPE_CS_FEATURE_COUNT + 1;
4677
	int OPERATION_CALL_EXP_CS_FEATURE_COUNT = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 1;
4729
4678
4730
	/**
4679
	/**
4731
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class.
4680
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class.
Lines 4736-4742 Link Here
4736
	 * @generated
4685
	 * @generated
4737
	 * @noreference This field is not intended to be referenced by clients.
4686
	 * @noreference This field is not intended to be referenced by clients.
4738
	 */
4687
	 */
4739
	int OCL_DOCUMENT_CS = 50;
4688
	int OCL_DOCUMENT_CS = 49;
4740
4689
4741
	/**
4690
	/**
4742
	 * The feature id for the '<em><b>Start Offset</b></em>' attribute.
4691
	 * The feature id for the '<em><b>Start Offset</b></em>' attribute.
Lines 4817-4823 Link Here
4817
	 * @generated
4766
	 * @generated
4818
	 * @noreference This field is not intended to be referenced by clients.
4767
	 * @noreference This field is not intended to be referenced by clients.
4819
	 */
4768
	 */
4820
	int SIMPLE_TYPE_ENUM = 51;
4769
	int SIMPLE_TYPE_ENUM = 50;
4821
4770
4822
	/**
4771
	/**
4823
	 * The meta object id for the '{@link org.eclipse.ocl.cst.PrePostOrBodyEnum <em>Pre Post Or Body Enum</em>}' enum.
4772
	 * The meta object id for the '{@link org.eclipse.ocl.cst.PrePostOrBodyEnum <em>Pre Post Or Body Enum</em>}' enum.
Lines 4828-4834 Link Here
4828
	 * @generated
4777
	 * @generated
4829
	 * @noreference This field is not intended to be referenced by clients.
4778
	 * @noreference This field is not intended to be referenced by clients.
4830
	 */
4779
	 */
4831
	int PRE_POST_OR_BODY_ENUM = 52;
4780
	int PRE_POST_OR_BODY_ENUM = 51;
4832
4781
4833
	/**
4782
	/**
4834
	 * The meta object id for the '{@link org.eclipse.ocl.cst.CollectionTypeIdentifierEnum <em>Collection Type Identifier Enum</em>}' enum.
4783
	 * The meta object id for the '{@link org.eclipse.ocl.cst.CollectionTypeIdentifierEnum <em>Collection Type Identifier Enum</em>}' enum.
Lines 4839-4845 Link Here
4839
	 * @generated
4788
	 * @generated
4840
	 * @noreference This field is not intended to be referenced by clients.
4789
	 * @noreference This field is not intended to be referenced by clients.
4841
	 */
4790
	 */
4842
	int COLLECTION_TYPE_IDENTIFIER_ENUM = 53;
4791
	int COLLECTION_TYPE_IDENTIFIER_ENUM = 52;
4843
4792
4844
	/**
4793
	/**
4845
	 * The meta object id for the '{@link org.eclipse.ocl.cst.MessageExpKind <em>Message Exp Kind</em>}' enum.
4794
	 * The meta object id for the '{@link org.eclipse.ocl.cst.MessageExpKind <em>Message Exp Kind</em>}' enum.
Lines 4850-4856 Link Here
4850
	 * @generated
4799
	 * @generated
4851
	 * @noreference This field is not intended to be referenced by clients.
4800
	 * @noreference This field is not intended to be referenced by clients.
4852
	 */
4801
	 */
4853
	int MESSAGE_EXP_KIND = 54;
4802
	int MESSAGE_EXP_KIND = 53;
4854
4803
4855
	/**
4804
	/**
4856
	 * The meta object id for the '{@link org.eclipse.ocl.cst.DotOrArrowEnum <em>Dot Or Arrow Enum</em>}' enum.
4805
	 * The meta object id for the '{@link org.eclipse.ocl.cst.DotOrArrowEnum <em>Dot Or Arrow Enum</em>}' enum.
Lines 4861-4867 Link Here
4861
	 * @generated
4810
	 * @generated
4862
	 * @noreference This field is not intended to be referenced by clients.
4811
	 * @noreference This field is not intended to be referenced by clients.
4863
	 */
4812
	 */
4864
	int DOT_OR_ARROW_ENUM = 55;
4813
	int DOT_OR_ARROW_ENUM = 54;
4865
4814
4866
	/**
4815
	/**
4867
	 * The meta object id for the '<em>IToken</em>' data type.
4816
	 * The meta object id for the '<em>IToken</em>' data type.
Lines 4872-4878 Link Here
4872
	 * @generated
4821
	 * @generated
4873
	 * @noreference This field is not intended to be referenced by clients.
4822
	 * @noreference This field is not intended to be referenced by clients.
4874
	 */
4823
	 */
4875
	int ITOKEN = 56;
4824
	int ITOKEN = 55;
4876
4825
4877
	/**
4826
	/**
4878
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.CSTNode <em>Node</em>}'.
4827
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.CSTNode <em>Node</em>}'.
Lines 6231-6256 Link Here
6231
	EClass getOperationCallExpCS();
6180
	EClass getOperationCallExpCS();
6232
6181
6233
	/**
6182
	/**
6234
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.StateExpCS <em>State Exp CS</em>}'.
6183
	 * Returns the meta object for the containment reference '{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}'.
6235
	 * <!-- begin-user-doc -->
6236
	 * <!-- end-user-doc -->
6237
	 * @return the meta object for class '<em>State Exp CS</em>'.
6238
	 * @see org.eclipse.ocl.cst.StateExpCS
6239
	 * @generated
6240
	 */
6241
	EClass getStateExpCS();
6242
6243
	/**
6244
	 * Returns the meta object for the containment reference list '{@link org.eclipse.ocl.cst.StateExpCS#getSimpleNames <em>Simple Names</em>}'.
6245
	 * <!-- begin-user-doc -->
6184
	 * <!-- begin-user-doc -->
6246
	 * @since 3.0
6185
	 * @since 3.0
6247
	 * <!-- end-user-doc -->
6186
	 * <!-- end-user-doc -->
6248
	 * @return the meta object for the containment reference list '<em>Simple Names</em>'.
6187
	 * @return the meta object for the containment reference '<em>Path Name CS</em>'.
6249
	 * @see org.eclipse.ocl.cst.StateExpCS#getSimpleNames()
6188
	 * @see org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS()
6250
	 * @see #getStateExpCS()
6189
	 * @see #getOperationCallExpCS()
6251
	 * @generated
6190
	 * @generated
6252
	 */
6191
	 */
6253
	EReference getStateExpCS_SimpleNames();
6192
	EReference getOperationCallExpCS_PathNameCS();
6254
6193
6255
	/**
6194
	/**
6256
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'.
6195
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'.
Lines 7548-7571 Link Here
7548
		EClass OPERATION_CALL_EXP_CS = eINSTANCE.getOperationCallExpCS();
7487
		EClass OPERATION_CALL_EXP_CS = eINSTANCE.getOperationCallExpCS();
7549
7488
7550
		/**
7489
		/**
7551
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.StateExpCSImpl <em>State Exp CS</em>}' class.
7490
		 * The meta object literal for the '<em><b>Path Name CS</b></em>' containment reference feature.
7552
		 * <!-- begin-user-doc -->
7553
		 * <!-- end-user-doc -->
7554
		 * @see org.eclipse.ocl.cst.impl.StateExpCSImpl
7555
		 * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getStateExpCS()
7556
		 * @generated
7557
		 */
7558
		EClass STATE_EXP_CS = eINSTANCE.getStateExpCS();
7559
7560
		/**
7561
		 * The meta object literal for the '<em><b>Simple Names</b></em>' containment reference list feature.
7562
		 * <!-- begin-user-doc -->
7491
		 * <!-- begin-user-doc -->
7563
		 * @since 3.0
7492
		 * @since 3.0
7564
		 * <!-- end-user-doc -->
7493
		 * <!-- end-user-doc -->
7565
		 * @generated
7494
		 * @generated
7566
		 */
7495
		 */
7567
		EReference STATE_EXP_CS__SIMPLE_NAMES = eINSTANCE
7496
		EReference OPERATION_CALL_EXP_CS__PATH_NAME_CS = eINSTANCE
7568
			.getStateExpCS_SimpleNames();
7497
			.getOperationCallExpCS_PathNameCS();
7569
7498
7570
		/**
7499
		/**
7571
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class.
7500
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class.
(-)src/org/eclipse/ocl/cst/SimpleTypeEnum.java (-2 / +2 lines)
Lines 117-127 Link Here
117
	/**
117
	/**
118
	 * The '<em><b>Ocl Invalid</b></em>' literal object.
118
	 * The '<em><b>Ocl Invalid</b></em>' literal object.
119
	 * <!-- begin-user-doc -->
119
	 * <!-- begin-user-doc -->
120
	 * @since 3.0
120
	 * <!-- end-user-doc -->
121
	 * <!-- end-user-doc -->
121
	 * @see #OCL_INVALID
122
	 * @see #OCL_INVALID
122
	 * @generated
123
	 * @generated
123
	 * @ordered
124
	 * @ordered
124
	 * @since 3.0
125
	 */
125
	 */
126
	OCL_INVALID_LITERAL(9, "OclInvalid", "OclInvalid"), //$NON-NLS-1$ //$NON-NLS-2$
126
	OCL_INVALID_LITERAL(9, "OclInvalid", "OclInvalid"), //$NON-NLS-1$ //$NON-NLS-2$
127
127
Lines 282-293 Link Here
282
	 * If the meaning of '<em><b>Ocl Invalid</b></em>' literal object isn't clear,
282
	 * If the meaning of '<em><b>Ocl Invalid</b></em>' literal object isn't clear,
283
	 * there really should be more of a description here...
283
	 * there really should be more of a description here...
284
	 * </p>
284
	 * </p>
285
	 * @since 3.0
285
	 * <!-- end-user-doc -->
286
	 * <!-- end-user-doc -->
286
	 * @see #OCL_INVALID_LITERAL
287
	 * @see #OCL_INVALID_LITERAL
287
	 * @model name="OclInvalid"
288
	 * @model name="OclInvalid"
288
	 * @generated
289
	 * @generated
289
	 * @ordered
290
	 * @ordered
290
	 * @since 3.0
291
	 */
291
	 */
292
	public static final int OCL_INVALID = 9;
292
	public static final int OCL_INVALID = 9;
293
293
(-)src/org/eclipse/ocl/parser/AbstractOCLParser.java (-43 / +83 lines)
Lines 40-45 Link Here
40
import org.eclipse.ocl.cst.DefCS;
40
import org.eclipse.ocl.cst.DefCS;
41
import org.eclipse.ocl.cst.DefExpressionCS;
41
import org.eclipse.ocl.cst.DefExpressionCS;
42
import org.eclipse.ocl.cst.DerValueCS;
42
import org.eclipse.ocl.cst.DerValueCS;
43
import org.eclipse.ocl.cst.DotOrArrowEnum;
43
import org.eclipse.ocl.cst.EnumLiteralExpCS;
44
import org.eclipse.ocl.cst.EnumLiteralExpCS;
44
import org.eclipse.ocl.cst.FeatureCallExpCS;
45
import org.eclipse.ocl.cst.FeatureCallExpCS;
45
import org.eclipse.ocl.cst.IfExpCS;
46
import org.eclipse.ocl.cst.IfExpCS;
Lines 71-77 Link Here
71
import org.eclipse.ocl.cst.RealLiteralExpCS;
72
import org.eclipse.ocl.cst.RealLiteralExpCS;
72
import org.eclipse.ocl.cst.SimpleNameCS;
73
import org.eclipse.ocl.cst.SimpleNameCS;
73
import org.eclipse.ocl.cst.SimpleTypeEnum;
74
import org.eclipse.ocl.cst.SimpleTypeEnum;
74
import org.eclipse.ocl.cst.StateExpCS;
75
import org.eclipse.ocl.cst.StringLiteralExpCS;
75
import org.eclipse.ocl.cst.StringLiteralExpCS;
76
import org.eclipse.ocl.cst.TupleLiteralExpCS;
76
import org.eclipse.ocl.cst.TupleLiteralExpCS;
77
import org.eclipse.ocl.cst.TupleTypeCS;
77
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 274-285 Link Here
274
			SimpleTypeEnum.IDENTIFIER_LITERAL, simpleName), list, typeCS);
274
			SimpleTypeEnum.IDENTIFIER_LITERAL, simpleName), list, typeCS);
275
	}
275
	}
276
276
277
	protected OperationCallExpCS createOperationCallExpCS(
277
	/**
278
			OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS,
278
	 * @since 3.0
279
	 */
280
	private OperationCallExpCS createOperationCallExpCS(
281
			OCLExpressionCS oclExpressionCS, DotOrArrowEnum dotOrArrow, PathNameCS pathNameCS, SimpleNameCS simpleNameCS,
279
			IsMarkedPreCS isMarkedPreCS, EList<OCLExpressionCS> arguments) {
282
			IsMarkedPreCS isMarkedPreCS, EList<OCLExpressionCS> arguments) {
280
		OperationCallExpCS result = CSTFactory.eINSTANCE
283
		OperationCallExpCS result = CSTFactory.eINSTANCE
281
			.createOperationCallExpCS();
284
			.createOperationCallExpCS();
282
		result.setSource(oclExpressionCS);
285
		result.setSource(oclExpressionCS);
286
		result.setAccessor(dotOrArrow);
287
		result.setPathNameCS(pathNameCS);
283
		result.setSimpleNameCS(simpleNameCS);
288
		result.setSimpleNameCS(simpleNameCS);
284
		result.getArguments().addAll(arguments);
289
		result.getArguments().addAll(arguments);
285
290
Lines 305-343 Link Here
305
		return atPreCS != null;
310
		return atPreCS != null;
306
	}
311
	}
307
312
313
	/**
314
	 * @since 3.0
315
	 */
308
	protected OperationCallExpCS createOperationCallExpCS(
316
	protected OperationCallExpCS createOperationCallExpCS(
309
			OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS,
317
			OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS,
310
			EList<OCLExpressionCS> arguments) {
318
			EList<OCLExpressionCS> arguments) {
311
		return createOperationCallExpCS(oclExpressionCS, simpleNameCS,
319
		return createOperationCallExpCS(oclExpressionCS, null, null, simpleNameCS,
312
			null, arguments);
320
			null, arguments);
313
	}
321
	}
314
322
315
	protected OperationCallExpCS createOperationCallExpCS(
323
	/**
316
			SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS,
324
	 * @since 3.0
325
	 */
326
	protected OperationCallExpCS createArrowOperationCallExpCS(
327
			OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS,
317
			EList<OCLExpressionCS> arguments) {
328
			EList<OCLExpressionCS> arguments) {
318
		return createOperationCallExpCS(null, simpleNameCS, isMarkedPreCS,
329
		return createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.ARROW_LITERAL, null, simpleNameCS, isMarkedPreCS,
319
			arguments);
330
			arguments);
320
	}
331
	}
321
332
322
	protected OperationCallExpCS createOperationCallExpCS(
333
	/**
323
			SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS,
334
	 * @since 3.0
324
			StateExpCS stateExpCS) {
335
	 */
325
		OperationCallExpCS result = CSTFactory.eINSTANCE
336
	protected OperationCallExpCS createDotOperationCallExpCS(
326
			.createOperationCallExpCS();
337
			OCLExpressionCS oclExpressionCS, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS,
327
		result.setSimpleNameCS(simpleNameCS);
338
			EList<OCLExpressionCS> arguments) {
328
		result.getArguments().add(stateExpCS);
339
		return createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.DOT_LITERAL, pathNameCS, simpleNameCS, isMarkedPreCS,
329
340
			arguments);
330
		if (isAtPre(isMarkedPreCS)) {
331
			result.setIsMarkedPreCS(isMarkedPreCS);
332
		}
333
334
		return result;
335
	}
336
337
	protected StateExpCS createStateExpCS(PathNameCS pathName) {
338
		StateExpCS result = CSTFactory.eINSTANCE.createStateExpCS();
339
		result.getSimpleNames().addAll(pathName.getSimpleNames());
340
		return result;
341
	}
341
	}
342
342
343
	protected VariableExpCS createVariableExpCS(SimpleNameCS simpleNameCS,
343
	protected VariableExpCS createVariableExpCS(SimpleNameCS simpleNameCS,
Lines 364-370 Link Here
364
			String value) {
364
			String value) {
365
		PrimitiveTypeCS result = CSTFactory.eINSTANCE.createPrimitiveTypeCS();
365
		PrimitiveTypeCS result = CSTFactory.eINSTANCE.createPrimitiveTypeCS();
366
		result.setType(type);
366
		result.setType(type);
367
		result.setValue(value);
367
		result.setValue(unquote(value));
368
		return result;
368
		return result;
369
	}
369
	}
370
370
Lines 389-394 Link Here
389
		return CSTFactory.eINSTANCE.createPathNameCS();
389
		return CSTFactory.eINSTANCE.createPathNameCS();
390
	}
390
	}
391
391
392
	/**
393
	 * @since 3.0
394
	 */
395
	protected PathNameCS createPathNamePrefixCS(PathNameCS pathNameCS) {
396
		EList<SimpleNameCS> simpleNames = pathNameCS.getSimpleNames();
397
		int size = simpleNames.size();
398
		PathNameCS prefixPathNameCS = CSTFactory.eINSTANCE.createPathNameCS();
399
		if (size > 1) {
400
			for (int i = 0; i < size-1; i++) {
401
				extendPathNameCS(prefixPathNameCS, simpleNames.get(i));
402
			}
403
			setOffsets(prefixPathNameCS, prefixPathNameCS.getSimpleNames().get(0), prefixPathNameCS.getSimpleNames().get(size-2));
404
		}
405
		return prefixPathNameCS;
406
	}
407
	/**
408
	 * @since 3.0
409
	 */
410
	protected SimpleNameCS getPathNameSuffixCS(PathNameCS pathNameCS) {
411
		EList<SimpleNameCS> simpleNames = pathNameCS.getSimpleNames();
412
		int size = simpleNames.size();
413
		return size > 0 ? simpleNames.get(size-1) : null;
414
	}
415
416
	/**
417
	 * @since 3.0
418
	 */
392
	protected EnumLiteralExpCS createEnumLiteralExpCS(PathNameCS pathNameCS,
419
	protected EnumLiteralExpCS createEnumLiteralExpCS(PathNameCS pathNameCS,
393
			SimpleNameCS simpleNameCS) {
420
			SimpleNameCS simpleNameCS) {
394
		EnumLiteralExpCS result = CSTFactory.eINSTANCE.createEnumLiteralExpCS();
421
		EnumLiteralExpCS result = CSTFactory.eINSTANCE.createEnumLiteralExpCS();
Lines 398-419 Link Here
398
	}
425
	}
399
426
400
	/**
427
	/**
401
	 * @deprecated Use {@link #createEnumLiteralExpCS(PathNameCS, SimpleNameCS)}
428
	 * @since 3.0
402
	 *             , instead.
403
	 */
429
	 */
404
	@Deprecated
405
	protected EnumLiteralExpCS createEnumLiteralExpCS(PathNameCS pathNameCS,
406
			String simpleName) {
407
		return createEnumLiteralExpCS(pathNameCS, createSimpleNameCS(
408
			SimpleTypeEnum.IDENTIFIER_LITERAL, simpleName));
409
	}
410
411
	protected CollectionLiteralExpCS createCollectionLiteralExpCS(
430
	protected CollectionLiteralExpCS createCollectionLiteralExpCS(
412
			CollectionTypeIdentifierEnum type,
431
			CollectionTypeCS typeCS,
413
			EList<CollectionLiteralPartCS> collectionLiteralParts) {
432
			EList<CollectionLiteralPartCS> collectionLiteralParts) {
414
		CollectionLiteralExpCS result = CSTFactory.eINSTANCE
433
		CollectionLiteralExpCS result = CSTFactory.eINSTANCE
415
			.createCollectionLiteralExpCS();
434
			.createCollectionLiteralExpCS();
416
		result.setCollectionType(type);
435
		result.setCollectionType(typeCS.getCollectionTypeIdentifier());
417
		result.getCollectionLiteralParts().addAll(collectionLiteralParts);
436
		result.getCollectionLiteralParts().addAll(collectionLiteralParts);
418
		return result;
437
		return result;
419
	}
438
	}
Lines 518-527 Link Here
518
		return result;
537
		return result;
519
	}
538
	}
520
539
521
	protected IteratorExpCS createIteratorExpCS(SimpleNameCS simpleNameCS,
540
	/**
541
	 * @since 3.0
542
	 */
543
	protected IteratorExpCS createIteratorExpCS(
544
			OCLExpressionCS source, SimpleNameCS simpleNameCS,
522
			VariableCS variable1, VariableCS variable2,
545
			VariableCS variable1, VariableCS variable2,
523
			OCLExpressionCS oclExpressionCS) {
546
			OCLExpressionCS oclExpressionCS) {
524
		IteratorExpCS result = CSTFactory.eINSTANCE.createIteratorExpCS();
547
		IteratorExpCS result = CSTFactory.eINSTANCE.createIteratorExpCS();
548
		result.setSource(source);
549
		result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
525
		result.setSimpleNameCS(simpleNameCS);
550
		result.setSimpleNameCS(simpleNameCS);
526
		result.setVariable1(variable1);
551
		result.setVariable1(variable1);
527
		result.setVariable2(variable2);
552
		result.setVariable2(variable2);
Lines 529-538 Link Here
529
		return result;
554
		return result;
530
	}
555
	}
531
556
532
	protected IterateExpCS createIterateExpCS(SimpleNameCS simpleNameCS,
557
	/**
558
	 * @since 3.0
559
	 */
560
	protected IterateExpCS createIterateExpCS(
561
			OCLExpressionCS source, SimpleNameCS simpleNameCS,
533
			VariableCS variable1, VariableCS variable2,
562
			VariableCS variable1, VariableCS variable2,
534
			OCLExpressionCS oclExpressionCS) {
563
			OCLExpressionCS oclExpressionCS) {
535
		IterateExpCS result = CSTFactory.eINSTANCE.createIterateExpCS();
564
		IterateExpCS result = CSTFactory.eINSTANCE.createIterateExpCS();
565
		result.setSource(source);
566
		result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
536
		result.setSimpleNameCS(simpleNameCS);
567
		result.setSimpleNameCS(simpleNameCS);
537
		result.setVariable1(variable1);
568
		result.setVariable1(variable1);
538
		result.setVariable2(variable2);
569
		result.setVariable2(variable2);
Lines 549-559 Link Here
549
		return result;
580
		return result;
550
	}
581
	}
551
582
583
	/**
584
	 * @since 3.0
585
	 */
552
	protected CollectionTypeCS createCollectionTypeCS(
586
	protected CollectionTypeCS createCollectionTypeCS(
553
			CollectionTypeIdentifierEnum collectionType, TypeCS typeCS) {
587
			CollectionTypeIdentifierEnum collectionType, String value) {
554
		CollectionTypeCS result = CSTFactory.eINSTANCE.createCollectionTypeCS();
588
		CollectionTypeCS result = CSTFactory.eINSTANCE.createCollectionTypeCS();
589
		result.setType(SimpleTypeEnum.IDENTIFIER_LITERAL);
590
		result.setValue(unquote(value));
555
		result.setCollectionTypeIdentifier(collectionType);
591
		result.setCollectionTypeIdentifier(collectionType);
556
		result.setTypeCS(typeCS);
557
		return result;
592
		return result;
558
	}
593
	}
559
594
Lines 563-572 Link Here
563
		return result;
598
		return result;
564
	}
599
	}
565
600
601
	/**
602
	 * @since 3.0
603
	 */
566
	protected FeatureCallExpCS createFeatureCallExpCS(
604
	protected FeatureCallExpCS createFeatureCallExpCS(
567
			SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments,
605
			OCLExpressionCS source, SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments,
568
			IsMarkedPreCS isMarkedPreCS) {
606
			IsMarkedPreCS isMarkedPreCS) {
569
		FeatureCallExpCS result = CSTFactory.eINSTANCE.createFeatureCallExpCS();
607
		FeatureCallExpCS result = CSTFactory.eINSTANCE.createFeatureCallExpCS();
608
		result.setSource(source);
609
		result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
570
		result.setSimpleNameCS(simpleNameCS);
610
		result.setSimpleNameCS(simpleNameCS);
571
		result.getArguments().addAll(arguments);
611
		result.getArguments().addAll(arguments);
572
612
(-)src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java (-120 / +235 lines)
Lines 89-95 Link Here
89
import org.eclipse.ocl.cst.RealLiteralExpCS;
89
import org.eclipse.ocl.cst.RealLiteralExpCS;
90
import org.eclipse.ocl.cst.SimpleNameCS;
90
import org.eclipse.ocl.cst.SimpleNameCS;
91
import org.eclipse.ocl.cst.SimpleTypeEnum;
91
import org.eclipse.ocl.cst.SimpleTypeEnum;
92
import org.eclipse.ocl.cst.StateExpCS;
93
import org.eclipse.ocl.cst.StringLiteralExpCS;
92
import org.eclipse.ocl.cst.StringLiteralExpCS;
94
import org.eclipse.ocl.cst.TupleLiteralExpCS;
93
import org.eclipse.ocl.cst.TupleLiteralExpCS;
95
import org.eclipse.ocl.cst.TupleTypeCS;
94
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 290-303 Link Here
290
			case OCLParsersym.TK_collectNested :
289
			case OCLParsersym.TK_collectNested :
291
			case OCLParsersym.TK_sortedBy :
290
			case OCLParsersym.TK_sortedBy :
292
			case OCLParsersym.TK_closure :
291
			case OCLParsersym.TK_closure :
293
			case OCLParsersym.TK_oclIsKindOf :
294
			case OCLParsersym.TK_oclIsTypeOf :
295
			case OCLParsersym.TK_oclAsType :
296
			case OCLParsersym.TK_oclIsNew :
297
			case OCLParsersym.TK_oclIsUndefined :
298
			case OCLParsersym.TK_oclIsInvalid :
299
			case OCLParsersym.TK_oclIsInState :
300
			case OCLParsersym.TK_allInstances :
301
			case OCLParsersym.TK_String :
292
			case OCLParsersym.TK_String :
302
			case OCLParsersym.TK_Integer :
293
			case OCLParsersym.TK_Integer :
303
			case OCLParsersym.TK_UnlimitedNatural :
294
			case OCLParsersym.TK_UnlimitedNatural :
Lines 705-711 Link Here
705
			initASTMapping(packageEnv, createDummyPackage(env,
696
			initASTMapping(packageEnv, createDummyPackage(env,
706
				packageDeclarationCS), packageDeclarationCS);
697
				packageDeclarationCS), packageDeclarationCS);
707
		} else {
698
		} else {
708
			pathname = createSequenceOfNames(pathNameCS.getSimpleNames());
699
			pathname = createSequenceOfNames(pathNameCS, null);
709
			try {
700
			try {
710
				packageEnv = createPackageContext(getOCLEnvironment(), pathname);
701
				packageEnv = createPackageContext(getOCLEnvironment(), pathname);
711
				if (packageEnv != null) {
702
				if (packageEnv != null) {
Lines 826-833 Link Here
826
817
827
		O operation = null;
818
		O operation = null;
828
		C classifier = null;
819
		C classifier = null;
829
		EList<String> className = createSequenceOfNames(operationCS.getPathNameCS()
820
		EList<String> className = createSequenceOfNames(operationCS.getPathNameCS(), null);
830
			.getSimpleNames());
831
		String operationName = operationCS.getSimpleNameCS().getValue();
821
		String operationName = operationCS.getSimpleNameCS().getValue();
832
		EList<String> qualifiedOperationName = new BasicEList<String>();
822
		EList<String> qualifiedOperationName = new BasicEList<String>();
833
		qualifiedOperationName.addAll(className);
823
		qualifiedOperationName.addAll(className);
Lines 1132-1139 Link Here
1132
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env,
1122
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env,
1133
			List<CT> constraints) {
1123
			List<CT> constraints) {
1134
1124
1135
		EList<String> pathName = createSequenceOfNames(propertyContextCS.getPathNameCS()
1125
		EList<String> pathName = createSequenceOfNames(propertyContextCS.getPathNameCS(), null);
1136
			.getSimpleNames());
1137
		C owner = lookupClassifier(propertyContextCS.getPathNameCS(), env,
1126
		C owner = lookupClassifier(propertyContextCS.getPathNameCS(), env,
1138
			pathName);
1127
			pathName);
1139
1128
Lines 1348-1354 Link Here
1348
		Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> result = null;
1337
		Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> result = null;
1349
1338
1350
		PathNameCS pathNameCS = classifierContextDeclCS.getPathNameCS();
1339
		PathNameCS pathNameCS = classifierContextDeclCS.getPathNameCS();
1351
		EList<String> pathName = createSequenceOfNames(pathNameCS.getSimpleNames());
1340
		EList<String> pathName = createSequenceOfNames(pathNameCS, null);
1352
		C type = lookupClassifier(pathNameCS, env, pathName);
1341
		C type = lookupClassifier(pathNameCS, env, pathName);
1353
1342
1354
		if (type == null) {
1343
		if (type == null) {
Lines 1757-1763 Link Here
1757
			astNode = primitiveTypeCS(((PrimitiveTypeCS) typeCS).getType(), env);
1746
			astNode = primitiveTypeCS(((PrimitiveTypeCS) typeCS).getType(), env);
1758
			typeCS.setAst(astNode);
1747
			typeCS.setAst(astNode);
1759
		} else if (typeCS instanceof PathNameCS) {
1748
		} else if (typeCS instanceof PathNameCS) {
1760
			EList<String> pathName = createSequenceOfNames(((PathNameCS) typeCS).getSimpleNames());
1749
			EList<String> pathName = createSequenceOfNames((PathNameCS) typeCS, null);
1761
			astNode = lookupClassifier(typeCS, env, pathName);
1750
			astNode = lookupClassifier(typeCS, env, pathName);
1762
			if (astNode == null) {
1751
			if (astNode == null) {
1763
				String message = OCLMessages.bind(
1752
				String message = OCLMessages.bind(
Lines 1789-1797 Link Here
1789
	 * @param env
1778
	 * @param env
1790
	 *            the OCL environment
1779
	 *            the OCL environment
1791
	 * @return a <code>StateExp</code> representing the state
1780
	 * @return a <code>StateExp</code> representing the state
1781
	 * @since 3.0
1792
	 */
1782
	 */
1793
	protected StateExp<C, S> stateExpCS(OCLExpression<C> source,
1783
	protected StateExp<C, S> stateExpCS(OCLExpression<C> source,
1794
			StateExpCS stateExpCS,
1784
			CSTNode stateExpCS, EList<String> statePath,
1795
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
1785
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
1796
1786
1797
		C sourceType = null;
1787
		C sourceType = null;
Lines 1801-1808 Link Here
1801
1791
1802
		S state = null;
1792
		S state = null;
1803
1793
1804
		EList<String> statePath = createSequenceOfNames(stateExpCS.getSimpleNames());
1805
1806
		if (!statePath.isEmpty()) {
1794
		if (!statePath.isEmpty()) {
1807
			// to support content-assist, we can parse an expression that
1795
			// to support content-assist, we can parse an expression that
1808
			// has no state, to provide suggestions for the first part
1796
			// has no state, to provide suggestions for the first part
Lines 3283-3290 Link Here
3283
3271
3284
		OCLExpression<C> astNode = null;
3272
		OCLExpression<C> astNode = null;
3285
3273
3286
		List<SimpleNameCS> simpleNames = enumLiteralExpCS.getPathNameCS().getSimpleNames();
3274
		EList<String> sequenceOfNames = createSequenceOfNames(enumLiteralExpCS.getPathNameCS(), null);
3287
		EList<String> sequenceOfNames = createSequenceOfNames(simpleNames);
3288
		String lastToken = enumLiteralExpCS.getSimpleNameCS().getValue();
3275
		String lastToken = enumLiteralExpCS.getSimpleNameCS().getValue();
3289
3276
3290
		EL literal = null;
3277
		EL literal = null;
Lines 4009-4115 Link Here
4009
			OperationCallExpCS operationCallExpCS,
3996
			OperationCallExpCS operationCallExpCS,
4010
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
3997
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4011
3998
4012
		OperationCallExp<C, O> astNode = null;
4013
4014
		List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>();
4015
		// boolean isMarkedPre = false;
4016
4017
		String name = operationCallExpCS.getSimpleNameCS().getValue();
4018
		int operator = operationCallExpCS.getAccessor().getValue();
3999
		int operator = operationCallExpCS.getAccessor().getValue();
4019
4020
		/*
4021
		 * The type of the operation is specified by a path expression or self,
4022
		 * or by an explicit source expression. The source expression may be a
4023
		 * collection type (-> operation) or a regular navigation expression (.
4024
		 * operation)
4025
		 */
4026
		OCLExpression<C> source = null;
4027
		if (operator == DotOrArrowEnum.ARROW) {
4000
		if (operator == DotOrArrowEnum.ARROW) {
4028
			source = getCollectionSourceExpression(operationCallExpCS
4001
			return arrowOperationCallExpCS(operationCallExpCS, env);
4029
				.getSource(), env);
4002
		}
4030
		} else {
4003
		OCLExpressionCS sourceCS = operationCallExpCS.getSource();
4031
			OCLExpressionCS sourceCS = operationCallExpCS.getSource();
4004
		if ((sourceCS == null) && (operationCallExpCS.getPathNameCS() != null)) {
4032
4005
			return staticOperationCallExpCS(operationCallExpCS, env);
4033
			if (sourceCS instanceof PathNameCS) {
4034
				// static operation call
4035
				PathNameCS pathName = (PathNameCS) sourceCS;
4036
4037
				EList<String> pathNames = createSequenceOfNames(pathName
4038
					.getSimpleNames());
4039
				C sourceType = lookupClassifier(sourceCS, env, pathNames);
4040
				if (sourceType == null) {
4041
					String message = OCLMessages.bind(
4042
						OCLMessages.UnrecognizedType_ERROR_, pathNames);
4043
					ERROR(sourceCS, "operatonCallExpCS", message);//$NON-NLS-1$
4044
				} else {
4045
					source = typeCS(sourceCS, env, sourceType);
4046
				}
4047
			} else {
4048
				source = oclExpressionCS(operationCallExpCS.getSource(), env);
4049
			}
4050
		}
4006
		}
4051
4052
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4007
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4053
4054
		if (PredefinedType.OCL_IS_IN_STATE_NAME.equals(operationName)) {
4008
		if (PredefinedType.OCL_IS_IN_STATE_NAME.equals(operationName)) {
4055
			if (operationCallExpCS.getArguments().size() != 1) {
4009
			return oclIsInStateOperationCallExpCS(operationCallExpCS, env);
4056
				String message = OCLMessages.bind(
4057
					OCLMessages.IsInStateSignature_ERROR_,
4058
					computeInputString(operationCallExpCS));
4059
				ERROR(operationCallExpCS, "operationCallExpCS", message);//$NON-NLS-1$
4060
			}
4061
4062
			if (!operationCallExpCS.getArguments().isEmpty()) {
4063
				OCLExpressionCS arg = operationCallExpCS.getArguments().get(0);
4064
4065
				if (arg instanceof StateExpCS) {
4066
					args.add(stateExpCS(source, (StateExpCS) arg, env));
4067
				} else {
4068
					String message = OCLMessages.bind(
4069
						OCLMessages.IsInStateSignature_ERROR_,
4070
						computeInputString(operationCallExpCS));
4071
					ERROR(arg, "operationCallExpCS", message);//$NON-NLS-1$
4072
				}
4073
			}
4074
		} else {
4075
			for (OCLExpressionCS arg : operationCallExpCS.getArguments()) {
4076
				OCLExpression<C> argExpr = oclExpressionCS(arg, env);
4077
				if (argExpr == null) {
4078
					argExpr = createDummyInvalidLiteralExp(env, arg);
4079
					initASTMapping(env, argExpr, arg);
4080
				}
4081
				args.add(argExpr);
4082
			}
4083
		}
4010
		}
4084
4011
		OCLExpression<C> source = oclExpressionCS(operationCallExpCS.getSource(), env);
4085
		if (source == null) { // create an implicit source
4012
		List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env);
4086
			Variable<C, PM> implicitSource = lookupImplicitSourceForOperation(
4013
		if (source == null) { 						// create an implicit source
4087
				operationCallExpCS, env, args, operationName);
4014
			source = createImplicitSource(operationCallExpCS, env, args);
4088
			VariableExp<C, PM> vexp = createVariableExp(env,
4089
				operationCallExpCS, implicitSource);
4090
4091
			if (implicitSource == null) {
4092
				String errMessage = name + "(";//$NON-NLS-1$
4093
				for (int i = 0; i < args.size(); i++) {
4094
					if (i > 0) {
4095
						errMessage += ", ";//$NON-NLS-1$
4096
					}
4097
					errMessage += uml.getName(args.get(i).getType());
4098
				}
4099
				errMessage += ")";//$NON-NLS-1$
4100
				String message = OCLMessages.bind(
4101
					OCLMessages.IllegalSignature_ERROR_, errMessage);
4102
				ERROR(operationCallExpCS, "operationCallExpCS", message); //$NON-NLS-1$
4103
			}
4104
4105
			if (implicitSource != null) {
4106
				vexp.setType(implicitSource.getType());
4107
				vexp.setReferredVariable(implicitSource);
4108
			} else {
4109
				vexp.setType(getOclVoid());
4110
			}
4111
4112
			source = vexp;
4113
		}
4015
		}
4114
4016
4115
		/*
4017
		/*
Lines 4130-4136 Link Here
4130
		// if the sourceType is a TypeType then this must be a static operation
4032
		// if the sourceType is a TypeType then this must be a static operation
4131
		boolean isStatic = operationSourceType instanceof TypeType<?, ?>;
4033
		boolean isStatic = operationSourceType instanceof TypeType<?, ?>;
4132
4034
4133
		astNode = genOperationCallExp(env, operationCallExpCS,
4035
		OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS,
4134
			"operationCallExpCS", operationName,//$NON-NLS-1$
4036
			"operationCallExpCS", operationName,//$NON-NLS-1$
4135
			source, operationSourceType, args);
4037
			source, operationSourceType, args);
4136
		if (isStatic) {
4038
		if (isStatic) {
Lines 4170-4175 Link Here
4170
	}
4072
	}
4171
4073
4172
	/**
4074
	/**
4075
	 * @since 3.0
4076
	 */
4077
	protected OCLExpression<C> createImplicitSource(OperationCallExpCS operationCallExpCS,
4078
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env,
4079
			List<OCLExpression<C>> args) {
4080
4081
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4082
		Variable<C, PM> implicitSource = lookupImplicitSourceForOperation(
4083
			operationCallExpCS, env, args, operationName);
4084
		VariableExp<C, PM> vexp = createVariableExp(env, operationCallExpCS, implicitSource);
4085
4086
		if (implicitSource == null) {
4087
			String errMessage = operationName + "(";//$NON-NLS-1$
4088
			for (int i = 0; i < args.size(); i++) {
4089
				if (i > 0) {
4090
					errMessage += ", ";//$NON-NLS-1$
4091
				}
4092
				errMessage += uml.getName(args.get(i).getType());
4093
			}
4094
			errMessage += ")";//$NON-NLS-1$
4095
			String message = OCLMessages.bind(
4096
				OCLMessages.IllegalSignature_ERROR_, errMessage);
4097
			ERROR(operationCallExpCS, "operationCallExpCS", message); //$NON-NLS-1$
4098
		}
4099
4100
		if (implicitSource != null) {
4101
			vexp.setType(implicitSource.getType());
4102
			vexp.setReferredVariable(implicitSource);
4103
		} else {
4104
			vexp.setType(getOclVoid());
4105
		}
4106
		return vexp;
4107
	}
4108
4109
	/**
4110
	 * OperationCallExpCS for an ->
4111
	 * 
4112
	 * @param operationCallExpCS
4113
	 *            the <code>OperationCallExpCS</code> <code>CSTNode</code>
4114
	 * @param env
4115
	 *            the OCL environment
4116
	 * @return the parsed <code>OCLExpression</code>
4117
	 * @since 3.0
4118
	 */
4119
	protected OCLExpression<C> arrowOperationCallExpCS(
4120
			OperationCallExpCS operationCallExpCS,
4121
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4122
4123
		OCLExpression<C> source = getCollectionSourceExpression(operationCallExpCS.getSource(), env);
4124
		List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env);
4125
		
4126
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4127
		C operationSourceType = source.getType();
4128
		OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS,
4129
			"operationCallExpCS", operationName,//$NON-NLS-1$
4130
			source, operationSourceType, args);
4131
4132
		initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS());
4133
4134
		if (isErrorNode(source)) {
4135
			// don't attempt to parse navigation from an unparseable source
4136
			markAsErrorNode(astNode);
4137
		}
4138
4139
		return astNode;
4140
	}
4141
	/**
4142
	 * OperationCallExpCS for oclIsInState
4143
	 * 
4144
	 * @param operationCallExpCS
4145
	 *            the <code>OperationCallExpCS</code> <code>CSTNode</code>
4146
	 * @param env
4147
	 *            the OCL environment
4148
	 * @return the parsed <code>OCLExpression</code>
4149
	 * @since 3.0
4150
	 */
4151
	protected OCLExpression<C> oclIsInStateOperationCallExpCS(
4152
			OperationCallExpCS operationCallExpCS,
4153
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4154
		if (operationCallExpCS.getArguments().size() != 1) {
4155
			String message = OCLMessages.bind(
4156
				OCLMessages.IsInStateSignature_ERROR_,
4157
				computeInputString(operationCallExpCS));
4158
			ERROR(operationCallExpCS, "operationCallExpCS", message);//$NON-NLS-1$
4159
		}
4160
4161
		OCLExpression<C> source = oclExpressionCS(operationCallExpCS.getSource(), env);
4162
		List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>();
4163
		if (!operationCallExpCS.getArguments().isEmpty()) {
4164
			OCLExpressionCS arg = operationCallExpCS.getArguments().get(0);
4165
			if (arg instanceof VariableExpCS) {
4166
				VariableExpCS stateName = (VariableExpCS) arg;
4167
				EList<String> statePath = createSequenceOfNames(null, stateName.getSimpleNameCS());
4168
				args.add(stateExpCS(source, stateName, statePath, env));
4169
			} else if (arg instanceof EnumLiteralExpCS) {
4170
				EnumLiteralExpCS stateName = (EnumLiteralExpCS) arg;
4171
				EList<String> statePath = createSequenceOfNames(stateName.getPathNameCS(), stateName.getSimpleNameCS());
4172
				args.add(stateExpCS(source, stateName, statePath, env));
4173
			} else {
4174
				String message = OCLMessages.bind(
4175
					OCLMessages.IsInStateSignature_ERROR_,
4176
					computeInputString(operationCallExpCS));
4177
				ERROR(arg, "operationCallExpCS", message);//$NON-NLS-1$
4178
			}
4179
		}
4180
		if (source == null) { // create an implicit source
4181
			source = createImplicitSource(operationCallExpCS, env, args);
4182
		}
4183
		C operationSourceType = source.getType();
4184
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4185
		OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS,
4186
			"operationCallExpCS", operationName,//$NON-NLS-1$
4187
			source, operationSourceType, args);
4188
		astNode.setMarkedPre(isAtPre(operationCallExpCS));
4189
		initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS());
4190
		if (isErrorNode(source)) {
4191
			// don't attempt to parse navigation from an unparseable source
4192
			markAsErrorNode(astNode);
4193
		}
4194
		return astNode;
4195
	}
4196
	
4197
	/**
4198
	 * @since 3.0
4199
	 */
4200
	protected OCLExpression<C> staticOperationCallExpCS(
4201
		OperationCallExpCS operationCallExpCS,
4202
		Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4203
4204
	OCLExpression<C> source = null;
4205
//	OCLExpressionCS sourceCS = operationCallExpCS.getSource();
4206
	PathNameCS pathNameCS = operationCallExpCS.getPathNameCS();
4207
4208
	EList<String> pathNames = createSequenceOfNames(pathNameCS, null);
4209
	C sourceType = lookupClassifier(pathNameCS, env, pathNames);
4210
	if (sourceType == null) {
4211
		String message = OCLMessages.bind(
4212
			OCLMessages.UnrecognizedType_ERROR_, pathNames);
4213
		ERROR(operationCallExpCS, "operatonCallExpCS", message);//$NON-NLS-1$
4214
	} else {
4215
		source = typeCS(pathNameCS, env, sourceType);
4216
	}
4217
4218
	String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4219
4220
	List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env);
4221
4222
	/*
4223
	 * If the source type is a collection and operator is ".", then there is
4224
	 * an implicit COLLECT operator.
4225
	 */
4226
	C operationSourceType = source.getType();
4227
4228
	// if the sourceType is a TypeType then this must be a static operation
4229
	boolean isStatic = operationSourceType instanceof TypeType<?, ?>;
4230
4231
	OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS,
4232
		"operationCallExpCS", operationName,//$NON-NLS-1$
4233
		source, operationSourceType, args);
4234
	if (isStatic) {
4235
		@SuppressWarnings("unchecked")
4236
		TypeType<C, O> typeType = (TypeType<C, O>) operationSourceType;
4237
		O operation = astNode.getReferredOperation();
4238
4239
		// operation must either be defined by the TypeType (e.g.,
4240
		// allInstances())
4241
		// or be a static operation of the referred classifier
4242
		if (!(typeType.oclOperations().contains(operation) || uml
4243
			.isStatic(operation))) {
4244
4245
			String message = OCLMessages.bind(
4246
				OCLMessages.NonStaticOperation_ERROR_, operationName);
4247
			ERROR(astNode, "operationCallExpCS", message);//$NON-NLS-1$
4248
		}
4249
	}
4250
4251
//	astNode.setMarkedPre(isAtPre(operationCallExpCS));
4252
4253
	initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS());
4254
4255
	OCLExpression<C> result = astNode;
4256
4257
	if (isErrorNode(source)) {
4258
		// don't attempt to parse navigation from an unparseable source
4259
		markAsErrorNode(result);
4260
	}
4261
4262
	return result;
4263
}
4264
4265
	/**
4266
	 * @since 3.0
4267
	 */
4268
	protected List<OCLExpression<C>> argumentsCS(OperationCallExpCS operationCallExpCS,
4269
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4270
		List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>();
4271
		for (OCLExpressionCS arg : operationCallExpCS.getArguments()) {
4272
			OCLExpression<C> argExpr = oclExpressionCS(arg, env);
4273
			if (argExpr == null) {
4274
				argExpr = createDummyInvalidLiteralExp(env, arg);
4275
				initASTMapping(env, argExpr, arg);
4276
			}
4277
			args.add(argExpr);
4278
		}
4279
		return args;
4280
	}
4281
4282
	/**
4173
	 * MessageExpCS
4283
	 * MessageExpCS
4174
	 * 
4284
	 * 
4175
	 * @param messageExpCS
4285
	 * @param messageExpCS
Lines 4821-4830 Link Here
4821
	/**
4931
	/**
4822
	 * @since 3.0
4932
	 * @since 3.0
4823
	 */
4933
	 */
4824
	public static EList<String> createSequenceOfNames(List<SimpleNameCS> simpleNames) {
4934
	public static EList<String> createSequenceOfNames(PathNameCS pathNameCS, SimpleNameCS simpleNameCS) {
4825
		EList<String> sequenceOfNames = new BasicEList<String>();
4935
		EList<String> sequenceOfNames = new BasicEList<String>();
4826
		for (SimpleNameCS simpleName : simpleNames)
4936
		if (pathNameCS != null) {
4827
			sequenceOfNames.add(simpleName.getValue());
4937
			for (SimpleNameCS simpleName : pathNameCS.getSimpleNames())
4938
				sequenceOfNames.add(simpleName.getValue());
4939
		}
4940
		if (simpleNameCS != null) {
4941
			sequenceOfNames.add(simpleNameCS.getValue());
4942
		}
4828
		return sequenceOfNames;
4943
		return sequenceOfNames;
4829
	}
4944
	}
4830
4945
(-)src/org/eclipse/ocl/parser/OCLParser.g (-9 / +7 lines)
Lines 65-79 Link Here
65
65
66
$KeyWords
66
$KeyWords
67
	context
67
	context
68
	def
69
	endpackage
70
	inv
68
	package
71
	package
69
	
72
	post
70
	--
73
	pre
71
	-- the following are not used in the OCL concrete syntax, but
74
	static
72
	-- are defined as reserved words in the OCL 2.0 Spec 7.4.9
73
	-- and were removed in the OCL 2.1 RTF 09-05-02. 
74
	--
75
	attr
76
	oper
77
$End
75
$End
78
76
79
$Rules
77
$Rules
Lines 142-148 Link Here
142
	contextDeclCS -> operationContextDeclCS
140
	contextDeclCS -> operationContextDeclCS
143
	contextDeclCS -> propertyContextCS
141
	contextDeclCS -> propertyContextCS
144
142
145
	propertyContextCS ::= context pathNameCS '::' simpleNameCS ':' typeCS initOrDerValueCSm
143
	propertyContextCS ::= context pathNameCS '::' notReservedSimpleNameCS ':' typeCS initOrDerValueCSm
146
		/.$BeginJava
144
		/.$BeginJava
147
					EList<InitOrDerValueCS> list = (EList<InitOrDerValueCS>)$getSym(7);
145
					EList<InitOrDerValueCS> list = (EList<InitOrDerValueCS>)$getSym(7);
148
					CSTNode result = createPropertyContextCS(
146
					CSTNode result = createPropertyContextCS(
(-)src/org/eclipse/ocl/cst/util/CSTAdapterFactory.java (-22 / +1 lines)
Lines 21-28 Link Here
21
import org.eclipse.emf.common.notify.Notifier;
21
import org.eclipse.emf.common.notify.Notifier;
22
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
22
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
24
24
import org.eclipse.ocl.cst.*;
25
//import org.eclipse.ocl.cst.*;
26
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
25
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
27
import org.eclipse.ocl.cst.CSTNode;
26
import org.eclipse.ocl.cst.CSTNode;
28
import org.eclipse.ocl.cst.CSTPackage;
27
import org.eclipse.ocl.cst.CSTPackage;
Lines 67-73 Link Here
67
import org.eclipse.ocl.cst.PropertyContextCS;
66
import org.eclipse.ocl.cst.PropertyContextCS;
68
import org.eclipse.ocl.cst.RealLiteralExpCS;
67
import org.eclipse.ocl.cst.RealLiteralExpCS;
69
import org.eclipse.ocl.cst.SimpleNameCS;
68
import org.eclipse.ocl.cst.SimpleNameCS;
70
import org.eclipse.ocl.cst.StateExpCS;
71
import org.eclipse.ocl.cst.StringLiteralExpCS;
69
import org.eclipse.ocl.cst.StringLiteralExpCS;
72
import org.eclipse.ocl.cst.TupleLiteralExpCS;
70
import org.eclipse.ocl.cst.TupleLiteralExpCS;
73
import org.eclipse.ocl.cst.TupleTypeCS;
71
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 383-393 Link Here
383
		}
381
		}
384
382
385
		@Override
383
		@Override
386
		public Adapter caseStateExpCS(StateExpCS object) {
387
			return createStateExpCSAdapter();
388
		}
389
390
		@Override
391
		public Adapter caseOCLDocumentCS(OCLDocumentCS object) {
384
		public Adapter caseOCLDocumentCS(OCLDocumentCS object) {
392
			return createOCLDocumentCSAdapter();
385
			return createOCLDocumentCSAdapter();
393
		}
386
		}
Lines 1014-1033 Link Here
1014
	}
1007
	}
1015
1008
1016
	/**
1009
	/**
1017
	 * Creates a new adapter for an object of class '{@link org.eclipse.ocl.cst.StateExpCS <em>State Exp CS</em>}'.
1018
	 * <!-- begin-user-doc -->
1019
	 * This default implementation returns null so that we can easily ignore cases;
1020
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
1021
	 * <!-- end-user-doc -->
1022
	 * @return the new adapter.
1023
	 * @see org.eclipse.ocl.cst.StateExpCS
1024
	 * @generated
1025
	 */
1026
	public Adapter createStateExpCSAdapter() {
1027
		return null;
1028
	}
1029
1030
	/**
1031
	 * Creates a new adapter for an object of class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'.
1010
	 * Creates a new adapter for an object of class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'.
1032
	 * <!-- begin-user-doc -->
1011
	 * <!-- begin-user-doc -->
1033
	 * This default implementation returns null so that we can easily ignore cases;
1012
	 * This default implementation returns null so that we can easily ignore cases;
(-)src/org/eclipse/ocl/cst/util/CSTSwitch.java (-31 / +3 lines)
Lines 21-28 Link Here
21
21
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
24
24
import org.eclipse.ocl.cst.*;
25
//import org.eclipse.ocl.cst.*;
26
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
25
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
27
import org.eclipse.ocl.cst.CSTNode;
26
import org.eclipse.ocl.cst.CSTNode;
28
import org.eclipse.ocl.cst.CSTPackage;
27
import org.eclipse.ocl.cst.CSTPackage;
Lines 67-73 Link Here
67
import org.eclipse.ocl.cst.PropertyContextCS;
66
import org.eclipse.ocl.cst.PropertyContextCS;
68
import org.eclipse.ocl.cst.RealLiteralExpCS;
67
import org.eclipse.ocl.cst.RealLiteralExpCS;
69
import org.eclipse.ocl.cst.SimpleNameCS;
68
import org.eclipse.ocl.cst.SimpleNameCS;
70
import org.eclipse.ocl.cst.StateExpCS;
71
import org.eclipse.ocl.cst.StringLiteralExpCS;
69
import org.eclipse.ocl.cst.StringLiteralExpCS;
72
import org.eclipse.ocl.cst.TupleLiteralExpCS;
70
import org.eclipse.ocl.cst.TupleLiteralExpCS;
73
import org.eclipse.ocl.cst.TupleTypeCS;
71
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 401-406 Link Here
401
				CollectionTypeCS collectionTypeCS = (CollectionTypeCS) theEObject;
399
				CollectionTypeCS collectionTypeCS = (CollectionTypeCS) theEObject;
402
				T result = caseCollectionTypeCS(collectionTypeCS);
400
				T result = caseCollectionTypeCS(collectionTypeCS);
403
				if (result == null)
401
				if (result == null)
402
					result = caseSimpleNameCS(collectionTypeCS);
403
				if (result == null)
404
					result = caseTypeCS(collectionTypeCS);
404
					result = caseTypeCS(collectionTypeCS);
405
				if (result == null)
405
				if (result == null)
406
					result = caseOCLExpressionCS(collectionTypeCS);
406
					result = caseOCLExpressionCS(collectionTypeCS);
Lines 718-736 Link Here
718
					result = defaultCase(theEObject);
718
					result = defaultCase(theEObject);
719
				return result;
719
				return result;
720
			}
720
			}
721
			case CSTPackage.STATE_EXP_CS : {
722
				StateExpCS stateExpCS = (StateExpCS) theEObject;
723
				T result = caseStateExpCS(stateExpCS);
724
				if (result == null)
725
					result = caseTypeCS(stateExpCS);
726
				if (result == null)
727
					result = caseOCLExpressionCS(stateExpCS);
728
				if (result == null)
729
					result = caseCSTNode(stateExpCS);
730
				if (result == null)
731
					result = defaultCase(theEObject);
732
				return result;
733
			}
734
			case CSTPackage.OCL_DOCUMENT_CS : {
721
			case CSTPackage.OCL_DOCUMENT_CS : {
735
				OCLDocumentCS oclDocumentCS = (OCLDocumentCS) theEObject;
722
				OCLDocumentCS oclDocumentCS = (OCLDocumentCS) theEObject;
736
				T result = caseOCLDocumentCS(oclDocumentCS);
723
				T result = caseOCLDocumentCS(oclDocumentCS);
Lines 1452-1472 Link Here
1452
	}
1439
	}
1453
1440
1454
	/**
1441
	/**
1455
	 * Returns the result of interpreting the object as an instance of '<em>State Exp CS</em>'.
1456
	 * <!-- begin-user-doc -->
1457
	 * This implementation returns null;
1458
	 * returning a non-null result will terminate the switch.
1459
	 * <!-- end-user-doc -->
1460
	 * @param object the target of the switch.
1461
	 * @return the result of interpreting the object as an instance of '<em>State Exp CS</em>'.
1462
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
1463
	 * @generated
1464
	 */
1465
	public T caseStateExpCS(StateExpCS object) {
1466
		return null;
1467
	}
1468
1469
	/**
1470
	 * Returns the result of interpreting the object as an instance of '<em>OCL Document CS</em>'.
1442
	 * Returns the result of interpreting the object as an instance of '<em>OCL Document CS</em>'.
1471
	 * <!-- begin-user-doc -->
1443
	 * <!-- begin-user-doc -->
1472
	 * This implementation returns null;
1444
	 * This implementation returns null;
(-)model/OCLCST.genmodel (-3 / +2 lines)
Lines 289-298 Link Here
289
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
289
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
290
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/FeatureCallExpCS/isMarkedPreCS"/>
290
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/FeatureCallExpCS/isMarkedPreCS"/>
291
      </genClasses>
291
      </genClasses>
292
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OperationCallExpCS"/>
292
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OperationCallExpCS">
293
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/StateExpCS">
294
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
293
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
295
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/StateExpCS/simpleNames"/>
294
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/OperationCallExpCS/pathNameCS"/>
296
      </genClasses>
295
      </genClasses>
297
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OCLDocumentCS">
296
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OCLDocumentCS">
298
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
297
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
(-)model/OCLCST.uml (-7 / +4 lines)
Lines 353-358 Link Here
353
        <ownedEnd xmi:id="_qdx9lP8fEduhWtVvKtiQ7w" type="_qdx9j_8fEduhWtVvKtiQ7w" association="_qdx9k_8fEduhWtVvKtiQ7w"/>
353
        <ownedEnd xmi:id="_qdx9lP8fEduhWtVvKtiQ7w" type="_qdx9j_8fEduhWtVvKtiQ7w" association="_qdx9k_8fEduhWtVvKtiQ7w"/>
354
      </packagedElement>
354
      </packagedElement>
355
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx9lf8fEduhWtVvKtiQ7w" name="CollectionTypeCS">
355
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx9lf8fEduhWtVvKtiQ7w" name="CollectionTypeCS">
356
        <generalization xmi:id="_2NUGIJw2Ed6az7Hq7e93gA" general="_qdx83P8fEduhWtVvKtiQ7w"/>
356
        <generalization xmi:id="_qdx9lv8fEduhWtVvKtiQ7w" general="_qdx8xP8fEduhWtVvKtiQ7w"/>
357
        <generalization xmi:id="_qdx9lv8fEduhWtVvKtiQ7w" general="_qdx8xP8fEduhWtVvKtiQ7w"/>
357
        <ownedAttribute xmi:id="_qdx9l_8fEduhWtVvKtiQ7w" name="collectionTypeIdentifier" visibility="public" type="_qdx9m_8fEduhWtVvKtiQ7w" isOrdered="true">
358
        <ownedAttribute xmi:id="_qdx9l_8fEduhWtVvKtiQ7w" name="collectionTypeIdentifier" visibility="public" type="_qdx9m_8fEduhWtVvKtiQ7w" isOrdered="true">
358
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx9mP8fEduhWtVvKtiQ7w"/>
359
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx9mP8fEduhWtVvKtiQ7w"/>
Lines 652-663 Link Here
652
      </packagedElement>
653
      </packagedElement>
653
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-Vf8fEduhWtVvKtiQ7w" name="OperationCallExpCS">
654
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-Vf8fEduhWtVvKtiQ7w" name="OperationCallExpCS">
654
        <generalization xmi:id="_qdx-Vv8fEduhWtVvKtiQ7w" general="_qdx-Sv8fEduhWtVvKtiQ7w"/>
655
        <generalization xmi:id="_qdx-Vv8fEduhWtVvKtiQ7w" general="_qdx-Sv8fEduhWtVvKtiQ7w"/>
655
      </packagedElement>
656
        <ownedAttribute xmi:id="_uREjQJrAEd6qQcRgrpdjbQ" name="pathNameCS" type="_qdx8v_8fEduhWtVvKtiQ7w" isOrdered="true" aggregation="composite">
656
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-V_8fEduhWtVvKtiQ7w" name="StateExpCS">
657
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_uREjQZrAEd6qQcRgrpdjbQ"/>
657
        <generalization xmi:id="_qdx-WP8fEduhWtVvKtiQ7w" general="_qdx8xP8fEduhWtVvKtiQ7w"/>
658
        <ownedAttribute xmi:id="_pS7AEJPiEd6yA_hAShwLtA" name="simpleNames" type="_qdx83P8fEduhWtVvKtiQ7w" isOrdered="true" aggregation="composite">
659
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_pS7AEZPiEd6yA_hAShwLtA" value="*"/>
660
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_pS7AEpPiEd6yA_hAShwLtA"/>
661
        </ownedAttribute>
658
        </ownedAttribute>
662
      </packagedElement>
659
      </packagedElement>
663
      <packagedElement xmi:type="uml:PrimitiveType" xmi:id="_tvVQwI2FEd2mlKUM3HGxZg" name="IToken"/>
660
      <packagedElement xmi:type="uml:PrimitiveType" xmi:id="_tvVQwI2FEd2mlKUM3HGxZg" name="IToken"/>
Lines 857-863 Link Here
857
  <Ecore:EReference xmi:id="_qf-8Jf8fEduhWtVvKtiQ7w" base_Property="_qdx-TP8fEduhWtVvKtiQ7w"/>
854
  <Ecore:EReference xmi:id="_qf-8Jf8fEduhWtVvKtiQ7w" base_Property="_qdx-TP8fEduhWtVvKtiQ7w"/>
858
  <Ecore:EReference xmi:id="_qf-8Jv8fEduhWtVvKtiQ7w" base_Property="_qdx-T_8fEduhWtVvKtiQ7w"/>
855
  <Ecore:EReference xmi:id="_qf-8Jv8fEduhWtVvKtiQ7w" base_Property="_qdx-T_8fEduhWtVvKtiQ7w"/>
859
  <Ecore:EClass xmi:id="_qf-8J_8fEduhWtVvKtiQ7w" base_Class="_qdx-Vf8fEduhWtVvKtiQ7w"/>
856
  <Ecore:EClass xmi:id="_qf-8J_8fEduhWtVvKtiQ7w" base_Class="_qdx-Vf8fEduhWtVvKtiQ7w"/>
860
  <Ecore:EClass xmi:id="_qf-8KP8fEduhWtVvKtiQ7w" base_Class="_qdx-V_8fEduhWtVvKtiQ7w"/>
857
  <Ecore:EClass xmi:id="_qf-8KP8fEduhWtVvKtiQ7w"/>
861
  <Ecore:EAttribute xmi:id="_qf-8Kf8fEduhWtVvKtiQ7w"/>
858
  <Ecore:EAttribute xmi:id="_qf-8Kf8fEduhWtVvKtiQ7w"/>
862
  <Ecore:EDataType xmi:id="_wn-44I2FEd2mlKUM3HGxZg" instanceClassName="lpg.lpgjavaruntime.IToken" base_PrimitiveType="_tvVQwI2FEd2mlKUM3HGxZg"/>
859
  <Ecore:EDataType xmi:id="_wn-44I2FEd2mlKUM3HGxZg" instanceClassName="lpg.lpgjavaruntime.IToken" base_PrimitiveType="_tvVQwI2FEd2mlKUM3HGxZg"/>
863
  <Ecore:EAttribute xmi:id="_qkehgI2JEd2mlKUM3HGxZg" isTransient="true" base_Property="_PkTnII2GEd2mlKUM3HGxZg"/>
860
  <Ecore:EAttribute xmi:id="_qkehgI2JEd2mlKUM3HGxZg" isTransient="true" base_Property="_PkTnII2GEd2mlKUM3HGxZg"/>
(-)model/OCLCST.ecore (-5 / +4 lines)
Lines 163-169 Link Here
163
      <eStructuralFeatures xsi:type="ecore:EReference" name="variables" lowerBound="1"
163
      <eStructuralFeatures xsi:type="ecore:EReference" name="variables" lowerBound="1"
164
          upperBound="-1" eType="#//cst/VariableCS" containment="true"/>
164
          upperBound="-1" eType="#//cst/VariableCS" containment="true"/>
165
    </eClassifiers>
165
    </eClassifiers>
166
    <eClassifiers xsi:type="ecore:EClass" name="CollectionTypeCS" eSuperTypes="#//cst/TypeCS">
166
    <eClassifiers xsi:type="ecore:EClass" name="CollectionTypeCS" eSuperTypes="#//cst/SimpleNameCS #//cst/TypeCS">
167
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="collectionTypeIdentifier"
167
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="collectionTypeIdentifier"
168
          eType="#//cst/CollectionTypeIdentifierEnum"/>
168
          eType="#//cst/CollectionTypeIdentifierEnum"/>
169
      <eStructuralFeatures xsi:type="ecore:EReference" name="typeCS" eType="#//cst/TypeCS"
169
      <eStructuralFeatures xsi:type="ecore:EReference" name="typeCS" eType="#//cst/TypeCS"
Lines 302-311 Link Here
302
      <eStructuralFeatures xsi:type="ecore:EReference" name="isMarkedPreCS" eType="#//cst/IsMarkedPreCS"
302
      <eStructuralFeatures xsi:type="ecore:EReference" name="isMarkedPreCS" eType="#//cst/IsMarkedPreCS"
303
          containment="true"/>
303
          containment="true"/>
304
    </eClassifiers>
304
    </eClassifiers>
305
    <eClassifiers xsi:type="ecore:EClass" name="OperationCallExpCS" eSuperTypes="#//cst/FeatureCallExpCS"/>
305
    <eClassifiers xsi:type="ecore:EClass" name="OperationCallExpCS" eSuperTypes="#//cst/FeatureCallExpCS">
306
    <eClassifiers xsi:type="ecore:EClass" name="StateExpCS" eSuperTypes="#//cst/TypeCS">
306
      <eStructuralFeatures xsi:type="ecore:EReference" name="pathNameCS" eType="#//cst/PathNameCS"
307
      <eStructuralFeatures xsi:type="ecore:EReference" name="simpleNames" upperBound="-1"
307
          containment="true"/>
308
          eType="#//cst/SimpleNameCS" containment="true"/>
309
    </eClassifiers>
308
    </eClassifiers>
310
    <eClassifiers xsi:type="ecore:EClass" name="OCLDocumentCS" eSuperTypes="#//cst/CSTNode">
309
    <eClassifiers xsi:type="ecore:EClass" name="OCLDocumentCS" eSuperTypes="#//cst/CSTNode">
311
      <eStructuralFeatures xsi:type="ecore:EReference" name="packageDeclarations"
310
      <eStructuralFeatures xsi:type="ecore:EReference" name="packageDeclarations"
(-)src/org/eclipse/ocl/internal/helper/OCLSyntaxHelper.java (-7 / +15 lines)
Lines 825-831 Link Here
825
	}
825
	}
826
	
826
	
827
	/**
827
	/**
828
	 * Gets the type of token at the specified index in the list of tokens
828
	 * Gets the token at the specified index in the list of tokens
829
	 * represented by the given text.  Token indices count from zero, with
829
	 * represented by the given text.  Token indices count from zero, with
830
	 * negative indices counting backwards from the last token (-1 is the last,
830
	 * negative indices counting backwards from the last token (-1 is the last,
831
	 * -2 the next-to-last, etc.).
831
	 * -2 the next-to-last, etc.).
Lines 834-844 Link Here
834
	 * @param tokenIndex the token index to look at (negative indices count
834
	 * @param tokenIndex the token index to look at (negative indices count
835
	 *    backwards from the end)
835
	 *    backwards from the end)
836
	 *    
836
	 *    
837
	 * @return the token type at the index, or {@link OCLParsersym#TK_EOF_TOKEN}
837
	 * @return the token at the index, or null
838
	 *    if there is no token at the specified index
838
	 *    if there is no token at the specified index
839
	 */
839
	 */
840
	private int tokenAt(String text, int tokenIndex) {
840
	private IToken tokenAt(String text, int tokenIndex) {
841
		int result = OCLParsersym.TK_EOF_TOKEN;
841
		IToken result = null;
842
		List<IToken> tokens = tokenize(text);
842
		List<IToken> tokens = tokenize(text);
843
		
843
		
844
		if (tokenIndex < 0) {
844
		if (tokenIndex < 0) {
Lines 846-852 Link Here
846
		}
846
		}
847
		
847
		
848
		if ((tokenIndex >= 0) && (tokenIndex < tokens.size())) {
848
		if ((tokenIndex >= 0) && (tokenIndex < tokens.size())) {
849
			result = tokens.get(tokenIndex).getKind();
849
			result = tokens.get(tokenIndex);
850
		}
850
		}
851
		
851
		
852
		return result;
852
		return result;
Lines 963-969 Link Here
963
						if (iter.hasPrevious()) {
963
						if (iter.hasPrevious()) {
964
							prev = iter.previous();
964
							prev = iter.previous();
965
							
965
							
966
							if (prev.getKind() == OCLParsersym.TK_oclIsInState) {
966
							if (isOclIsInState(prev)) {
967
								syntaxHelpStringSuffix = OCL_IS_IN_STATE;
967
								syntaxHelpStringSuffix = OCL_IS_IN_STATE;
968
								position = prev.getStartOffset();
968
								position = prev.getStartOffset();
969
								break;
969
								break;
Lines 1000-1006 Link Here
1000
					result = getPathChoices(pathName);
1000
					result = getPathChoices(pathName);
1001
				}
1001
				}
1002
			} else if (txt.endsWith("(") // known BMP code point //$NON-NLS-1$
1002
			} else if (txt.endsWith("(") // known BMP code point //$NON-NLS-1$
1003
					&& (tokenAt(txt, -2) == OCLParsersym.TK_oclIsInState)) {
1003
					&& isOclIsInState(tokenAt(txt, -2))) {
1004
1004
1005
				syntaxHelpStringSuffix = OCL_IS_IN_STATE;
1005
				syntaxHelpStringSuffix = OCL_IS_IN_STATE;
1006
				
1006
				
Lines 1076-1081 Link Here
1076
		
1076
		
1077
		return result;
1077
		return result;
1078
	}
1078
	}
1079
1080
	protected boolean isOclIsInState(IToken token) {
1081
		if (token == null)
1082
			return false;
1083
		if (token.getKind() != OCLParsersym.TK_IDENTIFIER)
1084
			return false;
1085
		return PredefinedType.OCL_IS_IN_STATE_NAME.equals(token.toString());
1086
	}
1079
	
1087
	
1080
	/**
1088
	/**
1081
	 * Disposes not only the specified <tt>object</tt> but all of the objects
1089
	 * Disposes not only the specified <tt>object</tt> but all of the objects
(-)src/org/eclipse/ocl/parser/backtracking/EssentialOCLErrors.g (-26 / +29 lines)
Lines 57-66 Link Here
57
		  $EndJava
57
		  $EndJava
58
		./
58
		./
59
59
60
	attrOrNavCallExpCS ::= simpleNameCS '[' argumentsCS ERROR_TOKEN
60
	associationClassCallExpCS ::= notReservedSimpleNameCS '[' argumentsCS ERROR_TOKEN
61
		/.$BeginJava
61
		/.$BeginJava
62
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RBRACK);
62
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RBRACK);
63
					CSTNode result = createFeatureCallExpCS(
63
					CSTNode result = createVariableExpCS(
64
							(SimpleNameCS)$getSym(1),
64
							(SimpleNameCS)$getSym(1),
65
							(EList)$getSym(3),
65
							(EList)$getSym(3),
66
							null
66
							null
Lines 69-113 Link Here
69
					$setResult(result);
69
					$setResult(result);
70
		  $EndJava
70
		  $EndJava
71
		./
71
		./
72
		
72
	propertyCallExpCS ::= dotArrowExpCS '.' notReservedSimpleNameCS '[' argumentsCS ERROR_TOKEN
73
	collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ERROR_TOKEN
74
		/.$BeginJava
73
		/.$BeginJava
75
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN);
74
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
76
					Object[] objs = (Object[])$getSym(1);
75
					CallExpCS result = createFeatureCallExpCS(
77
					CSTNode result = createCollectionTypeCS(
76
							source,
78
							(CollectionTypeIdentifierEnum)objs[1],
77
							(SimpleNameCS)$getSym(3),
79
							(TypeCS)$getSym(3)
78
							(EList)$getSym(5),
79
							null
80
						);
80
						);
81
					setOffsets(result, (IToken)objs[0], getIToken($getToken(4)));
81
					setOffsets(result, source, getIToken($getToken(6)));
82
					$setResult(result);
82
					$setResult(result);
83
		  $EndJava
83
		  $EndJava
84
		./
84
		./
85
	collectionTypeCS ::= collectionTypeIdentifierCS ERROR_TOKEN
85
	propertyCallExpCS ::= dotArrowExpCS '.' ERROR_SimpleNameCS '[' argumentsCS ']' isMarkedPreCSopt
86
		/.$BeginJava
86
		/.$BeginJava
87
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN);
87
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
88
					Object[] objs = (Object[])$getSym(1);
88
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(7);
89
					CSTNode result = createCollectionTypeCS(
89
					CallExpCS result = createFeatureCallExpCS(
90
							(CollectionTypeIdentifierEnum)objs[1],
90
							source,
91
							null
91
							(SimpleNameCS)$getSym(3),
92
							(EList)$getSym(5),
93
							isMarkedPreCS
92
						);
94
						);
93
					setOffsets(result, (IToken)objs[0], getIToken($getToken(2)));
95
					if (isMarkedPreCS != null) {
96
						setOffsets(result, source, isMarkedPreCS);
97
					} else {
98
						setOffsets(result, source, getIToken($getToken(6)));
99
					}
94
					$setResult(result);
100
					$setResult(result);
95
		  $EndJava
101
		  $EndJava
96
		./
102
		./
97
103
		
98
	dotArrowExpCS ::=  pathNameCS '::' ERROR_SimpleNameCS '(' argumentsCSopt ')'
104
	collectionTypeCS ::= collectionSimpleNameCS '(' typeCS ERROR_TOKEN
99
		/.$BeginJava
105
		/.$BeginJava
100
					OperationCallExpCS result = createOperationCallExpCS(
106
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN);
101
							(PathNameCS)$getSym(1),
107
					CollectionTypeCS result = (CollectionTypeCS)dtParser.getSym(1); 
102
							(SimpleNameCS)$getSym(3),
108
					result.setTypeCS((TypeCS)dtParser.getSym(3));
103
							(EList)$getSym(5)
109
					setOffsets(result, result, getIToken($getToken(4)));
104
						);
105
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6)));
106
					result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
107
					$setResult(result);
110
					$setResult(result);
108
		  $EndJava
111
		  $EndJava
109
		./
112
		./
(-)FIXME (-50 / +117 lines)
Lines 122-155 Link Here
122
		  $EndJava
124
		  $EndJava
123
		./
125
		./
124
		
126
		
125
	featureCallExpCS ::= unaryName ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
127
	operationCallExpCS_B ::= dotArrowExpCS '->' ERROR_SimpleNameCS '(' argumentsCSopt ')'
126
		/.$NewCase./
128
		/.$BeginJava
127
	keywordOperationCallExpCS ::= keywordAsName ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
129
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
130
					CallExpCS result = createArrowOperationCallExpCS(
131
							source,
132
							(SimpleNameCS)$getSym(3),
133
							(IsMarkedPreCS)null,
134
							(EList)$getSym(5)
135
						);
136
					setOffsets(result, source, getIToken($getToken(6)));
137
					$setResult(result);
138
		  $EndJava
139
		./	
140
		
141
	operationCallExpCS_CE ::= dotArrowExpCS '.' ERROR_SimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')'
142
		/.$BeginJava
143
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
144
					CallExpCS result = createDotOperationCallExpCS(
145
							source,
146
							null,
147
							(SimpleNameCS)$getSym(3),
148
							(IsMarkedPreCS)$getSym(4),
149
							(EList)$getSym(6)
150
						);
151
					setOffsets(result, source, getIToken($getToken(7)));
152
					$setResult(result);
153
		  $EndJava
154
		./
155
	operationCallExpCS_CE ::= dotArrowExpCS '.' operationOrNotReservedSimpleNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
156
		/.$BeginJava
157
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
158
					CallExpCS result = createDotOperationCallExpCS(
159
							source,
160
							null,
161
							(SimpleNameCS)$getSym(3),
162
							(IsMarkedPreCS)$getSym(4),
163
							(EList)$getSym(6)
164
						);
165
					setOffsets(result, source, getIToken($getToken(7)));
166
					$setResult(result);
167
		  $EndJava
168
		./
169
		
170
	operationCallExpCS_DF ::= literalSimpleNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
128
		/.$NewCase./
171
		/.$NewCase./
129
	operationCallExpCS ::= binaryName ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
172
	operationCallExpCS_DF ::= notLiteralNorReservedSimpleNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
130
		/.$BeginJava
173
		/.$BeginJava
131
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
174
					CSTNode result = createDotOperationCallExpCS(
132
					CSTNode result = createOperationCallExpCS(
175
							null,
133
							simpleNameCS,
176
							null,
177
							(SimpleNameCS)$getSym(1),
134
							(IsMarkedPreCS)$getSym(2),
178
							(IsMarkedPreCS)$getSym(2),
135
							(EList)$getSym(4)
179
							(EList)$getSym(4)
136
						);
180
						);
137
					setOffsets(result, simpleNameCS, getIToken($getToken(5)));
181
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
138
					$setResult(result);
182
					$setResult(result);
139
		  $EndJava
183
		  $EndJava
140
		./
184
		./
141
	operationCallExpCS ::= oclIsInStateName ERROR_IsMarkedPreCS '(' stateExpCS ')'
185
186
	operationCallExpCS_G ::=  pathNameCS '::' ERROR_SimpleNameCS '(' argumentsCSopt ')'
142
		/.$BeginJava
187
		/.$BeginJava
143
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
188
					OperationCallExpCS result = createDotOperationCallExpCS(
144
					CSTNode result = createOperationCallExpCS(
189
							null,
145
							simpleNameCS,
190
							(PathNameCS)$getSym(1),
146
							(IsMarkedPreCS)$getSym(2),
191
							(SimpleNameCS)$getSym(3),
147
							(StateExpCS)$getSym(4)
192
							null,
193
							(EList)$getSym(5)
148
						);
194
						);
149
					setOffsets(result, simpleNameCS, getIToken($getToken(5)));
195
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6)));
196
					result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
150
					$setResult(result);
197
					$setResult(result);
151
		  $EndJava
198
		  $EndJava
152
		./
199
		./
200
		
201
	operationCallExpCS_IJ ::= dotArrowExpCS '.' pathNameCS '::' notReservedSimpleNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
202
		/.$BeginJava
203
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
204
					CallExpCS result = createDotOperationCallExpCS(
205
							source,
206
							(PathNameCS)$getSym(3),
207
							(SimpleNameCS)$getSym(5),
208
							(IsMarkedPreCS)$getSym(6),
209
							(EList)$getSym(8)
210
						);
211
					setOffsets(result, source, getIToken($getToken(9)));
212
					$setResult(result);
213
		  $EndJava
214
		./		
215
	operationCallExpCS_IJ ::= dotArrowExpCS '.' pathNameCS '::' ERROR_SimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')'
216
		/.$BeginJava
217
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
218
					CallExpCS result = createDotOperationCallExpCS(
219
							source,
220
							(PathNameCS)$getSym(3),
221
							(SimpleNameCS)$getSym(5),
222
							(IsMarkedPreCS)$getSym(6),
223
							(EList)$getSym(8)
224
						);
225
					setOffsets(result, source, getIToken($getToken(9)));
226
					$setResult(result);
227
		  $EndJava
228
		./	
153
229
154
	ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS ERROR_TOKEN
230
	ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS ERROR_TOKEN
155
		/.$BeginJava
231
		/.$BeginJava
Lines 200-230 Link Here
200
		  $EndJava
276
		  $EndJava
201
		./
277
		./
202
		
278
		
203
	messageExpCS ::= '^' simpleNameCS ERROR_TOKEN
279
	oclMessageExpCS ::= dotArrowExpCS '^' simpleNameCS ERROR_TOKEN
204
		/.$NewCase./
280
		/.$NewCase./
205
	messageExpCS ::= '^^' simpleNameCS ERROR_TOKEN
281
	oclMessageExpCS ::= dotArrowExpCS '^^' simpleNameCS ERROR_TOKEN
206
		/.$BeginJava
282
		/.$BeginJava
207
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS);
283
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS);
208
					CSTNode result = createMessageExpCS(
284
					MessageExpCS result = createMessageExpCS(
209
							getIToken($getToken(1)).getKind() == $sym_type.TK_CARET,
285
							getIToken($getToken(2)).getKind() == $sym_type.TK_CARET,
210
							(SimpleNameCS)$getSym(2),
286
							(SimpleNameCS)$getSym(3),
211
							new BasicEList<OCLMessageArgCS>()
287
							new BasicEList<OCLMessageArgCS>()
212
						);
288
						);
213
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
289
					result.setTarget((OCLExpressionCS)$getSym(1));
290
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4)));
214
					$setResult(result);
291
					$setResult(result);
215
		  $EndJava
292
		  $EndJava
216
		./
293
		./
217
	messageExpCS ::= '^' ERROR_SimpleNameCS
294
	oclMessageExpCS ::= dotArrowExpCS '^' ERROR_SimpleNameCS
218
		/.$NewCase./
295
		/.$NewCase./
219
	messageExpCS ::= '^^' ERROR_SimpleNameCS
296
	oclMessageExpCS ::= dotArrowExpCS '^^' ERROR_SimpleNameCS
220
		/.$BeginJava
297
		/.$BeginJava
221
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(2);
298
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
222
					CSTNode result = createMessageExpCS(
299
					MessageExpCS result = createMessageExpCS(
223
							getIToken($getToken(1)).getKind() == $sym_type.TK_CARET,
300
							getIToken($getToken(2)).getKind() == $sym_type.TK_CARET,
224
							simpleNameCS,
301
							simpleNameCS,
225
							new BasicEList<OCLMessageArgCS>()
302
							new BasicEList<OCLMessageArgCS>()
226
						);
303
						);
227
					setOffsets(result, getIToken($getToken(1)), simpleNameCS);
304
					result.setTarget((OCLExpressionCS)$getSym(1));
305
					setOffsets(result, (CSTNode)$getSym(1), simpleNameCS);
228
					$setResult(result);
306
					$setResult(result);
229
		  $EndJava
307
		  $EndJava
230
		./
308
		./
Lines 246-252 Link Here
246
		  $EndJava
324
		  $EndJava
247
		./
325
		./
248
326
249
	operationCS1 ::= IDENTIFIER '(' parametersCSopt ')' ERROR_Colon
327
	operationCS1 ::= literalSimpleNameCS '(' parametersCSopt ')' ERROR_Colon
328
		/.$NewCase./
329
	operationCS1 ::= notLiteralNorReservedSimpleNameCS '(' parametersCSopt ')' ERROR_Colon
250
		/.$BeginJava
330
		/.$BeginJava
251
					CSTNode result = createOperationCS(
331
					CSTNode result = createOperationCS(
252
							getTokenText($getToken(1)),
332
							getTokenText($getToken(1)),
Lines 257-263 Link Here
257
					$setResult(result);
337
					$setResult(result);
258
		  $EndJava
338
		  $EndJava
259
		./
339
		./
260
	operationCS1 ::= IDENTIFIER '(' parametersCSopt ERROR_TOKEN
340
	operationCS1 ::= literalSimpleNameCS '(' parametersCSopt ERROR_TOKEN
341
		/.$NewCase./
342
	operationCS1 ::= notLiteralNorReservedSimpleNameCS '(' parametersCSopt ERROR_TOKEN
261
		/.$BeginJava
343
		/.$BeginJava
262
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN);
344
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN);
263
					CSTNode result = createOperationCS(
345
					CSTNode result = createOperationCS(
Lines 269-275 Link Here
269
					$setResult(result);
351
					$setResult(result);
270
		  $EndJava
352
		  $EndJava
271
		./
353
		./
272
	operationCS1 ::= IDENTIFIER ERROR_TOKEN
354
	operationCS1 ::= literalSimpleNameCS ERROR_TOKEN
355
		/.$NewCase./
356
	operationCS1 ::= notLiteralNorReservedSimpleNameCS ERROR_TOKEN
273
		/.$BeginJava
357
		/.$BeginJava
274
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN);
358
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN);
275
					CSTNode result = createOperationCS(
359
					CSTNode result = createOperationCS(
Lines 293-299 Link Here
293
					$setResult(result);
377
					$setResult(result);
294
		  $EndJava
378
		  $EndJava
295
		./
379
		./
296
	operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ')' ERROR_Colon
380
	operationCS2 ::= pathNameCS '::' notReservedSimpleNameCS '(' parametersCSopt ')' ERROR_Colon
297
		/.$BeginJava
381
		/.$BeginJava
298
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
382
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
299
					CSTNode result = createOperationCS(
383
					CSTNode result = createOperationCS(
Lines 306-312 Link Here
306
					$setResult(result);
390
					$setResult(result);
307
		  $EndJava
391
		  $EndJava
308
		./
392
		./
309
	operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ERROR_TOKEN
393
	operationCS2 ::= pathNameCS '::' notReservedSimpleNameCS '(' parametersCSopt ERROR_TOKEN
310
		/.$BeginJava
394
		/.$BeginJava
311
					reportErrorTokenMessage($getToken(6), OCLParserErrors.MISSING_RPAREN);
395
					reportErrorTokenMessage($getToken(6), OCLParserErrors.MISSING_RPAREN);
312
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
396
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
Lines 320-326 Link Here
320
					$setResult(result);
404
					$setResult(result);
321
		  $EndJava
405
		  $EndJava
322
		./
406
		./
323
	operationCS2 ::= pathNameCS '::' simpleNameCS ERROR_TOKEN
407
	operationCS2 ::= pathNameCS '::' notReservedSimpleNameCS ERROR_TOKEN
324
		/.$BeginJava
408
		/.$BeginJava
325
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_LPAREN);
409
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_LPAREN);
326
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
410
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
Lines 375-381 Link Here
375
		  $EndJava
459
		  $EndJava
376
		./
460
		./
377
461
378
	variableCS ::= IDENTIFIER ERROR_TOKEN
462
	variableCS ::= notLiteralNorReservedSimpleNameCS ERROR_TOKEN
379
		/.$BeginJava
463
		/.$BeginJava
380
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE);
464
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE);
381
					CSTNode result = createVariableCS(
465
					CSTNode result = createVariableCS(
Lines 388-408 Link Here
388
		  $EndJava
472
		  $EndJava
389
		./
473
		./
390
474
391
	variableExpCS ::= simpleNameCS '[' argumentsCS ERROR_TOKEN
392
		/.$NewCase./
393
	variableExpCS ::= keywordAsName1 '[' argumentsCS ERROR_TOKEN
394
		/.$BeginJava
395
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RBRACK);
396
					CSTNode result = createVariableExpCS(
397
							(SimpleNameCS)$getSym(1),
398
							(EList)$getSym(3),
399
							null
400
						);
401
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4)));
402
					$setResult(result);
403
		  $EndJava
404
		./
405
406
	variableListCS ::= ERROR_TOKEN
475
	variableListCS ::= ERROR_TOKEN
407
		/.$NewCase./
476
		/.$NewCase./
408
	variableListCS2 ::= ERROR_TOKEN
477
	variableListCS2 ::= ERROR_TOKEN
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParser.g (+1 lines)
Lines 39-44 Link Here
39
%options action=("*.java", "/.", "./")
39
%options action=("*.java", "/.", "./")
40
%options ParseTable=lpg.lpgjavaruntime.ParseTable
40
%options ParseTable=lpg.lpgjavaruntime.ParseTable
41
%options include_directory=".;..;../../lpg"
41
%options include_directory=".;..;../../lpg"
42
%options verbose
42
43
43
$Include
44
$Include
44
	OCLParserErrors.g
45
	OCLParserErrors.g

Return to bug 184048