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 (-5 / +27 lines)
Lines 14-20 Link Here
14
 *
14
 *
15
 * </copyright>
15
 * </copyright>
16
 *
16
 *
17
 * $Id: BasicOCLTest.java,v 1.11 2009/10/07 20:39:29 ewillink Exp $
17
 * $Id: BasicOCLTest.java,v 1.10 2009/10/07 16:59:09 ewillink Exp $
18
 */
18
 */
19
19
20
package org.eclipse.ocl.ecore.tests;
20
package org.eclipse.ocl.ecore.tests;
Lines 260-265 Link Here
260
		assertFalse(check(expr, eCls));
260
		assertFalse(check(expr, eCls));
261
	}
261
	}
262
	
262
	
263
	public void testIfExpressions_184048() {
264
		EClass eCls = EcoreFactory.eINSTANCE.createEClass();
265
		eCls.setName("bar"); //$NON-NLS-1$
266
		
267
		OCLExpression<EClassifier> expr = parse(
268
			"package ecore context EClass " + //$NON-NLS-1$
269
			"inv: if self.abstract then name = 'bar' else name <> 'bar' endif ->asSequence()->at(1)" + //$NON-NLS-1$
270
			"endpackage "); //$NON-NLS-1$
271
		
272
		assertFalse(check(expr, eCls));
273
		
274
		eCls.setAbstract(true);
275
		
276
		assertTrue(check(expr, eCls));
277
		
278
		eCls.setName("foo"); //$NON-NLS-1$
279
		
280
		assertFalse(check(expr, eCls));
281
		
282
		OCLExpression<EClassifier> expr2 = parse(
283
			"package ecore context EClass " + //$NON-NLS-1$
284
			"inv: 7 = 1 + let a : String = invalid in 1 + if self.oclIsUndefined() then 1 else 5 endif " + //$NON-NLS-1$
285
			"endpackage "); //$NON-NLS-1$
286
		assertTrue(check(expr2, eCls));
287
	}
288
	
263
	public void testLetExpressions() {
289
	public void testLetExpressions() {
264
		EClass eCls = EcoreFactory.eINSTANCE.createEClass();
290
		EClass eCls = EcoreFactory.eINSTANCE.createEClass();
265
		eCls.setName("foo"); //$NON-NLS-1$
291
		eCls.setName("foo"); //$NON-NLS-1$
Lines 359-372 Link Here
359
		String self = ""; //$NON-NLS-1$
385
		String self = ""; //$NON-NLS-1$
360
386
361
		try {
387
		try {
362
			assertInvalidString("'\\\\\\ '"); //$NON-NLS-1$
363
			assertInvalidString("'str\\(ing'"); //$NON-NLS-1$
388
			assertInvalidString("'str\\(ing'"); //$NON-NLS-1$
364
			assertInvalidString("'string\\'"); //$NON-NLS-1$
389
			assertInvalidString("'string\\'"); //$NON-NLS-1$
365
			assertInvalidString("'string\\9'"); //$NON-NLS-1$
390
			assertInvalidString("'string\\9'"); //$NON-NLS-1$
366
391
367
			assertEquals("\\", //$NON-NLS-1$
368
				evaluate(helper, self, "'\\\\'")); //$NON-NLS-1$
369
370
			assertEquals("str\ning", //$NON-NLS-1$
392
			assertEquals("str\ning", //$NON-NLS-1$
371
				evaluate(helper, self, "'str\\ning'")); //$NON-NLS-1$
393
				evaluate(helper, self, "'str\\ning'")); //$NON-NLS-1$
372
394
(-)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/InvalidLiteralExpCSImpl.java (-126 / +1 lines)
Lines 17-25 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.ecore.EClass;
20
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.impl.ENotificationImpl;
23
import org.eclipse.ocl.cst.CSTPackage;
21
import org.eclipse.ocl.cst.CSTPackage;
24
import org.eclipse.ocl.cst.InvalidLiteralExpCS;
22
import org.eclipse.ocl.cst.InvalidLiteralExpCS;
25
23
Lines 28-66 Link Here
28
 * An implementation of the model object '<em><b>Invalid Literal Exp CS</b></em>'.
26
 * An implementation of the model object '<em><b>Invalid Literal Exp CS</b></em>'.
29
 * <!-- end-user-doc -->
27
 * <!-- end-user-doc -->
30
 * <p>
28
 * <p>
31
 * The following features are implemented:
32
 * <ul>
33
 *   <li>{@link org.eclipse.ocl.cst.impl.InvalidLiteralExpCSImpl#getSymbol <em>Symbol</em>}</li>
34
 * </ul>
35
 * </p>
29
 * </p>
36
 *
30
 *
37
 * @generated
31
 * @generated
38
 */
32
 */
39
public class InvalidLiteralExpCSImpl
33
public class InvalidLiteralExpCSImpl
40
		extends LiteralExpCSImpl
34
		extends SimpleNameCSImpl
41
		implements InvalidLiteralExpCS {
35
		implements InvalidLiteralExpCS {
42
36
43
	/**
37
	/**
44
	 * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
45
	 * <!-- begin-user-doc -->
46
	 * <!-- end-user-doc -->
47
	 * @see #getSymbol()
48
	 * @generated
49
	 * @ordered
50
	 */
51
	protected static final String SYMBOL_EDEFAULT = null;
52
53
	/**
54
	 * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
55
	 * <!-- begin-user-doc -->
56
	 * <!-- end-user-doc -->
57
	 * @see #getSymbol()
58
	 * @generated
59
	 * @ordered
60
	 */
61
	protected String symbol = SYMBOL_EDEFAULT;
62
63
	/**
64
	 * <!-- begin-user-doc -->
38
	 * <!-- begin-user-doc -->
65
	 * <!-- end-user-doc -->
39
	 * <!-- end-user-doc -->
66
	 * @generated
40
	 * @generated
Lines 79-181 Link Here
79
		return CSTPackage.Literals.INVALID_LITERAL_EXP_CS;
53
		return CSTPackage.Literals.INVALID_LITERAL_EXP_CS;
80
	}
54
	}
81
55
82
	/**
83
	 * <!-- begin-user-doc -->
84
	 * <!-- end-user-doc -->
85
	 * @generated
86
	 */
87
	public String getSymbol() {
88
		return symbol;
89
	}
90
91
	/**
92
	 * <!-- begin-user-doc -->
93
	 * <!-- end-user-doc -->
94
	 * @generated
95
	 */
96
	public void setSymbol(String newSymbol) {
97
		String oldSymbol = symbol;
98
		symbol = newSymbol;
99
		if (eNotificationRequired())
100
			eNotify(new ENotificationImpl(this, Notification.SET,
101
				CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL, oldSymbol, symbol));
102
	}
103
104
	/**
105
	 * <!-- begin-user-doc -->
106
	 * <!-- end-user-doc -->
107
	 * @generated
108
	 */
109
	@Override
110
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
111
		switch (featureID) {
112
			case CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL :
113
				return getSymbol();
114
		}
115
		return super.eGet(featureID, resolve, coreType);
116
	}
117
118
	/**
119
	 * <!-- begin-user-doc -->
120
	 * <!-- end-user-doc -->
121
	 * @generated
122
	 */
123
	@Override
124
	public void eSet(int featureID, Object newValue) {
125
		switch (featureID) {
126
			case CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL :
127
				setSymbol((String) newValue);
128
				return;
129
		}
130
		super.eSet(featureID, newValue);
131
	}
132
133
	/**
134
	 * <!-- begin-user-doc -->
135
	 * <!-- end-user-doc -->
136
	 * @generated
137
	 */
138
	@Override
139
	public void eUnset(int featureID) {
140
		switch (featureID) {
141
			case CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL :
142
				setSymbol(SYMBOL_EDEFAULT);
143
				return;
144
		}
145
		super.eUnset(featureID);
146
	}
147
148
	/**
149
	 * <!-- begin-user-doc -->
150
	 * <!-- end-user-doc -->
151
	 * @generated
152
	 */
153
	@Override
154
	public boolean eIsSet(int featureID) {
155
		switch (featureID) {
156
			case CSTPackage.INVALID_LITERAL_EXP_CS__SYMBOL :
157
				return SYMBOL_EDEFAULT == null
158
					? symbol != null
159
					: !SYMBOL_EDEFAULT.equals(symbol);
160
		}
161
		return super.eIsSet(featureID);
162
	}
163
164
	/**
165
	 * <!-- begin-user-doc -->
166
	 * <!-- end-user-doc -->
167
	 * @generated
168
	 */
169
	@Override
170
	public String toString() {
171
		if (eIsProxy())
172
			return super.toString();
173
174
		StringBuffer result = new StringBuffer(super.toString());
175
		result.append(" (symbol: "); //$NON-NLS-1$
176
		result.append(symbol);
177
		result.append(')');
178
		return result.toString();
179
	}
180
181
} //InvalidLiteralExpCSImpl
56
} //InvalidLiteralExpCSImpl
(-)src/org/eclipse/ocl/cst/impl/BooleanLiteralExpCSImpl.java (-2 / +113 lines)
Lines 22-27 Link Here
22
import org.eclipse.emf.ecore.impl.ENotificationImpl;
22
import org.eclipse.emf.ecore.impl.ENotificationImpl;
23
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
23
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
24
import org.eclipse.ocl.cst.CSTPackage;
24
import org.eclipse.ocl.cst.CSTPackage;
25
import org.eclipse.ocl.cst.LiteralExpCS;
26
import org.eclipse.ocl.cst.PrimitiveLiteralExpCS;
25
27
26
/**
28
/**
27
 * <!-- begin-user-doc -->
29
 * <!-- begin-user-doc -->
Lines 30-35 Link Here
30
 * <p>
32
 * <p>
31
 * The following features are implemented:
33
 * The following features are implemented:
32
 * <ul>
34
 * <ul>
35
 *   <li>{@link org.eclipse.ocl.cst.impl.BooleanLiteralExpCSImpl#getSymbol <em>Symbol</em>}</li>
33
 *   <li>{@link org.eclipse.ocl.cst.impl.BooleanLiteralExpCSImpl#getBooleanSymbol <em>Boolean Symbol</em>}</li>
36
 *   <li>{@link org.eclipse.ocl.cst.impl.BooleanLiteralExpCSImpl#getBooleanSymbol <em>Boolean Symbol</em>}</li>
34
 * </ul>
37
 * </ul>
35
 * </p>
38
 * </p>
Lines 37-46 Link Here
37
 * @generated
40
 * @generated
38
 */
41
 */
39
public class BooleanLiteralExpCSImpl
42
public class BooleanLiteralExpCSImpl
40
		extends PrimitiveLiteralExpCSImpl
43
		extends SimpleNameCSImpl
41
		implements BooleanLiteralExpCS {
44
		implements BooleanLiteralExpCS {
42
45
43
	/**
46
	/**
47
	 * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
48
	 * <!-- begin-user-doc -->
49
	 * @since 3.0
50
	 * <!-- end-user-doc -->
51
	 * @see #getSymbol()
52
	 * @generated
53
	 * @ordered
54
	 * 
55
	 */
56
	protected static final String SYMBOL_EDEFAULT = null;
57
58
	/**
59
	 * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
60
	 * <!-- begin-user-doc -->
61
	 * @since 3.0
62
	 * <!-- end-user-doc -->
63
	 * @see #getSymbol()
64
	 * @generated
65
	 * @ordered
66
	 * 
67
	 */
68
	protected String symbol = SYMBOL_EDEFAULT;
69
70
	/**
44
	 * The default value of the '{@link #getBooleanSymbol() <em>Boolean Symbol</em>}' attribute.
71
	 * The default value of the '{@link #getBooleanSymbol() <em>Boolean Symbol</em>}' attribute.
45
	 * <!-- begin-user-doc -->
72
	 * <!-- begin-user-doc -->
46
	 * <!-- end-user-doc -->
73
	 * <!-- end-user-doc -->
Lines 84-89 Link Here
84
	 * <!-- end-user-doc -->
111
	 * <!-- end-user-doc -->
85
	 * @generated
112
	 * @generated
86
	 */
113
	 */
114
	public String getSymbol() {
115
		return symbol;
116
	}
117
118
	/**
119
	 * <!-- begin-user-doc -->
120
	 * <!-- end-user-doc -->
121
	 * @generated
122
	 */
123
	public void setSymbol(String newSymbol) {
124
		String oldSymbol = symbol;
125
		symbol = newSymbol;
126
		if (eNotificationRequired())
127
			eNotify(new ENotificationImpl(this, Notification.SET,
128
				CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL, oldSymbol, symbol));
129
	}
130
131
	/**
132
	 * <!-- begin-user-doc -->
133
	 * <!-- end-user-doc -->
134
	 * @generated
135
	 */
87
	public Boolean getBooleanSymbol() {
136
	public Boolean getBooleanSymbol() {
88
		return booleanSymbol;
137
		return booleanSymbol;
89
	}
138
	}
Lines 110-115 Link Here
110
	@Override
159
	@Override
111
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
160
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
112
		switch (featureID) {
161
		switch (featureID) {
162
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL :
163
				return getSymbol();
113
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL :
164
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL :
114
				return getBooleanSymbol();
165
				return getBooleanSymbol();
115
		}
166
		}
Lines 124-129 Link Here
124
	@Override
175
	@Override
125
	public void eSet(int featureID, Object newValue) {
176
	public void eSet(int featureID, Object newValue) {
126
		switch (featureID) {
177
		switch (featureID) {
178
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL :
179
				setSymbol((String) newValue);
180
				return;
127
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL :
181
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL :
128
				setBooleanSymbol((Boolean) newValue);
182
				setBooleanSymbol((Boolean) newValue);
129
				return;
183
				return;
Lines 139-144 Link Here
139
	@Override
193
	@Override
140
	public void eUnset(int featureID) {
194
	public void eUnset(int featureID) {
141
		switch (featureID) {
195
		switch (featureID) {
196
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL :
197
				setSymbol(SYMBOL_EDEFAULT);
198
				return;
142
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL :
199
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL :
143
				setBooleanSymbol(BOOLEAN_SYMBOL_EDEFAULT);
200
				setBooleanSymbol(BOOLEAN_SYMBOL_EDEFAULT);
144
				return;
201
				return;
Lines 154-159 Link Here
154
	@Override
211
	@Override
155
	public boolean eIsSet(int featureID) {
212
	public boolean eIsSet(int featureID) {
156
		switch (featureID) {
213
		switch (featureID) {
214
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL :
215
				return SYMBOL_EDEFAULT == null
216
					? symbol != null
217
					: !SYMBOL_EDEFAULT.equals(symbol);
157
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL :
218
			case CSTPackage.BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL :
158
				return BOOLEAN_SYMBOL_EDEFAULT == null
219
				return BOOLEAN_SYMBOL_EDEFAULT == null
159
					? booleanSymbol != null
220
					? booleanSymbol != null
Lines 168-179 Link Here
168
	 * @generated
229
	 * @generated
169
	 */
230
	 */
170
	@Override
231
	@Override
232
	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
233
		if (baseClass == LiteralExpCS.class) {
234
			switch (derivedFeatureID) {
235
				default :
236
					return -1;
237
			}
238
		}
239
		if (baseClass == PrimitiveLiteralExpCS.class) {
240
			switch (derivedFeatureID) {
241
				case CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL :
242
					return CSTPackage.PRIMITIVE_LITERAL_EXP_CS__SYMBOL;
243
				default :
244
					return -1;
245
			}
246
		}
247
		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
248
	}
249
250
	/**
251
	 * <!-- begin-user-doc -->
252
	 * <!-- end-user-doc -->
253
	 * @generated
254
	 */
255
	@Override
256
	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
257
		if (baseClass == LiteralExpCS.class) {
258
			switch (baseFeatureID) {
259
				default :
260
					return -1;
261
			}
262
		}
263
		if (baseClass == PrimitiveLiteralExpCS.class) {
264
			switch (baseFeatureID) {
265
				case CSTPackage.PRIMITIVE_LITERAL_EXP_CS__SYMBOL :
266
					return CSTPackage.BOOLEAN_LITERAL_EXP_CS__SYMBOL;
267
				default :
268
					return -1;
269
			}
270
		}
271
		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
272
	}
273
274
	/**
275
	 * <!-- begin-user-doc -->
276
	 * <!-- end-user-doc -->
277
	 * @generated
278
	 */
279
	@Override
171
	public String toString() {
280
	public String toString() {
172
		if (eIsProxy())
281
		if (eIsProxy())
173
			return super.toString();
282
			return super.toString();
174
283
175
		StringBuffer result = new StringBuffer(super.toString());
284
		StringBuffer result = new StringBuffer(super.toString());
176
		result.append(" (booleanSymbol: "); //$NON-NLS-1$
285
		result.append(" (symbol: "); //$NON-NLS-1$
286
		result.append(symbol);
287
		result.append(", booleanSymbol: "); //$NON-NLS-1$
177
		result.append(booleanSymbol);
288
		result.append(booleanSymbol);
178
		result.append(')');
289
		result.append(')');
179
		return result.toString();
290
		return result.toString();
(-)src/org/eclipse/ocl/cst/impl/CSTPackageImpl.java (-73 / +24 lines)
Lines 76-82 Link Here
76
import org.eclipse.ocl.cst.RealLiteralExpCS;
76
import org.eclipse.ocl.cst.RealLiteralExpCS;
77
import org.eclipse.ocl.cst.SimpleNameCS;
77
import org.eclipse.ocl.cst.SimpleNameCS;
78
import org.eclipse.ocl.cst.SimpleTypeEnum;
78
import org.eclipse.ocl.cst.SimpleTypeEnum;
79
import org.eclipse.ocl.cst.StateExpCS;
80
import org.eclipse.ocl.cst.StringLiteralExpCS;
79
import org.eclipse.ocl.cst.StringLiteralExpCS;
81
import org.eclipse.ocl.cst.TupleLiteralExpCS;
80
import org.eclipse.ocl.cst.TupleLiteralExpCS;
82
import org.eclipse.ocl.cst.TupleTypeCS;
81
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 401-413 Link Here
401
	 * <!-- end-user-doc -->
400
	 * <!-- end-user-doc -->
402
	 * @generated
401
	 * @generated
403
	 */
402
	 */
404
	private EClass stateExpCSEClass = null;
405
406
	/**
407
	 * <!-- begin-user-doc -->
408
	 * <!-- end-user-doc -->
409
	 * @generated
410
	 */
411
	private EClass oclDocumentCSEClass = null;
403
	private EClass oclDocumentCSEClass = null;
412
404
413
	/**
405
	/**
Lines 1511-1520 Link Here
1511
	 * @since 3.0
1503
	 * @since 3.0
1512
	 * <!-- end-user-doc -->
1504
	 * <!-- end-user-doc -->
1513
	 * @generated
1505
	 * @generated
1506
	 * 
1507
	 */
1508
	public EReference getOperationCallExpCS_PathNameCS() {
1509
		return (EReference) operationCallExpCSEClass.getEStructuralFeatures()
1510
			.get(0);
1511
	}
1512
1513
	/**
1514
	 * <!-- begin-user-doc -->
1515
	 * @since 3.0
1516
	 * <!-- end-user-doc -->
1517
	 * @generated
1514
	 */
1518
	 */
1515
	public EAttribute getOperationCallExpCS_IsAtomic() {
1519
	public EAttribute getOperationCallExpCS_IsAtomic() {
1516
		return (EAttribute) operationCallExpCSEClass.getEStructuralFeatures()
1520
		return (EAttribute) operationCallExpCSEClass.getEStructuralFeatures()
1517
			.get(0);
1521
			.get(1);
1518
	}
1522
	}
1519
1523
1520
	/**
1524
	/**
Lines 1578-1602 Link Here
1578
1582
1579
	/**
1583
	/**
1580
	 * <!-- begin-user-doc -->
1584
	 * <!-- begin-user-doc -->
1581
	 * <!-- end-user-doc -->
1582
	 * @generated
1583
	 */
1584
	public EClass getStateExpCS() {
1585
		return stateExpCSEClass;
1586
	}
1587
1588
	/**
1589
	 * <!-- begin-user-doc -->
1590
	 * @since 3.0
1591
	 * <!-- end-user-doc -->
1592
	 * @generated
1593
	 */
1594
	public EReference getStateExpCS_SimpleNames() {
1595
		return (EReference) stateExpCSEClass.getEStructuralFeatures().get(0);
1596
	}
1597
1598
	/**
1599
	 * <!-- begin-user-doc -->
1600
	 * @since 1.3
1585
	 * @since 1.3
1601
	 * <!-- end-user-doc -->
1586
	 * <!-- end-user-doc -->
1602
	 * @generated
1587
	 * @generated
Lines 1710-1725 Link Here
1710
	 * <!-- end-user-doc -->
1695
	 * <!-- end-user-doc -->
1711
	 * @generated
1696
	 * @generated
1712
	 */
1697
	 */
1713
	public EAttribute getNullLiteralExpCS_Symbol() {
1714
		return (EAttribute) nullLiteralExpCSEClass.getEStructuralFeatures()
1715
			.get(0);
1716
	}
1717
1718
	/**
1719
	 * <!-- begin-user-doc -->
1720
	 * <!-- end-user-doc -->
1721
	 * @generated
1722
	 */
1723
	public EClass getInvalidLiteralExpCS() {
1698
	public EClass getInvalidLiteralExpCS() {
1724
		return invalidLiteralExpCSEClass;
1699
		return invalidLiteralExpCSEClass;
1725
	}
1700
	}
Lines 1729-1744 Link Here
1729
	 * <!-- end-user-doc -->
1704
	 * <!-- end-user-doc -->
1730
	 * @generated
1705
	 * @generated
1731
	 */
1706
	 */
1732
	public EAttribute getInvalidLiteralExpCS_Symbol() {
1733
		return (EAttribute) invalidLiteralExpCSEClass.getEStructuralFeatures()
1734
			.get(0);
1735
	}
1736
1737
	/**
1738
	 * <!-- begin-user-doc -->
1739
	 * <!-- end-user-doc -->
1740
	 * @generated
1741
	 */
1742
	public EClass getCallExpCS() {
1707
	public EClass getCallExpCS() {
1743
		return callExpCSEClass;
1708
		return callExpCSEClass;
1744
	}
1709
	}
Lines 2060-2070 Link Here
2060
			BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL);
2025
			BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL);
2061
2026
2062
		nullLiteralExpCSEClass = createEClass(NULL_LITERAL_EXP_CS);
2027
		nullLiteralExpCSEClass = createEClass(NULL_LITERAL_EXP_CS);
2063
		createEAttribute(nullLiteralExpCSEClass, NULL_LITERAL_EXP_CS__SYMBOL);
2064
2028
2065
		invalidLiteralExpCSEClass = createEClass(INVALID_LITERAL_EXP_CS);
2029
		invalidLiteralExpCSEClass = createEClass(INVALID_LITERAL_EXP_CS);
2066
		createEAttribute(invalidLiteralExpCSEClass,
2067
			INVALID_LITERAL_EXP_CS__SYMBOL);
2068
2030
2069
		collectionRangeCSEClass = createEClass(COLLECTION_RANGE_CS);
2031
		collectionRangeCSEClass = createEClass(COLLECTION_RANGE_CS);
2070
		createEReference(collectionRangeCSEClass,
2032
		createEReference(collectionRangeCSEClass,
Lines 2090-2101 Link Here
2090
			FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS);
2052
			FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS);
2091
2053
2092
		operationCallExpCSEClass = createEClass(OPERATION_CALL_EXP_CS);
2054
		operationCallExpCSEClass = createEClass(OPERATION_CALL_EXP_CS);
2055
		createEReference(operationCallExpCSEClass,
2056
			OPERATION_CALL_EXP_CS__PATH_NAME_CS);
2093
		createEAttribute(operationCallExpCSEClass,
2057
		createEAttribute(operationCallExpCSEClass,
2094
			OPERATION_CALL_EXP_CS__IS_ATOMIC);
2058
			OPERATION_CALL_EXP_CS__IS_ATOMIC);
2095
2059
2096
		stateExpCSEClass = createEClass(STATE_EXP_CS);
2097
		createEReference(stateExpCSEClass, STATE_EXP_CS__SIMPLE_NAMES);
2098
2099
		oclDocumentCSEClass = createEClass(OCL_DOCUMENT_CS);
2060
		oclDocumentCSEClass = createEClass(OCL_DOCUMENT_CS);
2100
		createEReference(oclDocumentCSEClass,
2061
		createEReference(oclDocumentCSEClass,
2101
			OCL_DOCUMENT_CS__PACKAGE_DECLARATIONS);
2062
			OCL_DOCUMENT_CS__PACKAGE_DECLARATIONS);
Lines 2166-2171 Link Here
2166
		primitiveTypeCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2127
		primitiveTypeCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2167
		primitiveTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2128
		primitiveTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2168
		tupleTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2129
		tupleTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2130
		collectionTypeCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2169
		collectionTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2131
		collectionTypeCSEClass.getESuperTypes().add(this.getTypeCS());
2170
		letExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS());
2132
		letExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS());
2171
		ifExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS());
2133
		ifExpCSEClass.getESuperTypes().add(this.getOCLExpressionCS());
Lines 2187-2195 Link Here
2187
			this.getPrimitiveLiteralExpCS());
2149
			this.getPrimitiveLiteralExpCS());
2188
		stringLiteralExpCSEClass.getESuperTypes().add(
2150
		stringLiteralExpCSEClass.getESuperTypes().add(
2189
			this.getPrimitiveLiteralExpCS());
2151
			this.getPrimitiveLiteralExpCS());
2152
		booleanLiteralExpCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2190
		booleanLiteralExpCSEClass.getESuperTypes().add(
2153
		booleanLiteralExpCSEClass.getESuperTypes().add(
2191
			this.getPrimitiveLiteralExpCS());
2154
			this.getPrimitiveLiteralExpCS());
2155
		nullLiteralExpCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2192
		nullLiteralExpCSEClass.getESuperTypes().add(this.getLiteralExpCS());
2156
		nullLiteralExpCSEClass.getESuperTypes().add(this.getLiteralExpCS());
2157
		invalidLiteralExpCSEClass.getESuperTypes().add(this.getSimpleNameCS());
2193
		invalidLiteralExpCSEClass.getESuperTypes().add(this.getLiteralExpCS());
2158
		invalidLiteralExpCSEClass.getESuperTypes().add(this.getLiteralExpCS());
2194
		collectionRangeCSEClass.getESuperTypes().add(
2159
		collectionRangeCSEClass.getESuperTypes().add(
2195
			this.getCollectionLiteralPartCS());
2160
			this.getCollectionLiteralPartCS());
Lines 2200-2206 Link Here
2200
		featureCallExpCSEClass.getESuperTypes().add(this.getCallExpCS());
2165
		featureCallExpCSEClass.getESuperTypes().add(this.getCallExpCS());
2201
		operationCallExpCSEClass.getESuperTypes().add(
2166
		operationCallExpCSEClass.getESuperTypes().add(
2202
			this.getFeatureCallExpCS());
2167
			this.getFeatureCallExpCS());
2203
		stateExpCSEClass.getESuperTypes().add(this.getTypeCS());
2204
		oclDocumentCSEClass.getESuperTypes().add(this.getCSTNode());
2168
		oclDocumentCSEClass.getESuperTypes().add(this.getCSTNode());
2205
2169
2206
		// Initialize classes and features; add operations and parameters
2170
		// Initialize classes and features; add operations and parameters
Lines 2713-2731 Link Here
2713
			nullLiteralExpCSEClass,
2677
			nullLiteralExpCSEClass,
2714
			NullLiteralExpCS.class,
2678
			NullLiteralExpCS.class,
2715
			"NullLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2679
			"NullLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2716
		initEAttribute(
2717
			getNullLiteralExpCS_Symbol(),
2718
			ecorePackage.getEString(),
2719
			"symbol", null, 0, 1, NullLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2720
2680
2721
		initEClass(
2681
		initEClass(
2722
			invalidLiteralExpCSEClass,
2682
			invalidLiteralExpCSEClass,
2723
			InvalidLiteralExpCS.class,
2683
			InvalidLiteralExpCS.class,
2724
			"InvalidLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2684
			"InvalidLiteralExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2725
		initEAttribute(
2726
			getInvalidLiteralExpCS_Symbol(),
2727
			ecorePackage.getEString(),
2728
			"symbol", null, 0, 1, InvalidLiteralExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
2729
2685
2730
		initEClass(
2686
		initEClass(
2731
			collectionRangeCSEClass,
2687
			collectionRangeCSEClass,
Lines 2805-2826 Link Here
2805
			operationCallExpCSEClass,
2761
			operationCallExpCSEClass,
2806
			OperationCallExpCS.class,
2762
			OperationCallExpCS.class,
2807
			"OperationCallExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2763
			"OperationCallExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2764
		initEReference(
2765
			getOperationCallExpCS_PathNameCS(),
2766
			this.getPathNameCS(),
2767
			null,
2768
			"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$
2808
		initEAttribute(
2769
		initEAttribute(
2809
			getOperationCallExpCS_IsAtomic(),
2770
			getOperationCallExpCS_IsAtomic(),
2810
			ecorePackage.getEBooleanObject(),
2771
			ecorePackage.getEBooleanObject(),
2811
			"isAtomic", "false", 0, 1, OperationCallExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$
2772
			"isAtomic", "false", 0, 1, OperationCallExpCS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$
2812
2773
2813
		initEClass(
2774
		initEClass(
2814
			stateExpCSEClass,
2815
			StateExpCS.class,
2816
			"StateExpCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2817
		initEReference(
2818
			getStateExpCS_SimpleNames(),
2819
			this.getSimpleNameCS(),
2820
			null,
2821
			"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$
2822
2823
		initEClass(
2824
			oclDocumentCSEClass,
2775
			oclDocumentCSEClass,
2825
			OCLDocumentCS.class,
2776
			OCLDocumentCS.class,
2826
			"OCLDocumentCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
2777
			"OCLDocumentCS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
(-)src/org/eclipse/ocl/cst/impl/CSTFactoryImpl.java (-13 lines)
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 (+104 lines)
Lines 18-27 Link Here
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import org.eclipse.emf.common.notify.Notification;
20
import org.eclipse.emf.common.notify.Notification;
21
import org.eclipse.emf.common.notify.NotificationChain;
21
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.InternalEObject;
22
import org.eclipse.emf.ecore.impl.ENotificationImpl;
24
import org.eclipse.emf.ecore.impl.ENotificationImpl;
23
import org.eclipse.ocl.cst.CSTPackage;
25
import org.eclipse.ocl.cst.CSTPackage;
24
import org.eclipse.ocl.cst.OperationCallExpCS;
26
import org.eclipse.ocl.cst.OperationCallExpCS;
27
import org.eclipse.ocl.cst.PathNameCS;
25
28
26
/**
29
/**
27
 * <!-- begin-user-doc -->
30
 * <!-- begin-user-doc -->
Lines 30-35 Link Here
30
 * <p>
33
 * <p>
31
 * The following features are implemented:
34
 * The following features are implemented:
32
 * <ul>
35
 * <ul>
36
 *   <li>{@link org.eclipse.ocl.cst.impl.OperationCallExpCSImpl#getPathNameCS <em>Path Name CS</em>}</li>
33
 *   <li>{@link org.eclipse.ocl.cst.impl.OperationCallExpCSImpl#getIsAtomic <em>Is Atomic</em>}</li>
37
 *   <li>{@link org.eclipse.ocl.cst.impl.OperationCallExpCSImpl#getIsAtomic <em>Is Atomic</em>}</li>
34
 * </ul>
38
 * </ul>
35
 * </p>
39
 * </p>
Lines 41-46 Link Here
41
		implements OperationCallExpCS {
45
		implements OperationCallExpCS {
42
46
43
	/**
47
	/**
48
	 * The cached value of the '{@link #getPathNameCS() <em>Path Name CS</em>}' containment reference.
49
	 * <!-- begin-user-doc -->
50
	 * @since 3.0
51
	 * <!-- end-user-doc -->
52
	 * @see #getPathNameCS()
53
	 * @generated
54
	 * @ordered
55
	 * 
56
	 */
57
	protected PathNameCS pathNameCS;
58
59
	/**
44
	 * The default value of the '{@link #getIsAtomic() <em>Is Atomic</em>}' attribute.
60
	 * The default value of the '{@link #getIsAtomic() <em>Is Atomic</em>}' attribute.
45
	 * <!-- begin-user-doc -->
61
	 * <!-- begin-user-doc -->
46
	 * @since 3.0
62
	 * @since 3.0
Lines 86-91 Link Here
86
	 * @since 3.0
102
	 * @since 3.0
87
	 * <!-- end-user-doc -->
103
	 * <!-- end-user-doc -->
88
	 * @generated
104
	 * @generated
105
	 * 
106
	 */
107
	public PathNameCS getPathNameCS() {
108
		return pathNameCS;
109
	}
110
111
	/**
112
	 * <!-- begin-user-doc -->
113
	 * @since 3.0
114
	 * <!-- end-user-doc -->
115
	 * @generated
116
	 * 
117
	 */
118
	public NotificationChain basicSetPathNameCS(PathNameCS newPathNameCS,
119
			NotificationChain msgs) {
120
		PathNameCS oldPathNameCS = pathNameCS;
121
		pathNameCS = newPathNameCS;
122
		if (eNotificationRequired()) {
123
			ENotificationImpl notification = new ENotificationImpl(this,
124
				Notification.SET,
125
				CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, oldPathNameCS,
126
				newPathNameCS);
127
			if (msgs == null)
128
				msgs = notification;
129
			else
130
				msgs.add(notification);
131
		}
132
		return msgs;
133
	}
134
135
	/**
136
	 * <!-- begin-user-doc -->
137
	 * @since 3.0
138
	 * <!-- end-user-doc -->
139
	 * @generated
140
	 */
141
	public void setPathNameCS(PathNameCS newPathNameCS) {
142
		if (newPathNameCS != pathNameCS) {
143
			NotificationChain msgs = null;
144
			if (pathNameCS != null)
145
				msgs = ((InternalEObject) pathNameCS).eInverseRemove(this,
146
					EOPPOSITE_FEATURE_BASE
147
						- CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, null,
148
					msgs);
149
			if (newPathNameCS != null)
150
				msgs = ((InternalEObject) newPathNameCS).eInverseAdd(this,
151
					EOPPOSITE_FEATURE_BASE
152
						- CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, null,
153
					msgs);
154
			msgs = basicSetPathNameCS(newPathNameCS, msgs);
155
			if (msgs != null)
156
				msgs.dispatch();
157
		} else if (eNotificationRequired())
158
			eNotify(new ENotificationImpl(this, Notification.SET,
159
				CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS, newPathNameCS,
160
				newPathNameCS));
161
	}
162
163
	/**
164
	 * <!-- begin-user-doc -->
165
	 * @since 3.0
166
	 * <!-- end-user-doc -->
167
	 * @generated
89
	 */
168
	 */
90
	public Boolean getIsAtomic() {
169
	public Boolean getIsAtomic() {
91
		return isAtomic;
170
		return isAtomic;
Lines 112-119 Link Here
112
	 * @generated
191
	 * @generated
113
	 */
192
	 */
114
	@Override
193
	@Override
194
	public NotificationChain eInverseRemove(InternalEObject otherEnd,
195
			int featureID, NotificationChain msgs) {
196
		switch (featureID) {
197
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
198
				return basicSetPathNameCS(null, msgs);
199
		}
200
		return super.eInverseRemove(otherEnd, featureID, msgs);
201
	}
202
203
	/**
204
	 * <!-- begin-user-doc -->
205
	 * <!-- end-user-doc -->
206
	 * @generated
207
	 */
208
	@Override
115
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
209
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
116
		switch (featureID) {
210
		switch (featureID) {
211
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
212
				return getPathNameCS();
117
			case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC :
213
			case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC :
118
				return getIsAtomic();
214
				return getIsAtomic();
119
		}
215
		}
Lines 128-133 Link Here
128
	@Override
224
	@Override
129
	public void eSet(int featureID, Object newValue) {
225
	public void eSet(int featureID, Object newValue) {
130
		switch (featureID) {
226
		switch (featureID) {
227
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
228
				setPathNameCS((PathNameCS) newValue);
229
				return;
131
			case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC :
230
			case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC :
132
				setIsAtomic((Boolean) newValue);
231
				setIsAtomic((Boolean) newValue);
133
				return;
232
				return;
Lines 143-148 Link Here
143
	@Override
242
	@Override
144
	public void eUnset(int featureID) {
243
	public void eUnset(int featureID) {
145
		switch (featureID) {
244
		switch (featureID) {
245
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
246
				setPathNameCS((PathNameCS) null);
247
				return;
146
			case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC :
248
			case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC :
147
				setIsAtomic(IS_ATOMIC_EDEFAULT);
249
				setIsAtomic(IS_ATOMIC_EDEFAULT);
148
				return;
250
				return;
Lines 158-163 Link Here
158
	@Override
260
	@Override
159
	public boolean eIsSet(int featureID) {
261
	public boolean eIsSet(int featureID) {
160
		switch (featureID) {
262
		switch (featureID) {
263
			case CSTPackage.OPERATION_CALL_EXP_CS__PATH_NAME_CS :
264
				return pathNameCS != null;
161
			case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC :
265
			case CSTPackage.OPERATION_CALL_EXP_CS__IS_ATOMIC :
162
				return IS_ATOMIC_EDEFAULT == null
266
				return IS_ATOMIC_EDEFAULT == null
163
					? isAtomic != null
267
					? isAtomic != null
(-)src/org/eclipse/ocl/cst/impl/NullLiteralExpCSImpl.java (-126 / +1 lines)
Lines 17-25 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.ecore.EClass;
20
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.impl.ENotificationImpl;
23
import org.eclipse.ocl.cst.CSTPackage;
21
import org.eclipse.ocl.cst.CSTPackage;
24
import org.eclipse.ocl.cst.NullLiteralExpCS;
22
import org.eclipse.ocl.cst.NullLiteralExpCS;
25
23
Lines 28-66 Link Here
28
 * An implementation of the model object '<em><b>Null Literal Exp CS</b></em>'.
26
 * An implementation of the model object '<em><b>Null Literal Exp CS</b></em>'.
29
 * <!-- end-user-doc -->
27
 * <!-- end-user-doc -->
30
 * <p>
28
 * <p>
31
 * The following features are implemented:
32
 * <ul>
33
 *   <li>{@link org.eclipse.ocl.cst.impl.NullLiteralExpCSImpl#getSymbol <em>Symbol</em>}</li>
34
 * </ul>
35
 * </p>
29
 * </p>
36
 *
30
 *
37
 * @generated
31
 * @generated
38
 */
32
 */
39
public class NullLiteralExpCSImpl
33
public class NullLiteralExpCSImpl
40
		extends LiteralExpCSImpl
34
		extends SimpleNameCSImpl
41
		implements NullLiteralExpCS {
35
		implements NullLiteralExpCS {
42
36
43
	/**
37
	/**
44
	 * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
45
	 * <!-- begin-user-doc -->
46
	 * <!-- end-user-doc -->
47
	 * @see #getSymbol()
48
	 * @generated
49
	 * @ordered
50
	 */
51
	protected static final String SYMBOL_EDEFAULT = null;
52
53
	/**
54
	 * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
55
	 * <!-- begin-user-doc -->
56
	 * <!-- end-user-doc -->
57
	 * @see #getSymbol()
58
	 * @generated
59
	 * @ordered
60
	 */
61
	protected String symbol = SYMBOL_EDEFAULT;
62
63
	/**
64
	 * <!-- begin-user-doc -->
38
	 * <!-- begin-user-doc -->
65
	 * <!-- end-user-doc -->
39
	 * <!-- end-user-doc -->
66
	 * @generated
40
	 * @generated
Lines 79-181 Link Here
79
		return CSTPackage.Literals.NULL_LITERAL_EXP_CS;
53
		return CSTPackage.Literals.NULL_LITERAL_EXP_CS;
80
	}
54
	}
81
55
82
	/**
83
	 * <!-- begin-user-doc -->
84
	 * <!-- end-user-doc -->
85
	 * @generated
86
	 */
87
	public String getSymbol() {
88
		return symbol;
89
	}
90
91
	/**
92
	 * <!-- begin-user-doc -->
93
	 * <!-- end-user-doc -->
94
	 * @generated
95
	 */
96
	public void setSymbol(String newSymbol) {
97
		String oldSymbol = symbol;
98
		symbol = newSymbol;
99
		if (eNotificationRequired())
100
			eNotify(new ENotificationImpl(this, Notification.SET,
101
				CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL, oldSymbol, symbol));
102
	}
103
104
	/**
105
	 * <!-- begin-user-doc -->
106
	 * <!-- end-user-doc -->
107
	 * @generated
108
	 */
109
	@Override
110
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
111
		switch (featureID) {
112
			case CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL :
113
				return getSymbol();
114
		}
115
		return super.eGet(featureID, resolve, coreType);
116
	}
117
118
	/**
119
	 * <!-- begin-user-doc -->
120
	 * <!-- end-user-doc -->
121
	 * @generated
122
	 */
123
	@Override
124
	public void eSet(int featureID, Object newValue) {
125
		switch (featureID) {
126
			case CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL :
127
				setSymbol((String) newValue);
128
				return;
129
		}
130
		super.eSet(featureID, newValue);
131
	}
132
133
	/**
134
	 * <!-- begin-user-doc -->
135
	 * <!-- end-user-doc -->
136
	 * @generated
137
	 */
138
	@Override
139
	public void eUnset(int featureID) {
140
		switch (featureID) {
141
			case CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL :
142
				setSymbol(SYMBOL_EDEFAULT);
143
				return;
144
		}
145
		super.eUnset(featureID);
146
	}
147
148
	/**
149
	 * <!-- begin-user-doc -->
150
	 * <!-- end-user-doc -->
151
	 * @generated
152
	 */
153
	@Override
154
	public boolean eIsSet(int featureID) {
155
		switch (featureID) {
156
			case CSTPackage.NULL_LITERAL_EXP_CS__SYMBOL :
157
				return SYMBOL_EDEFAULT == null
158
					? symbol != null
159
					: !SYMBOL_EDEFAULT.equals(symbol);
160
		}
161
		return super.eIsSet(featureID);
162
	}
163
164
	/**
165
	 * <!-- begin-user-doc -->
166
	 * <!-- end-user-doc -->
167
	 * @generated
168
	 */
169
	@Override
170
	public String toString() {
171
		if (eIsProxy())
172
			return super.toString();
173
174
		StringBuffer result = new StringBuffer(super.toString());
175
		result.append(" (symbol: "); //$NON-NLS-1$
176
		result.append(symbol);
177
		result.append(')');
178
		return result.toString();
179
	}
180
181
} //NullLiteralExpCSImpl
56
} //NullLiteralExpCSImpl
(-)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/InvalidLiteralExpCS.java (-33 / +1 lines)
Lines 22-33 Link Here
22
 * A representation of the model object '<em><b>Invalid Literal Exp CS</b></em>'.
22
 * A representation of the model object '<em><b>Invalid Literal 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.InvalidLiteralExpCS#getSymbol <em>Symbol</em>}</li>
29
 * </ul>
30
 * </p>
31
 *
25
 *
32
 * @see org.eclipse.ocl.cst.CSTPackage#getInvalidLiteralExpCS()
26
 * @see org.eclipse.ocl.cst.CSTPackage#getInvalidLiteralExpCS()
33
 * @model
27
 * @model
Lines 36-67 Link Here
36
 * @noextend This interface is not intended to be extended by clients.
30
 * @noextend This interface is not intended to be extended by clients.
37
 */
31
 */
38
public interface InvalidLiteralExpCS
32
public interface InvalidLiteralExpCS
39
		extends LiteralExpCS {
33
		extends SimpleNameCS, LiteralExpCS {
40
41
	/**
42
	 * Returns the value of the '<em><b>Symbol</b></em>' attribute.
43
	 * <!-- begin-user-doc -->
44
	 * <p>
45
	 * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
46
	 * there really should be more of a description here...
47
	 * </p>
48
	 * <!-- end-user-doc -->
49
	 * @return the value of the '<em>Symbol</em>' attribute.
50
	 * @see #setSymbol(String)
51
	 * @see org.eclipse.ocl.cst.CSTPackage#getInvalidLiteralExpCS_Symbol()
52
	 * @model
53
	 * @generated
54
	 */
55
	String getSymbol();
56
57
	/**
58
	 * Sets the value of the '{@link org.eclipse.ocl.cst.InvalidLiteralExpCS#getSymbol <em>Symbol</em>}' attribute.
59
	 * <!-- begin-user-doc -->
60
	 * <!-- end-user-doc -->
61
	 * @param value the new value of the '<em>Symbol</em>' attribute.
62
	 * @see #getSymbol()
63
	 * @generated
64
	 */
65
	void setSymbol(String value);
66
34
67
} // InvalidLiteralExpCS
35
} // InvalidLiteralExpCS
(-)src/org/eclipse/ocl/cst/BooleanLiteralExpCS.java (-1 / +1 lines)
Lines 36-42 Link Here
36
 * @noextend This interface is not intended to be extended by clients.
36
 * @noextend This interface is not intended to be extended by clients.
37
 */
37
 */
38
public interface BooleanLiteralExpCS
38
public interface BooleanLiteralExpCS
39
		extends PrimitiveLiteralExpCS {
39
		extends SimpleNameCS, PrimitiveLiteralExpCS {
40
40
41
	/**
41
	/**
42
	 * Returns the value of the '<em><b>Boolean Symbol</b></em>' attribute.
42
	 * Returns the value of the '<em><b>Boolean Symbol</b></em>' attribute.
(-)src/org/eclipse/ocl/cst/CSTPackage.java (-191 / +122 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 3585-3591 Link Here
3585
	 * @ordered
3605
	 * @ordered
3586
	 * @noreference This field is not intended to be referenced by clients.
3606
	 * @noreference This field is not intended to be referenced by clients.
3587
	 */
3607
	 */
3588
	int BOOLEAN_LITERAL_EXP_CS__START_OFFSET = PRIMITIVE_LITERAL_EXP_CS__START_OFFSET;
3608
	int BOOLEAN_LITERAL_EXP_CS__START_OFFSET = SIMPLE_NAME_CS__START_OFFSET;
3589
3609
3590
	/**
3610
	/**
3591
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
3611
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
Lines 3595-3601 Link Here
3595
	 * @ordered
3615
	 * @ordered
3596
	 * @noreference This field is not intended to be referenced by clients.
3616
	 * @noreference This field is not intended to be referenced by clients.
3597
	 */
3617
	 */
3598
	int BOOLEAN_LITERAL_EXP_CS__END_OFFSET = PRIMITIVE_LITERAL_EXP_CS__END_OFFSET;
3618
	int BOOLEAN_LITERAL_EXP_CS__END_OFFSET = SIMPLE_NAME_CS__END_OFFSET;
3599
3619
3600
	/**
3620
	/**
3601
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
3621
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
Lines 3605-3611 Link Here
3605
	 * @ordered
3625
	 * @ordered
3606
	 * @noreference This field is not intended to be referenced by clients.
3626
	 * @noreference This field is not intended to be referenced by clients.
3607
	 */
3627
	 */
3608
	int BOOLEAN_LITERAL_EXP_CS__START_TOKEN = PRIMITIVE_LITERAL_EXP_CS__START_TOKEN;
3628
	int BOOLEAN_LITERAL_EXP_CS__START_TOKEN = SIMPLE_NAME_CS__START_TOKEN;
3609
3629
3610
	/**
3630
	/**
3611
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
3631
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
Lines 3615-3621 Link Here
3615
	 * @ordered
3635
	 * @ordered
3616
	 * @noreference This field is not intended to be referenced by clients.
3636
	 * @noreference This field is not intended to be referenced by clients.
3617
	 */
3637
	 */
3618
	int BOOLEAN_LITERAL_EXP_CS__END_TOKEN = PRIMITIVE_LITERAL_EXP_CS__END_TOKEN;
3638
	int BOOLEAN_LITERAL_EXP_CS__END_TOKEN = SIMPLE_NAME_CS__END_TOKEN;
3619
3639
3620
	/**
3640
	/**
3621
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
3641
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
Lines 3625-3631 Link Here
3625
	 * @ordered
3645
	 * @ordered
3626
	 * @noreference This field is not intended to be referenced by clients.
3646
	 * @noreference This field is not intended to be referenced by clients.
3627
	 */
3647
	 */
3628
	int BOOLEAN_LITERAL_EXP_CS__AST = PRIMITIVE_LITERAL_EXP_CS__AST;
3648
	int BOOLEAN_LITERAL_EXP_CS__AST = SIMPLE_NAME_CS__AST;
3649
3650
	/**
3651
	 * The feature id for the '<em><b>Value</b></em>' attribute.
3652
	 * <!-- begin-user-doc -->
3653
	 * <!-- end-user-doc -->
3654
	 * @generated
3655
	 * @ordered
3656
	 * @noreference This field is not intended to be referenced by clients.
3657
	 */
3658
	int BOOLEAN_LITERAL_EXP_CS__VALUE = SIMPLE_NAME_CS__VALUE;
3659
3660
	/**
3661
	 * The feature id for the '<em><b>Type</b></em>' attribute.
3662
	 * <!-- begin-user-doc -->
3663
	 * <!-- end-user-doc -->
3664
	 * @generated
3665
	 * @ordered
3666
	 * @noreference This field is not intended to be referenced by clients.
3667
	 */
3668
	int BOOLEAN_LITERAL_EXP_CS__TYPE = SIMPLE_NAME_CS__TYPE;
3629
3669
3630
	/**
3670
	/**
3631
	 * The feature id for the '<em><b>Symbol</b></em>' attribute.
3671
	 * The feature id for the '<em><b>Symbol</b></em>' attribute.
Lines 3635-3641 Link Here
3635
	 * @ordered
3675
	 * @ordered
3636
	 * @noreference This field is not intended to be referenced by clients.
3676
	 * @noreference This field is not intended to be referenced by clients.
3637
	 */
3677
	 */
3638
	int BOOLEAN_LITERAL_EXP_CS__SYMBOL = PRIMITIVE_LITERAL_EXP_CS__SYMBOL;
3678
	int BOOLEAN_LITERAL_EXP_CS__SYMBOL = SIMPLE_NAME_CS_FEATURE_COUNT + 0;
3639
3679
3640
	/**
3680
	/**
3641
	 * The feature id for the '<em><b>Boolean Symbol</b></em>' attribute.
3681
	 * The feature id for the '<em><b>Boolean Symbol</b></em>' attribute.
Lines 3645-3651 Link Here
3645
	 * @ordered
3685
	 * @ordered
3646
	 * @noreference This field is not intended to be referenced by clients.
3686
	 * @noreference This field is not intended to be referenced by clients.
3647
	 */
3687
	 */
3648
	int BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL = PRIMITIVE_LITERAL_EXP_CS_FEATURE_COUNT + 0;
3688
	int BOOLEAN_LITERAL_EXP_CS__BOOLEAN_SYMBOL = SIMPLE_NAME_CS_FEATURE_COUNT + 1;
3649
3689
3650
	/**
3690
	/**
3651
	 * The number of structural features of the '<em>Boolean Literal Exp CS</em>' class.
3691
	 * The number of structural features of the '<em>Boolean Literal Exp CS</em>' class.
Lines 3655-3661 Link Here
3655
	 * @ordered
3695
	 * @ordered
3656
	 * @noreference This field is not intended to be referenced by clients.
3696
	 * @noreference This field is not intended to be referenced by clients.
3657
	 */
3697
	 */
3658
	int BOOLEAN_LITERAL_EXP_CS_FEATURE_COUNT = PRIMITIVE_LITERAL_EXP_CS_FEATURE_COUNT + 1;
3698
	int BOOLEAN_LITERAL_EXP_CS_FEATURE_COUNT = SIMPLE_NAME_CS_FEATURE_COUNT + 2;
3659
3699
3660
	/**
3700
	/**
3661
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.NullLiteralExpCSImpl <em>Null Literal Exp CS</em>}' class.
3701
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.NullLiteralExpCSImpl <em>Null Literal Exp CS</em>}' class.
Lines 3676-3682 Link Here
3676
	 * @ordered
3716
	 * @ordered
3677
	 * @noreference This field is not intended to be referenced by clients.
3717
	 * @noreference This field is not intended to be referenced by clients.
3678
	 */
3718
	 */
3679
	int NULL_LITERAL_EXP_CS__START_OFFSET = LITERAL_EXP_CS__START_OFFSET;
3719
	int NULL_LITERAL_EXP_CS__START_OFFSET = SIMPLE_NAME_CS__START_OFFSET;
3680
3720
3681
	/**
3721
	/**
3682
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
3722
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
Lines 3686-3692 Link Here
3686
	 * @ordered
3726
	 * @ordered
3687
	 * @noreference This field is not intended to be referenced by clients.
3727
	 * @noreference This field is not intended to be referenced by clients.
3688
	 */
3728
	 */
3689
	int NULL_LITERAL_EXP_CS__END_OFFSET = LITERAL_EXP_CS__END_OFFSET;
3729
	int NULL_LITERAL_EXP_CS__END_OFFSET = SIMPLE_NAME_CS__END_OFFSET;
3690
3730
3691
	/**
3731
	/**
3692
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
3732
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
Lines 3696-3702 Link Here
3696
	 * @ordered
3736
	 * @ordered
3697
	 * @noreference This field is not intended to be referenced by clients.
3737
	 * @noreference This field is not intended to be referenced by clients.
3698
	 */
3738
	 */
3699
	int NULL_LITERAL_EXP_CS__START_TOKEN = LITERAL_EXP_CS__START_TOKEN;
3739
	int NULL_LITERAL_EXP_CS__START_TOKEN = SIMPLE_NAME_CS__START_TOKEN;
3700
3740
3701
	/**
3741
	/**
3702
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
3742
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
Lines 3706-3712 Link Here
3706
	 * @ordered
3746
	 * @ordered
3707
	 * @noreference This field is not intended to be referenced by clients.
3747
	 * @noreference This field is not intended to be referenced by clients.
3708
	 */
3748
	 */
3709
	int NULL_LITERAL_EXP_CS__END_TOKEN = LITERAL_EXP_CS__END_TOKEN;
3749
	int NULL_LITERAL_EXP_CS__END_TOKEN = SIMPLE_NAME_CS__END_TOKEN;
3710
3750
3711
	/**
3751
	/**
3712
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
3752
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
Lines 3716-3732 Link Here
3716
	 * @ordered
3756
	 * @ordered
3717
	 * @noreference This field is not intended to be referenced by clients.
3757
	 * @noreference This field is not intended to be referenced by clients.
3718
	 */
3758
	 */
3719
	int NULL_LITERAL_EXP_CS__AST = LITERAL_EXP_CS__AST;
3759
	int NULL_LITERAL_EXP_CS__AST = SIMPLE_NAME_CS__AST;
3720
3760
3721
	/**
3761
	/**
3722
	 * The feature id for the '<em><b>Symbol</b></em>' attribute.
3762
	 * The feature id for the '<em><b>Value</b></em>' attribute.
3723
	 * <!-- begin-user-doc -->
3763
	 * <!-- begin-user-doc -->
3724
	 * <!-- end-user-doc -->
3764
	 * <!-- end-user-doc -->
3725
	 * @generated
3765
	 * @generated
3726
	 * @ordered
3766
	 * @ordered
3727
	 * @noreference This field is not intended to be referenced by clients.
3767
	 * @noreference This field is not intended to be referenced by clients.
3728
	 */
3768
	 */
3729
	int NULL_LITERAL_EXP_CS__SYMBOL = LITERAL_EXP_CS_FEATURE_COUNT + 0;
3769
	int NULL_LITERAL_EXP_CS__VALUE = SIMPLE_NAME_CS__VALUE;
3770
3771
	/**
3772
	 * The feature id for the '<em><b>Type</b></em>' attribute.
3773
	 * <!-- begin-user-doc -->
3774
	 * <!-- end-user-doc -->
3775
	 * @generated
3776
	 * @ordered
3777
	 * @noreference This field is not intended to be referenced by clients.
3778
	 */
3779
	int NULL_LITERAL_EXP_CS__TYPE = SIMPLE_NAME_CS__TYPE;
3730
3780
3731
	/**
3781
	/**
3732
	 * The number of structural features of the '<em>Null Literal Exp CS</em>' class.
3782
	 * The number of structural features of the '<em>Null Literal Exp CS</em>' class.
Lines 3736-3742 Link Here
3736
	 * @ordered
3786
	 * @ordered
3737
	 * @noreference This field is not intended to be referenced by clients.
3787
	 * @noreference This field is not intended to be referenced by clients.
3738
	 */
3788
	 */
3739
	int NULL_LITERAL_EXP_CS_FEATURE_COUNT = LITERAL_EXP_CS_FEATURE_COUNT + 1;
3789
	int NULL_LITERAL_EXP_CS_FEATURE_COUNT = SIMPLE_NAME_CS_FEATURE_COUNT + 0;
3740
3790
3741
	/**
3791
	/**
3742
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.InvalidLiteralExpCSImpl <em>Invalid Literal Exp CS</em>}' class.
3792
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.InvalidLiteralExpCSImpl <em>Invalid Literal Exp CS</em>}' class.
Lines 3757-3763 Link Here
3757
	 * @ordered
3807
	 * @ordered
3758
	 * @noreference This field is not intended to be referenced by clients.
3808
	 * @noreference This field is not intended to be referenced by clients.
3759
	 */
3809
	 */
3760
	int INVALID_LITERAL_EXP_CS__START_OFFSET = LITERAL_EXP_CS__START_OFFSET;
3810
	int INVALID_LITERAL_EXP_CS__START_OFFSET = SIMPLE_NAME_CS__START_OFFSET;
3761
3811
3762
	/**
3812
	/**
3763
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
3813
	 * The feature id for the '<em><b>End Offset</b></em>' attribute.
Lines 3767-3773 Link Here
3767
	 * @ordered
3817
	 * @ordered
3768
	 * @noreference This field is not intended to be referenced by clients.
3818
	 * @noreference This field is not intended to be referenced by clients.
3769
	 */
3819
	 */
3770
	int INVALID_LITERAL_EXP_CS__END_OFFSET = LITERAL_EXP_CS__END_OFFSET;
3820
	int INVALID_LITERAL_EXP_CS__END_OFFSET = SIMPLE_NAME_CS__END_OFFSET;
3771
3821
3772
	/**
3822
	/**
3773
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
3823
	 * The feature id for the '<em><b>Start Token</b></em>' attribute.
Lines 3777-3783 Link Here
3777
	 * @ordered
3827
	 * @ordered
3778
	 * @noreference This field is not intended to be referenced by clients.
3828
	 * @noreference This field is not intended to be referenced by clients.
3779
	 */
3829
	 */
3780
	int INVALID_LITERAL_EXP_CS__START_TOKEN = LITERAL_EXP_CS__START_TOKEN;
3830
	int INVALID_LITERAL_EXP_CS__START_TOKEN = SIMPLE_NAME_CS__START_TOKEN;
3781
3831
3782
	/**
3832
	/**
3783
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
3833
	 * The feature id for the '<em><b>End Token</b></em>' attribute.
Lines 3787-3793 Link Here
3787
	 * @ordered
3837
	 * @ordered
3788
	 * @noreference This field is not intended to be referenced by clients.
3838
	 * @noreference This field is not intended to be referenced by clients.
3789
	 */
3839
	 */
3790
	int INVALID_LITERAL_EXP_CS__END_TOKEN = LITERAL_EXP_CS__END_TOKEN;
3840
	int INVALID_LITERAL_EXP_CS__END_TOKEN = SIMPLE_NAME_CS__END_TOKEN;
3791
3841
3792
	/**
3842
	/**
3793
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
3843
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
Lines 3797-3813 Link Here
3797
	 * @ordered
3847
	 * @ordered
3798
	 * @noreference This field is not intended to be referenced by clients.
3848
	 * @noreference This field is not intended to be referenced by clients.
3799
	 */
3849
	 */
3800
	int INVALID_LITERAL_EXP_CS__AST = LITERAL_EXP_CS__AST;
3850
	int INVALID_LITERAL_EXP_CS__AST = SIMPLE_NAME_CS__AST;
3801
3851
3802
	/**
3852
	/**
3803
	 * The feature id for the '<em><b>Symbol</b></em>' attribute.
3853
	 * The feature id for the '<em><b>Value</b></em>' attribute.
3804
	 * <!-- begin-user-doc -->
3854
	 * <!-- begin-user-doc -->
3805
	 * <!-- end-user-doc -->
3855
	 * <!-- end-user-doc -->
3806
	 * @generated
3856
	 * @generated
3807
	 * @ordered
3857
	 * @ordered
3808
	 * @noreference This field is not intended to be referenced by clients.
3858
	 * @noreference This field is not intended to be referenced by clients.
3809
	 */
3859
	 */
3810
	int INVALID_LITERAL_EXP_CS__SYMBOL = LITERAL_EXP_CS_FEATURE_COUNT + 0;
3860
	int INVALID_LITERAL_EXP_CS__VALUE = SIMPLE_NAME_CS__VALUE;
3861
3862
	/**
3863
	 * The feature id for the '<em><b>Type</b></em>' attribute.
3864
	 * <!-- begin-user-doc -->
3865
	 * <!-- end-user-doc -->
3866
	 * @generated
3867
	 * @ordered
3868
	 * @noreference This field is not intended to be referenced by clients.
3869
	 */
3870
	int INVALID_LITERAL_EXP_CS__TYPE = SIMPLE_NAME_CS__TYPE;
3811
3871
3812
	/**
3872
	/**
3813
	 * The number of structural features of the '<em>Invalid Literal Exp CS</em>' class.
3873
	 * The number of structural features of the '<em>Invalid Literal Exp CS</em>' class.
Lines 3817-3823 Link Here
3817
	 * @ordered
3877
	 * @ordered
3818
	 * @noreference This field is not intended to be referenced by clients.
3878
	 * @noreference This field is not intended to be referenced by clients.
3819
	 */
3879
	 */
3820
	int INVALID_LITERAL_EXP_CS_FEATURE_COUNT = LITERAL_EXP_CS_FEATURE_COUNT + 1;
3880
	int INVALID_LITERAL_EXP_CS_FEATURE_COUNT = SIMPLE_NAME_CS_FEATURE_COUNT + 0;
3821
3881
3822
	/**
3882
	/**
3823
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.CollectionRangeCSImpl <em>Collection Range CS</em>}' class.
3883
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.CollectionRangeCSImpl <em>Collection Range CS</em>}' class.
Lines 4637-4741 Link Here
4637
	int OPERATION_CALL_EXP_CS__IS_MARKED_PRE_CS = FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS;
4697
	int OPERATION_CALL_EXP_CS__IS_MARKED_PRE_CS = FEATURE_CALL_EXP_CS__IS_MARKED_PRE_CS;
4638
4698
4639
	/**
4699
	/**
4640
	 * The feature id for the '<em><b>Is Atomic</b></em>' attribute.
4700
	 * 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__IS_ATOMIC = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 0;
4648
4649
	/**
4650
	 * The number of structural features of the '<em>Operation Call Exp CS</em>' class.
4651
	 * <!-- begin-user-doc -->
4652
	 * <!-- end-user-doc -->
4653
	 * @generated
4654
	 * @ordered
4655
	 * @noreference This field is not intended to be referenced by clients.
4656
	 */
4657
	int OPERATION_CALL_EXP_CS_FEATURE_COUNT = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 1;
4658
4659
	/**
4660
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.StateExpCSImpl <em>State Exp CS</em>}' class.
4661
	 * <!-- begin-user-doc -->
4662
	 * <!-- end-user-doc -->
4663
	 * @see org.eclipse.ocl.cst.impl.StateExpCSImpl
4664
	 * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getStateExpCS()
4665
	 * @generated
4666
	 * @noreference This field is not intended to be referenced by clients.
4667
	 */
4668
	int STATE_EXP_CS = 49;
4669
4670
	/**
4671
	 * The feature id for the '<em><b>Start 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__START_OFFSET = TYPE_CS__START_OFFSET;
4679
4680
	/**
4681
	 * The feature id for the '<em><b>End Offset</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__END_OFFSET = TYPE_CS__END_OFFSET;
4689
4690
	/**
4691
	 * The feature id for the '<em><b>Start 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__START_TOKEN = TYPE_CS__START_TOKEN;
4699
4700
	/**
4701
	 * The feature id for the '<em><b>End Token</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__END_TOKEN = TYPE_CS__END_TOKEN;
4709
4710
	/**
4711
	 * The feature id for the '<em><b>Ast</b></em>' attribute.
4712
	 * <!-- begin-user-doc -->
4701
	 * <!-- begin-user-doc -->
4713
	 * <!-- end-user-doc -->
4702
	 * <!-- end-user-doc -->
4714
	 * @generated
4703
	 * @generated
4715
	 * @ordered
4704
	 * @ordered
4716
	 * @noreference This field is not intended to be referenced by clients.
4705
	 * @noreference This field is not intended to be referenced by clients.
4717
	 */
4706
	 */
4718
	int STATE_EXP_CS__AST = TYPE_CS__AST;
4707
	int OPERATION_CALL_EXP_CS__PATH_NAME_CS = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 0;
4719
4708
4720
	/**
4709
	/**
4721
	 * The feature id for the '<em><b>Simple Names</b></em>' containment reference list.
4710
	 * The feature id for the '<em><b>Is Atomic</b></em>' attribute.
4722
	 * <!-- begin-user-doc -->
4711
	 * <!-- begin-user-doc -->
4723
	 * <!-- end-user-doc -->
4712
	 * <!-- end-user-doc -->
4724
	 * @generated
4713
	 * @generated
4725
	 * @ordered
4714
	 * @ordered
4726
	 * @noreference This field is not intended to be referenced by clients.
4715
	 * @noreference This field is not intended to be referenced by clients.
4727
	 */
4716
	 */
4728
	int STATE_EXP_CS__SIMPLE_NAMES = TYPE_CS_FEATURE_COUNT + 0;
4717
	int OPERATION_CALL_EXP_CS__IS_ATOMIC = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 1;
4729
4718
4730
	/**
4719
	/**
4731
	 * The number of structural features of the '<em>State Exp CS</em>' class.
4720
	 * The number of structural features of the '<em>Operation Call Exp CS</em>' class.
4732
	 * <!-- begin-user-doc -->
4721
	 * <!-- begin-user-doc -->
4733
	 * <!-- end-user-doc -->
4722
	 * <!-- end-user-doc -->
4734
	 * @generated
4723
	 * @generated
4735
	 * @ordered
4724
	 * @ordered
4736
	 * @noreference This field is not intended to be referenced by clients.
4725
	 * @noreference This field is not intended to be referenced by clients.
4737
	 */
4726
	 */
4738
	int STATE_EXP_CS_FEATURE_COUNT = TYPE_CS_FEATURE_COUNT + 1;
4727
	int OPERATION_CALL_EXP_CS_FEATURE_COUNT = FEATURE_CALL_EXP_CS_FEATURE_COUNT + 2;
4739
4728
4740
	/**
4729
	/**
4741
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class.
4730
	 * The meta object id for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class.
Lines 4746-4752 Link Here
4746
	 * @generated
4735
	 * @generated
4747
	 * @noreference This field is not intended to be referenced by clients.
4736
	 * @noreference This field is not intended to be referenced by clients.
4748
	 */
4737
	 */
4749
	int OCL_DOCUMENT_CS = 50;
4738
	int OCL_DOCUMENT_CS = 49;
4750
4739
4751
	/**
4740
	/**
4752
	 * The feature id for the '<em><b>Start Offset</b></em>' attribute.
4741
	 * The feature id for the '<em><b>Start Offset</b></em>' attribute.
Lines 4827-4833 Link Here
4827
	 * @generated
4816
	 * @generated
4828
	 * @noreference This field is not intended to be referenced by clients.
4817
	 * @noreference This field is not intended to be referenced by clients.
4829
	 */
4818
	 */
4830
	int SIMPLE_TYPE_ENUM = 51;
4819
	int SIMPLE_TYPE_ENUM = 50;
4831
4820
4832
	/**
4821
	/**
4833
	 * The meta object id for the '{@link org.eclipse.ocl.cst.PrePostOrBodyEnum <em>Pre Post Or Body Enum</em>}' enum.
4822
	 * The meta object id for the '{@link org.eclipse.ocl.cst.PrePostOrBodyEnum <em>Pre Post Or Body Enum</em>}' enum.
Lines 4838-4844 Link Here
4838
	 * @generated
4827
	 * @generated
4839
	 * @noreference This field is not intended to be referenced by clients.
4828
	 * @noreference This field is not intended to be referenced by clients.
4840
	 */
4829
	 */
4841
	int PRE_POST_OR_BODY_ENUM = 52;
4830
	int PRE_POST_OR_BODY_ENUM = 51;
4842
4831
4843
	/**
4832
	/**
4844
	 * The meta object id for the '{@link org.eclipse.ocl.cst.CollectionTypeIdentifierEnum <em>Collection Type Identifier Enum</em>}' enum.
4833
	 * The meta object id for the '{@link org.eclipse.ocl.cst.CollectionTypeIdentifierEnum <em>Collection Type Identifier Enum</em>}' enum.
Lines 4849-4855 Link Here
4849
	 * @generated
4838
	 * @generated
4850
	 * @noreference This field is not intended to be referenced by clients.
4839
	 * @noreference This field is not intended to be referenced by clients.
4851
	 */
4840
	 */
4852
	int COLLECTION_TYPE_IDENTIFIER_ENUM = 53;
4841
	int COLLECTION_TYPE_IDENTIFIER_ENUM = 52;
4853
4842
4854
	/**
4843
	/**
4855
	 * The meta object id for the '{@link org.eclipse.ocl.cst.MessageExpKind <em>Message Exp Kind</em>}' enum.
4844
	 * The meta object id for the '{@link org.eclipse.ocl.cst.MessageExpKind <em>Message Exp Kind</em>}' enum.
Lines 4860-4866 Link Here
4860
	 * @generated
4849
	 * @generated
4861
	 * @noreference This field is not intended to be referenced by clients.
4850
	 * @noreference This field is not intended to be referenced by clients.
4862
	 */
4851
	 */
4863
	int MESSAGE_EXP_KIND = 54;
4852
	int MESSAGE_EXP_KIND = 53;
4864
4853
4865
	/**
4854
	/**
4866
	 * The meta object id for the '{@link org.eclipse.ocl.cst.DotOrArrowEnum <em>Dot Or Arrow Enum</em>}' enum.
4855
	 * The meta object id for the '{@link org.eclipse.ocl.cst.DotOrArrowEnum <em>Dot Or Arrow Enum</em>}' enum.
Lines 4871-4877 Link Here
4871
	 * @generated
4860
	 * @generated
4872
	 * @noreference This field is not intended to be referenced by clients.
4861
	 * @noreference This field is not intended to be referenced by clients.
4873
	 */
4862
	 */
4874
	int DOT_OR_ARROW_ENUM = 55;
4863
	int DOT_OR_ARROW_ENUM = 54;
4875
4864
4876
	/**
4865
	/**
4877
	 * The meta object id for the '<em>IToken</em>' data type.
4866
	 * The meta object id for the '<em>IToken</em>' data type.
Lines 4882-4888 Link Here
4882
	 * @generated
4871
	 * @generated
4883
	 * @noreference This field is not intended to be referenced by clients.
4872
	 * @noreference This field is not intended to be referenced by clients.
4884
	 */
4873
	 */
4885
	int ITOKEN = 56;
4874
	int ITOKEN = 55;
4886
4875
4887
	/**
4876
	/**
4888
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.CSTNode <em>Node</em>}'.
4877
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.CSTNode <em>Node</em>}'.
Lines 6040-6056 Link Here
6040
	EClass getNullLiteralExpCS();
6029
	EClass getNullLiteralExpCS();
6041
6030
6042
	/**
6031
	/**
6043
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.NullLiteralExpCS#getSymbol <em>Symbol</em>}'.
6044
	 * <!-- begin-user-doc -->
6045
	 * <!-- end-user-doc -->
6046
	 * @return the meta object for the attribute '<em>Symbol</em>'.
6047
	 * @see org.eclipse.ocl.cst.NullLiteralExpCS#getSymbol()
6048
	 * @see #getNullLiteralExpCS()
6049
	 * @generated
6050
	 */
6051
	EAttribute getNullLiteralExpCS_Symbol();
6052
6053
	/**
6054
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.InvalidLiteralExpCS <em>Invalid Literal Exp CS</em>}'.
6032
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.InvalidLiteralExpCS <em>Invalid Literal Exp CS</em>}'.
6055
	 * <!-- begin-user-doc -->
6033
	 * <!-- begin-user-doc -->
6056
	 * <!-- end-user-doc -->
6034
	 * <!-- end-user-doc -->
Lines 6061-6077 Link Here
6061
	EClass getInvalidLiteralExpCS();
6039
	EClass getInvalidLiteralExpCS();
6062
6040
6063
	/**
6041
	/**
6064
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.InvalidLiteralExpCS#getSymbol <em>Symbol</em>}'.
6065
	 * <!-- begin-user-doc -->
6066
	 * <!-- end-user-doc -->
6067
	 * @return the meta object for the attribute '<em>Symbol</em>'.
6068
	 * @see org.eclipse.ocl.cst.InvalidLiteralExpCS#getSymbol()
6069
	 * @see #getInvalidLiteralExpCS()
6070
	 * @generated
6071
	 */
6072
	EAttribute getInvalidLiteralExpCS_Symbol();
6073
6074
	/**
6075
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.CollectionRangeCS <em>Collection Range CS</em>}'.
6042
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.CollectionRangeCS <em>Collection Range CS</em>}'.
6076
	 * <!-- begin-user-doc -->
6043
	 * <!-- begin-user-doc -->
6077
	 * <!-- end-user-doc -->
6044
	 * <!-- end-user-doc -->
Lines 6241-6278 Link Here
6241
	EClass getOperationCallExpCS();
6208
	EClass getOperationCallExpCS();
6242
6209
6243
	/**
6210
	/**
6244
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic <em>Is Atomic</em>}'.
6211
	 * Returns the meta object for the containment reference '{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}'.
6245
	 * <!-- begin-user-doc -->
6212
	 * <!-- begin-user-doc -->
6246
	 * @since 3.0
6213
	 * @since 3.0
6247
	 * <!-- end-user-doc -->
6214
	 * <!-- end-user-doc -->
6248
	 * @return the meta object for the attribute '<em>Is Atomic</em>'.
6215
	 * @return the meta object for the containment reference '<em>Path Name CS</em>'.
6249
	 * @see org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic()
6216
	 * @see org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS()
6250
	 * @see #getOperationCallExpCS()
6217
	 * @see #getOperationCallExpCS()
6251
	 * @generated
6218
	 * @generated
6219
	 * 
6252
	 */
6220
	 */
6253
	EAttribute getOperationCallExpCS_IsAtomic();
6221
	EReference getOperationCallExpCS_PathNameCS();
6254
6222
6255
	/**
6223
	/**
6256
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.StateExpCS <em>State Exp CS</em>}'.
6224
	 * Returns the meta object for the attribute '{@link org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic <em>Is Atomic</em>}'.
6257
	 * <!-- begin-user-doc -->
6258
	 * <!-- end-user-doc -->
6259
	 * @return the meta object for class '<em>State Exp CS</em>'.
6260
	 * @see org.eclipse.ocl.cst.StateExpCS
6261
	 * @generated
6262
	 */
6263
	EClass getStateExpCS();
6264
6265
	/**
6266
	 * Returns the meta object for the containment reference list '{@link org.eclipse.ocl.cst.StateExpCS#getSimpleNames <em>Simple Names</em>}'.
6267
	 * <!-- begin-user-doc -->
6225
	 * <!-- begin-user-doc -->
6268
	 * @since 3.0
6226
	 * @since 3.0
6269
	 * <!-- end-user-doc -->
6227
	 * <!-- end-user-doc -->
6270
	 * @return the meta object for the containment reference list '<em>Simple Names</em>'.
6228
	 * @return the meta object for the attribute '<em>Is Atomic</em>'.
6271
	 * @see org.eclipse.ocl.cst.StateExpCS#getSimpleNames()
6229
	 * @see org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic()
6272
	 * @see #getStateExpCS()
6230
	 * @see #getOperationCallExpCS()
6273
	 * @generated
6231
	 * @generated
6274
	 */
6232
	 */
6275
	EReference getStateExpCS_SimpleNames();
6233
	EAttribute getOperationCallExpCS_IsAtomic();
6276
6234
6277
	/**
6235
	/**
6278
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'.
6236
	 * Returns the meta object for class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'.
Lines 7396-7410 Link Here
7396
		EClass NULL_LITERAL_EXP_CS = eINSTANCE.getNullLiteralExpCS();
7354
		EClass NULL_LITERAL_EXP_CS = eINSTANCE.getNullLiteralExpCS();
7397
7355
7398
		/**
7356
		/**
7399
		 * The meta object literal for the '<em><b>Symbol</b></em>' attribute feature.
7400
		 * <!-- begin-user-doc -->
7401
		 * <!-- end-user-doc -->
7402
		 * @generated
7403
		 */
7404
		EAttribute NULL_LITERAL_EXP_CS__SYMBOL = eINSTANCE
7405
			.getNullLiteralExpCS_Symbol();
7406
7407
		/**
7408
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.InvalidLiteralExpCSImpl <em>Invalid Literal Exp CS</em>}' class.
7357
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.InvalidLiteralExpCSImpl <em>Invalid Literal Exp CS</em>}' class.
7409
		 * <!-- begin-user-doc -->
7358
		 * <!-- begin-user-doc -->
7410
		 * <!-- end-user-doc -->
7359
		 * <!-- end-user-doc -->
Lines 7415-7429 Link Here
7415
		EClass INVALID_LITERAL_EXP_CS = eINSTANCE.getInvalidLiteralExpCS();
7364
		EClass INVALID_LITERAL_EXP_CS = eINSTANCE.getInvalidLiteralExpCS();
7416
7365
7417
		/**
7366
		/**
7418
		 * The meta object literal for the '<em><b>Symbol</b></em>' attribute feature.
7419
		 * <!-- begin-user-doc -->
7420
		 * <!-- end-user-doc -->
7421
		 * @generated
7422
		 */
7423
		EAttribute INVALID_LITERAL_EXP_CS__SYMBOL = eINSTANCE
7424
			.getInvalidLiteralExpCS_Symbol();
7425
7426
		/**
7427
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.CollectionRangeCSImpl <em>Collection Range CS</em>}' class.
7367
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.CollectionRangeCSImpl <em>Collection Range CS</em>}' class.
7428
		 * <!-- begin-user-doc -->
7368
		 * <!-- begin-user-doc -->
7429
		 * <!-- end-user-doc -->
7369
		 * <!-- end-user-doc -->
Lines 7570-7603 Link Here
7570
		EClass OPERATION_CALL_EXP_CS = eINSTANCE.getOperationCallExpCS();
7510
		EClass OPERATION_CALL_EXP_CS = eINSTANCE.getOperationCallExpCS();
7571
7511
7572
		/**
7512
		/**
7573
		 * The meta object literal for the '<em><b>Is Atomic</b></em>' attribute feature.
7513
		 * The meta object literal for the '<em><b>Path Name CS</b></em>' containment reference feature.
7574
		 * <!-- begin-user-doc -->
7514
		 * <!-- begin-user-doc -->
7575
		 * @since 3.0
7515
		 * @since 3.0
7576
		 * <!-- end-user-doc -->
7516
		 * <!-- end-user-doc -->
7577
		 * @generated
7517
		 * @generated
7518
		 * 
7578
		 */
7519
		 */
7579
		EAttribute OPERATION_CALL_EXP_CS__IS_ATOMIC = eINSTANCE
7520
		EReference OPERATION_CALL_EXP_CS__PATH_NAME_CS = eINSTANCE
7580
			.getOperationCallExpCS_IsAtomic();
7521
			.getOperationCallExpCS_PathNameCS();
7581
7522
7582
		/**
7523
		/**
7583
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.StateExpCSImpl <em>State Exp CS</em>}' class.
7524
		 * The meta object literal for the '<em><b>Is Atomic</b></em>' attribute feature.
7584
		 * <!-- begin-user-doc -->
7585
		 * <!-- end-user-doc -->
7586
		 * @see org.eclipse.ocl.cst.impl.StateExpCSImpl
7587
		 * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getStateExpCS()
7588
		 * @generated
7589
		 */
7590
		EClass STATE_EXP_CS = eINSTANCE.getStateExpCS();
7591
7592
		/**
7593
		 * The meta object literal for the '<em><b>Simple Names</b></em>' containment reference list feature.
7594
		 * <!-- begin-user-doc -->
7525
		 * <!-- begin-user-doc -->
7595
		 * @since 3.0
7526
		 * @since 3.0
7596
		 * <!-- end-user-doc -->
7527
		 * <!-- end-user-doc -->
7597
		 * @generated
7528
		 * @generated
7598
		 */
7529
		 */
7599
		EReference STATE_EXP_CS__SIMPLE_NAMES = eINSTANCE
7530
		EAttribute OPERATION_CALL_EXP_CS__IS_ATOMIC = eINSTANCE
7600
			.getStateExpCS_SimpleNames();
7531
			.getOperationCallExpCS_IsAtomic();
7601
7532
7602
		/**
7533
		/**
7603
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class.
7534
		 * The meta object literal for the '{@link org.eclipse.ocl.cst.impl.OCLDocumentCSImpl <em>OCL Document CS</em>}' class.
(-)src/org/eclipse/ocl/cst/OperationCallExpCS.java (+32 lines)
Lines 25-30 Link Here
25
 * <p>
25
 * <p>
26
 * The following features are supported:
26
 * The following features are supported:
27
 * <ul>
27
 * <ul>
28
 *   <li>{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}</li>
28
 *   <li>{@link org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic <em>Is Atomic</em>}</li>
29
 *   <li>{@link org.eclipse.ocl.cst.OperationCallExpCS#getIsAtomic <em>Is Atomic</em>}</li>
29
 * </ul>
30
 * </ul>
30
 * </p>
31
 * </p>
Lines 39-44 Link Here
39
		extends FeatureCallExpCS {
40
		extends FeatureCallExpCS {
40
41
41
	/**
42
	/**
43
	 * Returns the value of the '<em><b>Path Name CS</b></em>' containment reference.
44
	 * <!-- begin-user-doc -->
45
	 * <p>
46
	 * If the meaning of the '<em>Path Name CS</em>' containment reference isn't clear,
47
	 * there really should be more of a description here...
48
	 * </p>
49
	 * 
50
	 * @since 3.0
51
	 * <!-- end-user-doc -->
52
	 * @return the value of the '<em>Path Name CS</em>' containment reference.
53
	 * @see #setPathNameCS(PathNameCS)
54
	 * @see org.eclipse.ocl.cst.CSTPackage#getOperationCallExpCS_PathNameCS()
55
	 * @model containment="true"
56
	 * @generated
57
	 * 
58
	 */
59
	PathNameCS getPathNameCS();
60
61
	/**
62
	 * Sets the value of the '{@link org.eclipse.ocl.cst.OperationCallExpCS#getPathNameCS <em>Path Name CS</em>}' containment reference.
63
	 * <!-- begin-user-doc -->
64
	 * @since 3.0
65
	 * <!-- end-user-doc -->
66
	 * @param value the new value of the '<em>Path Name CS</em>' containment reference.
67
	 * @see #getPathNameCS()
68
	 * @generated
69
	 * 
70
	 */
71
	void setPathNameCS(PathNameCS value);
72
73
	/**
42
	 * Returns the value of the '<em><b>Is Atomic</b></em>' attribute.
74
	 * Returns the value of the '<em><b>Is Atomic</b></em>' attribute.
43
	 * The default value is <code>"false"</code>.
75
	 * The default value is <code>"false"</code>.
44
	 * <!-- begin-user-doc -->
76
	 * <!-- begin-user-doc -->
(-)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/NullLiteralExpCS.java (-33 / +1 lines)
Lines 22-33 Link Here
22
 * A representation of the model object '<em><b>Null Literal Exp CS</b></em>'.
22
 * A representation of the model object '<em><b>Null Literal 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.NullLiteralExpCS#getSymbol <em>Symbol</em>}</li>
29
 * </ul>
30
 * </p>
31
 *
25
 *
32
 * @see org.eclipse.ocl.cst.CSTPackage#getNullLiteralExpCS()
26
 * @see org.eclipse.ocl.cst.CSTPackage#getNullLiteralExpCS()
33
 * @model
27
 * @model
Lines 36-67 Link Here
36
 * @noextend This interface is not intended to be extended by clients.
30
 * @noextend This interface is not intended to be extended by clients.
37
 */
31
 */
38
public interface NullLiteralExpCS
32
public interface NullLiteralExpCS
39
		extends LiteralExpCS {
33
		extends SimpleNameCS, LiteralExpCS {
40
41
	/**
42
	 * Returns the value of the '<em><b>Symbol</b></em>' attribute.
43
	 * <!-- begin-user-doc -->
44
	 * <p>
45
	 * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
46
	 * there really should be more of a description here...
47
	 * </p>
48
	 * <!-- end-user-doc -->
49
	 * @return the value of the '<em>Symbol</em>' attribute.
50
	 * @see #setSymbol(String)
51
	 * @see org.eclipse.ocl.cst.CSTPackage#getNullLiteralExpCS_Symbol()
52
	 * @model
53
	 * @generated
54
	 */
55
	String getSymbol();
56
57
	/**
58
	 * Sets the value of the '{@link org.eclipse.ocl.cst.NullLiteralExpCS#getSymbol <em>Symbol</em>}' attribute.
59
	 * <!-- begin-user-doc -->
60
	 * <!-- end-user-doc -->
61
	 * @param value the new value of the '<em>Symbol</em>' attribute.
62
	 * @see #getSymbol()
63
	 * @generated
64
	 */
65
	void setSymbol(String value);
66
34
67
} // NullLiteralExpCS
35
} // NullLiteralExpCS
(-)src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java (-123 / +248 lines)
Lines 10-16 Link Here
10
 * Contributors: 
10
 * Contributors: 
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   E.D.Willink - refactored to separate from OCLAnalyzer and OCLParser
12
 *   E.D.Willink - refactored to separate from OCLAnalyzer and OCLParser
13
 *               - Bugs 237126, 245586, 213886, 242236, 259818, 259819
13
 *               - Bugs 184048, 237126, 245586, 213886, 242236, 259818, 259819
14
 *   Adolfo Sánchez-Barbudo Herrera - Bug 237441
14
 *   Adolfo Sánchez-Barbudo Herrera - Bug 237441
15
 *   Zeligsoft - Bugs 243526, 243079, 245586 (merging and docs), 213886, 179990,
15
 *   Zeligsoft - Bugs 243526, 243079, 245586 (merging and docs), 213886, 179990,
16
 *               255599, 251349, 242236, 259740
16
 *               255599, 251349, 242236, 259740
Lines 19-25 Link Here
19
 *
19
 *
20
 * </copyright>
20
 * </copyright>
21
 *
21
 *
22
 * $Id: AbstractOCLAnalyzer.java,v 1.32 2009/10/04 11:15:51 ewillink Exp $
22
 * $Id: AbstractOCLAnalyzer.java,v 1.30 2009/09/04 13:40:43 ewillink Exp $
23
 */
23
 */
24
package org.eclipse.ocl.parser;
24
package org.eclipse.ocl.parser;
25
25
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-4119 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
		if (ParsingOptions.getValue(env, ParsingOptions.WARN_OF_XOR_OR_AND_PRECEDENCE_CHANGE)) {
4013
			checkForXorOrAndPrecedenceHazard(operationCallExpCS);
4014
		}
4015
4016
		OperationCallExp<C, O> astNode = null;
4017
4018
		List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>();
4019
		// boolean isMarkedPre = false;
4020
4021
		String name = operationCallExpCS.getSimpleNameCS().getValue();
4022
		int operator = operationCallExpCS.getAccessor().getValue();
3999
		int operator = operationCallExpCS.getAccessor().getValue();
4023
4024
		/*
4025
		 * The type of the operation is specified by a path expression or self,
4026
		 * or by an explicit source expression. The source expression may be a
4027
		 * collection type (-> operation) or a regular navigation expression (.
4028
		 * operation)
4029
		 */
4030
		OCLExpression<C> source = null;
4031
		if (operator == DotOrArrowEnum.ARROW) {
4000
		if (operator == DotOrArrowEnum.ARROW) {
4032
			source = getCollectionSourceExpression(operationCallExpCS
4001
			return arrowOperationCallExpCS(operationCallExpCS, env);
4033
				.getSource(), env);
4002
		}
4034
		} else {
4003
		OCLExpressionCS sourceCS = operationCallExpCS.getSource();
4035
			OCLExpressionCS sourceCS = operationCallExpCS.getSource();
4004
		if ((sourceCS == null) && (operationCallExpCS.getPathNameCS() != null)) {
4036
4005
			return staticOperationCallExpCS(operationCallExpCS, env);
4037
			if (sourceCS instanceof PathNameCS) {
4038
				// static operation call
4039
				PathNameCS pathName = (PathNameCS) sourceCS;
4040
4041
				EList<String> pathNames = createSequenceOfNames(pathName
4042
					.getSimpleNames());
4043
				C sourceType = lookupClassifier(sourceCS, env, pathNames);
4044
				if (sourceType == null) {
4045
					String message = OCLMessages.bind(
4046
						OCLMessages.UnrecognizedType_ERROR_, pathNames);
4047
					ERROR(sourceCS, "operatonCallExpCS", message);//$NON-NLS-1$
4048
				} else {
4049
					source = typeCS(sourceCS, env, sourceType);
4050
				}
4051
			} else {
4052
				source = oclExpressionCS(operationCallExpCS.getSource(), env);
4053
			}
4054
		}
4006
		}
4055
4056
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4007
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4057
4058
		if (PredefinedType.OCL_IS_IN_STATE_NAME.equals(operationName)) {
4008
		if (PredefinedType.OCL_IS_IN_STATE_NAME.equals(operationName)) {
4059
			if (operationCallExpCS.getArguments().size() != 1) {
4009
			return oclIsInStateOperationCallExpCS(operationCallExpCS, env);
4060
				String message = OCLMessages.bind(
4061
					OCLMessages.IsInStateSignature_ERROR_,
4062
					computeInputString(operationCallExpCS));
4063
				ERROR(operationCallExpCS, "operationCallExpCS", message);//$NON-NLS-1$
4064
			}
4065
4066
			if (!operationCallExpCS.getArguments().isEmpty()) {
4067
				OCLExpressionCS arg = operationCallExpCS.getArguments().get(0);
4068
4069
				if (arg instanceof StateExpCS) {
4070
					args.add(stateExpCS(source, (StateExpCS) arg, env));
4071
				} else {
4072
					String message = OCLMessages.bind(
4073
						OCLMessages.IsInStateSignature_ERROR_,
4074
						computeInputString(operationCallExpCS));
4075
					ERROR(arg, "operationCallExpCS", message);//$NON-NLS-1$
4076
				}
4077
			}
4078
		} else {
4079
			for (OCLExpressionCS arg : operationCallExpCS.getArguments()) {
4080
				OCLExpression<C> argExpr = oclExpressionCS(arg, env);
4081
				if (argExpr == null) {
4082
					argExpr = createDummyInvalidLiteralExp(env, arg);
4083
					initASTMapping(env, argExpr, arg);
4084
				}
4085
				args.add(argExpr);
4086
			}
4087
		}
4010
		}
4088
4011
		if (ParsingOptions.getValue(env, ParsingOptions.WARN_OF_XOR_OR_AND_PRECEDENCE_CHANGE)) {
4089
		if (source == null) { // create an implicit source
4012
			checkForXorOrAndPrecedenceHazard(operationCallExpCS);
4090
			Variable<C, PM> implicitSource = lookupImplicitSourceForOperation(
4013
		}
4091
				operationCallExpCS, env, args, operationName);
4014
		OCLExpression<C> source = oclExpressionCS(operationCallExpCS.getSource(), env);
4092
			VariableExp<C, PM> vexp = createVariableExp(env,
4015
		List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env);
4093
				operationCallExpCS, implicitSource);
4016
		if (source == null) { 						// create an implicit source
4094
4017
			source = createImplicitSource(operationCallExpCS, env, args);
4095
			if (implicitSource == null) {
4096
				String errMessage = name + "(";//$NON-NLS-1$
4097
				for (int i = 0; i < args.size(); i++) {
4098
					if (i > 0) {
4099
						errMessage += ", ";//$NON-NLS-1$
4100
					}
4101
					errMessage += uml.getName(args.get(i).getType());
4102
				}
4103
				errMessage += ")";//$NON-NLS-1$
4104
				String message = OCLMessages.bind(
4105
					OCLMessages.IllegalSignature_ERROR_, errMessage);
4106
				ERROR(operationCallExpCS, "operationCallExpCS", message); //$NON-NLS-1$
4107
			}
4108
4109
			if (implicitSource != null) {
4110
				vexp.setType(implicitSource.getType());
4111
				vexp.setReferredVariable(implicitSource);
4112
			} else {
4113
				vexp.setType(getOclVoid());
4114
			}
4115
4116
			source = vexp;
4117
		}
4018
		}
4118
4019
4119
		/*
4020
		/*
Lines 4134-4140 Link Here
4134
		// if the sourceType is a TypeType then this must be a static operation
4035
		// if the sourceType is a TypeType then this must be a static operation
4135
		boolean isStatic = operationSourceType instanceof TypeType<?, ?>;
4036
		boolean isStatic = operationSourceType instanceof TypeType<?, ?>;
4136
4037
4137
		astNode = genOperationCallExp(env, operationCallExpCS,
4038
		OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS,
4138
			"operationCallExpCS", operationName,//$NON-NLS-1$
4039
			"operationCallExpCS", operationName,//$NON-NLS-1$
4139
			source, operationSourceType, args);
4040
			source, operationSourceType, args);
4140
		if (isStatic) {
4041
		if (isStatic) {
Lines 4173-4178 Link Here
4173
		return result;
4074
		return result;
4174
	}
4075
	}
4175
4076
4077
	/**
4078
	 * @since 3.0
4079
	 */
4080
	protected OCLExpression<C> createImplicitSource(OperationCallExpCS operationCallExpCS,
4081
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env,
4082
			List<OCLExpression<C>> args) {
4083
4084
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4085
		Variable<C, PM> implicitSource = lookupImplicitSourceForOperation(
4086
			operationCallExpCS, env, args, operationName);
4087
		VariableExp<C, PM> vexp = createVariableExp(env, operationCallExpCS, implicitSource);
4088
4089
		if (implicitSource == null) {
4090
			String errMessage = operationName + "(";//$NON-NLS-1$
4091
			for (int i = 0; i < args.size(); i++) {
4092
				if (i > 0) {
4093
					errMessage += ", ";//$NON-NLS-1$
4094
				}
4095
				errMessage += uml.getName(args.get(i).getType());
4096
			}
4097
			errMessage += ")";//$NON-NLS-1$
4098
			String message = OCLMessages.bind(
4099
				OCLMessages.IllegalSignature_ERROR_, errMessage);
4100
			ERROR(operationCallExpCS, "operationCallExpCS", message); //$NON-NLS-1$
4101
		}
4102
4103
		if (implicitSource != null) {
4104
			vexp.setType(implicitSource.getType());
4105
			vexp.setReferredVariable(implicitSource);
4106
		} else {
4107
			vexp.setType(getOclVoid());
4108
		}
4109
		return vexp;
4110
	}
4111
4112
	/**
4113
	 * OperationCallExpCS for an ->
4114
	 * 
4115
	 * @param operationCallExpCS
4116
	 *            the <code>OperationCallExpCS</code> <code>CSTNode</code>
4117
	 * @param env
4118
	 *            the OCL environment
4119
	 * @return the parsed <code>OCLExpression</code>
4120
	 * @since 3.0
4121
	 */
4122
	protected OCLExpression<C> arrowOperationCallExpCS(
4123
			OperationCallExpCS operationCallExpCS,
4124
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4125
4126
		OCLExpression<C> source = getCollectionSourceExpression(operationCallExpCS.getSource(), env);
4127
		List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env);
4128
		
4129
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4130
		C operationSourceType = source.getType();
4131
		OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS,
4132
			"operationCallExpCS", operationName,//$NON-NLS-1$
4133
			source, operationSourceType, args);
4134
4135
		initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS());
4136
4137
		if (isErrorNode(source)) {
4138
			// don't attempt to parse navigation from an unparseable source
4139
			markAsErrorNode(astNode);
4140
		}
4141
4142
		return astNode;
4143
	}
4144
	/**
4145
	 * OperationCallExpCS for oclIsInState
4146
	 * 
4147
	 * @param operationCallExpCS
4148
	 *            the <code>OperationCallExpCS</code> <code>CSTNode</code>
4149
	 * @param env
4150
	 *            the OCL environment
4151
	 * @return the parsed <code>OCLExpression</code>
4152
	 * @since 3.0
4153
	 */
4154
	protected OCLExpression<C> oclIsInStateOperationCallExpCS(
4155
			OperationCallExpCS operationCallExpCS,
4156
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4157
		if (operationCallExpCS.getArguments().size() != 1) {
4158
			String message = OCLMessages.bind(
4159
				OCLMessages.IsInStateSignature_ERROR_,
4160
				computeInputString(operationCallExpCS));
4161
			ERROR(operationCallExpCS, "operationCallExpCS", message);//$NON-NLS-1$
4162
		}
4163
4164
		OCLExpression<C> source = oclExpressionCS(operationCallExpCS.getSource(), env);
4165
		List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>();
4166
		if (!operationCallExpCS.getArguments().isEmpty()) {
4167
			OCLExpressionCS arg = operationCallExpCS.getArguments().get(0);
4168
			if (arg instanceof VariableExpCS) {
4169
				VariableExpCS stateName = (VariableExpCS) arg;
4170
				EList<String> statePath = createSequenceOfNames(null, stateName.getSimpleNameCS());
4171
				args.add(stateExpCS(source, stateName, statePath, env));
4172
			} else if (arg instanceof EnumLiteralExpCS) {
4173
				EnumLiteralExpCS stateName = (EnumLiteralExpCS) arg;
4174
				EList<String> statePath = createSequenceOfNames(stateName.getPathNameCS(), stateName.getSimpleNameCS());
4175
				args.add(stateExpCS(source, stateName, statePath, env));
4176
			} else {
4177
				String message = OCLMessages.bind(
4178
					OCLMessages.IsInStateSignature_ERROR_,
4179
					computeInputString(operationCallExpCS));
4180
				ERROR(arg, "operationCallExpCS", message);//$NON-NLS-1$
4181
			}
4182
		}
4183
		if (source == null) { // create an implicit source
4184
			source = createImplicitSource(operationCallExpCS, env, args);
4185
		}
4186
		C operationSourceType = source.getType();
4187
		String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4188
		OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS,
4189
			"operationCallExpCS", operationName,//$NON-NLS-1$
4190
			source, operationSourceType, args);
4191
		astNode.setMarkedPre(isAtPre(operationCallExpCS));
4192
		initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS());
4193
		if (isErrorNode(source)) {
4194
			// don't attempt to parse navigation from an unparseable source
4195
			markAsErrorNode(astNode);
4196
		}
4197
		return astNode;
4198
	}
4199
	
4200
	/**
4201
	 * @since 3.0
4202
	 */
4203
	protected OCLExpression<C> staticOperationCallExpCS(
4204
		OperationCallExpCS operationCallExpCS,
4205
		Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4206
4207
	OCLExpression<C> source = null;
4208
//	OCLExpressionCS sourceCS = operationCallExpCS.getSource();
4209
	PathNameCS pathNameCS = operationCallExpCS.getPathNameCS();
4210
4211
	EList<String> pathNames = createSequenceOfNames(pathNameCS, null);
4212
	C sourceType = lookupClassifier(pathNameCS, env, pathNames);
4213
	if (sourceType == null) {
4214
		String message = OCLMessages.bind(
4215
			OCLMessages.UnrecognizedType_ERROR_, pathNames);
4216
		ERROR(operationCallExpCS, "operatonCallExpCS", message);//$NON-NLS-1$
4217
	} else {
4218
		source = typeCS(pathNameCS, env, sourceType);
4219
	}
4220
4221
	String operationName = operationCallExpCS.getSimpleNameCS().getValue();
4222
4223
	List<OCLExpression<C>> args = argumentsCS(operationCallExpCS, env);
4224
4225
	/*
4226
	 * If the source type is a collection and operator is ".", then there is
4227
	 * an implicit COLLECT operator.
4228
	 */
4229
	C operationSourceType = source.getType();
4230
4231
	// if the sourceType is a TypeType then this must be a static operation
4232
	boolean isStatic = operationSourceType instanceof TypeType<?, ?>;
4233
4234
	OperationCallExp<C, O> astNode = genOperationCallExp(env, operationCallExpCS,
4235
		"operationCallExpCS", operationName,//$NON-NLS-1$
4236
		source, operationSourceType, args);
4237
	if (isStatic) {
4238
		@SuppressWarnings("unchecked")
4239
		TypeType<C, O> typeType = (TypeType<C, O>) operationSourceType;
4240
		O operation = astNode.getReferredOperation();
4241
4242
		// operation must either be defined by the TypeType (e.g.,
4243
		// allInstances())
4244
		// or be a static operation of the referred classifier
4245
		if (!(typeType.oclOperations().contains(operation) || uml
4246
			.isStatic(operation))) {
4247
4248
			String message = OCLMessages.bind(
4249
				OCLMessages.NonStaticOperation_ERROR_, operationName);
4250
			ERROR(astNode, "operationCallExpCS", message);//$NON-NLS-1$
4251
		}
4252
	}
4253
4254
//	astNode.setMarkedPre(isAtPre(operationCallExpCS));
4255
4256
	initPropertyPositions(astNode, operationCallExpCS.getSimpleNameCS());
4257
4258
	OCLExpression<C> result = astNode;
4259
4260
	if (isErrorNode(source)) {
4261
		// don't attempt to parse navigation from an unparseable source
4262
		markAsErrorNode(result);
4263
	}
4264
4265
	return result;
4266
}
4267
4268
	/**
4269
	 * @since 3.0
4270
	 */
4271
	protected List<OCLExpression<C>> argumentsCS(OperationCallExpCS operationCallExpCS,
4272
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env) {
4273
		List<OCLExpression<C>> args = new java.util.ArrayList<OCLExpression<C>>();
4274
		for (OCLExpressionCS arg : operationCallExpCS.getArguments()) {
4275
			OCLExpression<C> argExpr = oclExpressionCS(arg, env);
4276
			if (argExpr == null) {
4277
				argExpr = createDummyInvalidLiteralExp(env, arg);
4278
				initASTMapping(env, argExpr, arg);
4279
			}
4280
			args.add(argExpr);
4281
		}
4282
		return args;
4283
	}
4284
4176
	private void checkForXorOrAndPrecedenceHazard(OperationCallExpCS operationCallExpCS) {
4285
	private void checkForXorOrAndPrecedenceHazard(OperationCallExpCS operationCallExpCS) {
4177
		String parentOperationName = operationCallExpCS.getSimpleNameCS().getValue();
4286
		String parentOperationName = operationCallExpCS.getSimpleNameCS().getValue();
4178
		if ("xor".equals(parentOperationName)) { //$NON-NLS-1$
4287
		if ("xor".equals(parentOperationName)) { //$NON-NLS-1$
Lines 4849-4854 Link Here
4849
	/**
4958
	/**
4850
	 * @since 3.0
4959
	 * @since 3.0
4851
	 */
4960
	 */
4961
	@Deprecated  // Temporary compatibility with 3.0.0M1
4852
	public static EList<String> createSequenceOfNames(List<SimpleNameCS> simpleNames) {
4962
	public static EList<String> createSequenceOfNames(List<SimpleNameCS> simpleNames) {
4853
		EList<String> sequenceOfNames = new BasicEList<String>();
4963
		EList<String> sequenceOfNames = new BasicEList<String>();
4854
		for (SimpleNameCS simpleName : simpleNames)
4964
		for (SimpleNameCS simpleName : simpleNames)
Lines 4857-4862 Link Here
4857
	}
4967
	}
4858
4968
4859
	/**
4969
	/**
4970
	 * @since 3.0
4971
	 */
4972
	public static EList<String> createSequenceOfNames(PathNameCS pathNameCS, SimpleNameCS simpleNameCS) {
4973
		EList<String> sequenceOfNames = new BasicEList<String>();
4974
		if (pathNameCS != null) {
4975
			for (SimpleNameCS simpleName : pathNameCS.getSimpleNames())
4976
				sequenceOfNames.add(simpleName.getValue());
4977
		}
4978
		if (simpleNameCS != null) {
4979
			sequenceOfNames.add(simpleNameCS.getValue());
4980
		}
4981
		return sequenceOfNames;
4982
	}
4983
4984
	/**
4860
	 * Queries whether the specified name is escaped with an initial underscore
4985
	 * Queries whether the specified name is escaped with an initial underscore
4861
	 * (<code>'_'</code>) character.
4986
	 * (<code>'_'</code>) character.
4862
	 * 
4987
	 * 
(-)src/org/eclipse/ocl/parser/OCLParser.g (-18 / +6 lines)
Lines 63-81 Link Here
63
	./
63
	./
64
$End
64
$End
65
65
66
$KeyWords
67
	context
68
	package
69
	
70
	--
71
	-- the following are not used in the OCL concrete syntax, but
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
78
79
$Rules
66
$Rules
80
	-- opt = optional
67
	-- opt = optional
81
	-- m = multiple
68
	-- m = multiple
Lines 142-154 Link Here
142
	contextDeclCS -> operationContextDeclCS
129
	contextDeclCS -> operationContextDeclCS
143
	contextDeclCS -> propertyContextCS
130
	contextDeclCS -> propertyContextCS
144
131
145
	propertyContextCS ::= context pathNameCS '::' simpleNameCS ':' typeCS initOrDerValueCSm
132
	propertyContextCS ::= context qualifiedPathNameCS ':' typeCS initOrDerValueCSm
146
		/.$BeginJava
133
		/.$BeginJava
147
					EList<InitOrDerValueCS> list = (EList<InitOrDerValueCS>)$getSym(7);
134
					PathNameCS pathNameCS = (PathNameCS)$getSym(2);
135
					EList<InitOrDerValueCS> list = (EList<InitOrDerValueCS>)$getSym(5);
148
					CSTNode result = createPropertyContextCS(
136
					CSTNode result = createPropertyContextCS(
149
							(PathNameCS)$getSym(2),
137
							pathNameCS,
150
							(SimpleNameCS)$getSym(4),
138
							removeLastSimpleNameCS(pathNameCS),
151
							(TypeCS)$getSym(6),
139
							(TypeCS)$getSym(4),
152
							list
140
							list
153
						);
141
						);
154
					setOffsets(result, getIToken($getToken(1)), list.get(list.size()-1));
142
					setOffsets(result, getIToken($getToken(1)), list.get(list.size()-1));
(-)src/org/eclipse/ocl/parser/AbstractOCLParser.java (-48 / +110 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-342 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
		OperationCallExpCS result = createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.DOT_LITERAL, pathNameCS, simpleNameCS,
329
340
			isMarkedPreCS, arguments);
330
		if (isAtPre(isMarkedPreCS)) {
341
		if (oclExpressionCS != null) {
331
			result.setIsMarkedPreCS(isMarkedPreCS);
342
			result.setIsAtomic(true);
332
		}
343
		}
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;
344
		return result;
341
	}
345
	}
342
346
Lines 364-370 Link Here
364
			String value) {
368
			String value) {
365
		PrimitiveTypeCS result = CSTFactory.eINSTANCE.createPrimitiveTypeCS();
369
		PrimitiveTypeCS result = CSTFactory.eINSTANCE.createPrimitiveTypeCS();
366
		result.setType(type);
370
		result.setType(type);
367
		result.setValue(value);
371
		result.setValue(unquote(value));
368
		return result;
372
		return result;
369
	}
373
	}
370
374
Lines 385-394 Link Here
385
		return path;
389
		return path;
386
	}
390
	}
387
391
392
	/**
393
	 * @since 3.0
394
	 */
395
	protected SimpleNameCS removeLastSimpleNameCS(PathNameCS path) {
396
		EList<SimpleNameCS> simpleNames = path.getSimpleNames();
397
		SimpleNameCS name = simpleNames.remove(simpleNames.size()-1);
398
		setOffsets(path, path, simpleNames.get(simpleNames.size()-1));
399
		return name;
400
	}
401
388
	protected PathNameCS createPathNameCS() {
402
	protected PathNameCS createPathNameCS() {
389
		return CSTFactory.eINSTANCE.createPathNameCS();
403
		return CSTFactory.eINSTANCE.createPathNameCS();
390
	}
404
	}
391
405
406
	/**
407
	 * @since 3.0
408
	 */
409
	protected PathNameCS createPathNamePrefixCS(PathNameCS pathNameCS) {
410
		EList<SimpleNameCS> simpleNames = pathNameCS.getSimpleNames();
411
		int size = simpleNames.size();
412
		PathNameCS prefixPathNameCS = CSTFactory.eINSTANCE.createPathNameCS();
413
		if (size > 1) {
414
			for (int i = 0; i < size-1; i++) {
415
				extendPathNameCS(prefixPathNameCS, simpleNames.get(i));
416
			}
417
			setOffsets(prefixPathNameCS, prefixPathNameCS.getSimpleNames().get(0), prefixPathNameCS.getSimpleNames().get(size-2));
418
		}
419
		return prefixPathNameCS;
420
	}
421
	/**
422
	 * @since 3.0
423
	 */
424
	protected SimpleNameCS getPathNameSuffixCS(PathNameCS pathNameCS) {
425
		EList<SimpleNameCS> simpleNames = pathNameCS.getSimpleNames();
426
		int size = simpleNames.size();
427
		return size > 0 ? simpleNames.get(size-1) : null;
428
	}
429
430
	/**
431
	 * @since 3.0
432
	 */
392
	protected EnumLiteralExpCS createEnumLiteralExpCS(PathNameCS pathNameCS,
433
	protected EnumLiteralExpCS createEnumLiteralExpCS(PathNameCS pathNameCS,
393
			SimpleNameCS simpleNameCS) {
434
			SimpleNameCS simpleNameCS) {
394
		EnumLiteralExpCS result = CSTFactory.eINSTANCE.createEnumLiteralExpCS();
435
		EnumLiteralExpCS result = CSTFactory.eINSTANCE.createEnumLiteralExpCS();
Lines 398-419 Link Here
398
	}
439
	}
399
440
400
	/**
441
	/**
401
	 * @deprecated Use {@link #createEnumLiteralExpCS(PathNameCS, SimpleNameCS)}
442
	 * @since 3.0
402
	 *             , instead.
403
	 */
443
	 */
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(
444
	protected CollectionLiteralExpCS createCollectionLiteralExpCS(
412
			CollectionTypeIdentifierEnum type,
445
			CollectionTypeCS typeCS,
413
			EList<CollectionLiteralPartCS> collectionLiteralParts) {
446
			EList<CollectionLiteralPartCS> collectionLiteralParts) {
414
		CollectionLiteralExpCS result = CSTFactory.eINSTANCE
447
		CollectionLiteralExpCS result = CSTFactory.eINSTANCE
415
			.createCollectionLiteralExpCS();
448
			.createCollectionLiteralExpCS();
416
		result.setCollectionType(type);
449
		result.setCollectionType(typeCS.getCollectionTypeIdentifier());
417
		result.getCollectionLiteralParts().addAll(collectionLiteralParts);
450
		result.getCollectionLiteralParts().addAll(collectionLiteralParts);
418
		return result;
451
		return result;
419
	}
452
	}
Lines 500-505 Link Here
500
	protected BooleanLiteralExpCS createBooleanLiteralExpCS(String string) {
533
	protected BooleanLiteralExpCS createBooleanLiteralExpCS(String string) {
501
		BooleanLiteralExpCS result = CSTFactory.eINSTANCE
534
		BooleanLiteralExpCS result = CSTFactory.eINSTANCE
502
			.createBooleanLiteralExpCS();
535
			.createBooleanLiteralExpCS();
536
		result.setValue(string);
537
		result.setType(SimpleTypeEnum.KEYWORD_LITERAL);
503
		result.setSymbol(string);
538
		result.setSymbol(string);
504
		result.setBooleanSymbol(Boolean.valueOf(string));
539
		result.setBooleanSymbol(Boolean.valueOf(string));
505
		return result;
540
		return result;
Lines 507-527 Link Here
507
542
508
	protected NullLiteralExpCS createNullLiteralExpCS(String string) {
543
	protected NullLiteralExpCS createNullLiteralExpCS(String string) {
509
		NullLiteralExpCS result = CSTFactory.eINSTANCE.createNullLiteralExpCS();
544
		NullLiteralExpCS result = CSTFactory.eINSTANCE.createNullLiteralExpCS();
510
		result.setSymbol(string);
545
		result.setValue(string);
546
		result.setType(SimpleTypeEnum.KEYWORD_LITERAL);
511
		return result;
547
		return result;
512
	}
548
	}
513
549
514
	protected InvalidLiteralExpCS createInvalidLiteralExpCS(String string) {
550
	protected InvalidLiteralExpCS createInvalidLiteralExpCS(String string) {
515
		InvalidLiteralExpCS result = CSTFactory.eINSTANCE
551
		InvalidLiteralExpCS result = CSTFactory.eINSTANCE
516
			.createInvalidLiteralExpCS();
552
			.createInvalidLiteralExpCS();
517
		result.setSymbol(string);
553
		result.setValue(string);
554
		result.setType(SimpleTypeEnum.KEYWORD_LITERAL);
518
		return result;
555
		return result;
519
	}
556
	}
520
557
521
	protected IteratorExpCS createIteratorExpCS(SimpleNameCS simpleNameCS,
558
	/**
559
	 * @since 3.0
560
	 */
561
	protected IteratorExpCS createIteratorExpCS(
562
			OCLExpressionCS source, SimpleNameCS simpleNameCS,
522
			VariableCS variable1, VariableCS variable2,
563
			VariableCS variable1, VariableCS variable2,
523
			OCLExpressionCS oclExpressionCS) {
564
			OCLExpressionCS oclExpressionCS) {
524
		IteratorExpCS result = CSTFactory.eINSTANCE.createIteratorExpCS();
565
		IteratorExpCS result = CSTFactory.eINSTANCE.createIteratorExpCS();
566
		result.setSource(source);
567
		result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
525
		result.setSimpleNameCS(simpleNameCS);
568
		result.setSimpleNameCS(simpleNameCS);
526
		result.setVariable1(variable1);
569
		result.setVariable1(variable1);
527
		result.setVariable2(variable2);
570
		result.setVariable2(variable2);
Lines 529-538 Link Here
529
		return result;
572
		return result;
530
	}
573
	}
531
574
532
	protected IterateExpCS createIterateExpCS(SimpleNameCS simpleNameCS,
575
	/**
576
	 * @since 3.0
577
	 */
578
	protected IterateExpCS createIterateExpCS(
579
			OCLExpressionCS source, SimpleNameCS simpleNameCS,
533
			VariableCS variable1, VariableCS variable2,
580
			VariableCS variable1, VariableCS variable2,
534
			OCLExpressionCS oclExpressionCS) {
581
			OCLExpressionCS oclExpressionCS) {
535
		IterateExpCS result = CSTFactory.eINSTANCE.createIterateExpCS();
582
		IterateExpCS result = CSTFactory.eINSTANCE.createIterateExpCS();
583
		result.setSource(source);
584
		result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
536
		result.setSimpleNameCS(simpleNameCS);
585
		result.setSimpleNameCS(simpleNameCS);
537
		result.setVariable1(variable1);
586
		result.setVariable1(variable1);
538
		result.setVariable2(variable2);
587
		result.setVariable2(variable2);
Lines 540-559 Link Here
540
		return result;
589
		return result;
541
	}
590
	}
542
591
543
	protected VariableCS createVariableCS(String varName, TypeCS typeCS,
592
	/**
544
			OCLExpressionCS oclExpressionCS) {
593
	 * @since 3.0
594
	 */
595
	protected VariableCS createVariableCS(String varName) {
545
		VariableCS result = CSTFactory.eINSTANCE.createVariableCS();
596
		VariableCS result = CSTFactory.eINSTANCE.createVariableCS();
546
		result.setName(unquote(varName));
597
		result.setName(unquote(varName));
547
		result.setTypeCS(typeCS);
548
		result.setInitExpression(oclExpressionCS);
549
		return result;
598
		return result;
550
	}
599
	}
551
600
601
	/**
602
	 * @since 3.0
603
	 */
552
	protected CollectionTypeCS createCollectionTypeCS(
604
	protected CollectionTypeCS createCollectionTypeCS(
553
			CollectionTypeIdentifierEnum collectionType, TypeCS typeCS) {
605
			CollectionTypeIdentifierEnum collectionType, String value) {
554
		CollectionTypeCS result = CSTFactory.eINSTANCE.createCollectionTypeCS();
606
		CollectionTypeCS result = CSTFactory.eINSTANCE.createCollectionTypeCS();
607
		result.setType(SimpleTypeEnum.IDENTIFIER_LITERAL);
608
		result.setValue(unquote(value));
555
		result.setCollectionTypeIdentifier(collectionType);
609
		result.setCollectionTypeIdentifier(collectionType);
556
		result.setTypeCS(typeCS);
557
		return result;
610
		return result;
558
	}
611
	}
559
612
Lines 563-572 Link Here
563
		return result;
616
		return result;
564
	}
617
	}
565
618
619
	/**
620
	 * @since 3.0
621
	 */
566
	protected FeatureCallExpCS createFeatureCallExpCS(
622
	protected FeatureCallExpCS createFeatureCallExpCS(
567
			SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments,
623
			OCLExpressionCS source, SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments,
568
			IsMarkedPreCS isMarkedPreCS) {
624
			IsMarkedPreCS isMarkedPreCS) {
569
		FeatureCallExpCS result = CSTFactory.eINSTANCE.createFeatureCallExpCS();
625
		FeatureCallExpCS result = CSTFactory.eINSTANCE.createFeatureCallExpCS();
626
		result.setSource(source);
627
		result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
570
		result.setSimpleNameCS(simpleNameCS);
628
		result.setSimpleNameCS(simpleNameCS);
571
		result.getArguments().addAll(arguments);
629
		result.getArguments().addAll(arguments);
572
630
Lines 602-610 Link Here
602
		return result;
660
		return result;
603
	}
661
	}
604
662
605
	protected MessageExpCS createMessageExpCS(boolean hasSent,
663
	/**
664
	 * @since 3.0
665
	 */
666
	protected MessageExpCS createMessageExpCS(OCLExpressionCS target, boolean hasSent,
606
			SimpleNameCS simpleNameCS, EList<OCLMessageArgCS> oclMessageArgs) {
667
			SimpleNameCS simpleNameCS, EList<OCLMessageArgCS> oclMessageArgs) {
607
		MessageExpCS result = CSTFactory.eINSTANCE.createMessageExpCS();
668
		MessageExpCS result = CSTFactory.eINSTANCE.createMessageExpCS();
669
		result.setTarget(target);
608
		result.setKind(hasSent
670
		result.setKind(hasSent
609
			? MessageExpKind.HAS_SENT_LITERAL
671
			? MessageExpKind.HAS_SENT_LITERAL
610
			: MessageExpKind.SENT_LITERAL);
672
			: MessageExpKind.SENT_LITERAL);
(-)src/org/eclipse/ocl/parser/OCLKWLexer.g
Lines 12-18 Link Here
12
-- *
12
-- *
13
-- * </copyright>
13
-- * </copyright>
14
-- *
14
-- *
(-)* $Id: OCLKWLexer.g,v 1.4 2009/10/02 20:55:33 ewillink Exp $ (-78 / +2 lines)
Lines 50-59 Link Here
50
 * Contributors:
50
 * Contributors:
51
 *   IBM - Initial API and implementation
51
 *   IBM - Initial API and implementation
52
 *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
52
 *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
53
 *   E.D.Willink - Bug 285633 static definitions
53
$copyright_contributions
54
$copyright_contributions
54
 * </copyright>
55
 * </copyright>
55
 *
56
 *
56
 * $Id: OCLKWLexer.g,v 1.4 2009/10/02 20:55:33 ewillink Exp $
57
 * $Id: OCLKWLexer.g,v 1.3 2009/09/04 08:27:07 ewillink Exp $
57
 */
58
 */
58
	./
59
	./
59
$End
60
$End
Lines 101-114 Link Here
101
	null
102
	null
102
	invalid
103
	invalid
103
--  return  -- don't need a keyword for LPG purposes
104
--  return  -- don't need a keyword for LPG purposes
104
	
105
	--
106
	-- the following are not used in the OCL concrete syntax, but
107
	-- are defined as reserved words in the OCL 2.0 Spec 7.4.9
108
	-- and were removed in the OCL 2.1 RTF 09-05-02. 
109
	--
110
	attr
111
	oper
112
105
113
	--
106
	--
114
	-- the following were introduced in the OCL 2.1 RTF 09-05-02. 
107
	-- the following were introduced in the OCL 2.1 RTF 09-05-02. 
Lines 144-158 Link Here
144
	--
137
	--
145
	closure
138
	closure
146
139
147
	oclIsKindOf
148
	oclIsTypeOf
149
	oclAsType
150
	oclIsNew
151
	oclIsUndefined
152
	oclIsInvalid
153
	oclIsInState
154
	allInstances
155
156
	String
140
	String
157
	Integer
141
	Integer
158
	UnlimitedNatural
142
	UnlimitedNatural
Lines 429-482 Link Here
429
			$setResult($_closure);
413
			$setResult($_closure);
430
		  $EndAction
414
		  $EndAction
431
		./
415
		./
432
		
433
		| o c l I s K i n d O f
434
		/.$BeginAction
435
			$setResult($_oclIsKindOf);
436
		  $EndAction
437
		./
438
439
		| o c l I s T y p e O f
440
		/.$BeginAction
441
			$setResult($_oclIsTypeOf);
442
		  $EndAction
443
		./
444
		
445
		| o c l A s T y p e
446
		/.$BeginAction
447
			$setResult($_oclAsType);
448
		  $EndAction
449
		./
450
		
451
		| o c l I s N e w
452
		/.$BeginAction
453
			$setResult($_oclIsNew);
454
		  $EndAction
455
		./
456
		
457
		| o c l I s U n d e f i n e d
458
		/.$BeginAction
459
			$setResult($_oclIsUndefined);
460
		  $EndAction
461
		./
462
		
463
		| o c l I s I n v a l i d
464
		/.$BeginAction
465
			$setResult($_oclIsInvalid);
466
		  $EndAction
467
		./
468
		
469
		| o c l I s I n S t a t e
470
		/.$BeginAction
471
			$setResult($_oclIsInState);
472
		  $EndAction
473
		./
474
		
475
		| a l l I n s t a n c e s
476
		/.$BeginAction
477
			$setResult($_allInstances);
478
		  $EndAction
479
		./
480
416
481
		| S t r i n g
417
		| S t r i n g
482
		/.$BeginAction
418
		/.$BeginAction
Lines 550-567 Link Here
550
		  $EndAction
486
		  $EndAction
551
		./
487
		./
552
488
553
		| a t t r
554
		/.$BeginAction
555
			$setResult($_attr);
556
		  $EndAction
557
		./
558
559
		| o p e r
560
		/.$BeginAction
561
			$setResult($_oper);
562
		  $EndAction
563
		./
564
565
		| s t a t i c
489
		| s t a t i c
566
		/.$BeginAction
490
		/.$BeginAction
567
			$setResult($_static);
491
			$setResult($_static);
(-)src/org/eclipse/ocl/parser/EssentialOCL.g
Lines 12-18 Link Here
12
-- *
12
-- *
13
-- * </copyright>
13
-- * </copyright>
14
-- *
14
-- *
(-)* $Id: EssentialOCL.g,v 1.12 2009/10/04 11:15:51 ewillink Exp $ (-22 / +25 lines)
Lines 193-204 Link Here
193
 *   IBM - Initial API and implementation
193
 *   IBM - Initial API and implementation
194
 *   E.D.Willink - Elimination of some shift-reduce conflicts
194
 *   E.D.Willink - Elimination of some shift-reduce conflicts
195
 *   E.D.Willink - Remove unnecessary warning suppression
195
 *   E.D.Willink - Remove unnecessary warning suppression
196
 *   E.D.Willink - Bugs 225493, 243976, 259818, 282882, 287993, 288040
196
 *   E.D.Willink - Bugs 184048, 225493, 243976, 259818, 282882, 287993, 288040
197
 *   Borland - Bug 242880
197
 *   Borland - Bug 242880
198
$copyright_contributions
198
$copyright_contributions
199
 * </copyright>
199
 * </copyright>
200
 *
200
 *
201
 * $Id: EssentialOCL.g,v 1.12 2009/10/04 11:15:51 ewillink Exp $
201
 * $Id: EssentialOCL.g,v 1.10 2009/09/04 13:40:43 ewillink Exp $
202
 */
202
 */
203
	./
203
	./
204
$End
204
$End
Lines 208-215 Link Here
208
	import org.eclipse.emf.common.util.EList;
208
	import org.eclipse.emf.common.util.EList;
209
	import org.eclipse.ocl.cst.CSTNode;
209
	import org.eclipse.ocl.cst.CSTNode;
210
	import org.eclipse.ocl.cst.CallExpCS;
210
	import org.eclipse.ocl.cst.CallExpCS;
211
	import org.eclipse.ocl.cst.CollectionTypeCS;
211
	import org.eclipse.ocl.cst.CollectionTypeIdentifierEnum;
212
	import org.eclipse.ocl.cst.CollectionTypeIdentifierEnum;
212
	import org.eclipse.ocl.cst.DotOrArrowEnum;
213
	import org.eclipse.ocl.cst.IntegerLiteralExpCS;
213
	import org.eclipse.ocl.cst.IntegerLiteralExpCS;
214
	import org.eclipse.ocl.cst.IsMarkedPreCS;
214
	import org.eclipse.ocl.cst.IsMarkedPreCS;
215
	import org.eclipse.ocl.cst.MessageExpCS;
215
	import org.eclipse.ocl.cst.MessageExpCS;
Lines 219-225 Link Here
219
	import org.eclipse.ocl.cst.PathNameCS;
219
	import org.eclipse.ocl.cst.PathNameCS;
220
	import org.eclipse.ocl.cst.SimpleNameCS;
220
	import org.eclipse.ocl.cst.SimpleNameCS;
221
	import org.eclipse.ocl.cst.SimpleTypeEnum;
221
	import org.eclipse.ocl.cst.SimpleTypeEnum;
222
	import org.eclipse.ocl.cst.StateExpCS;
223
	import org.eclipse.ocl.cst.StringLiteralExpCS;
222
	import org.eclipse.ocl.cst.StringLiteralExpCS;
224
	import org.eclipse.ocl.cst.TypeCS;
223
	import org.eclipse.ocl.cst.TypeCS;
225
	import org.eclipse.ocl.cst.VariableCS;
224
	import org.eclipse.ocl.cst.VariableCS;
Lines 239-287 Link Here
239
$End
238
$End
240
239
241
$KeyWords
240
$KeyWords
242
	self
241
	-- EssentialOCL keywords
243
	inv
242
	and
244
	pre
245
	post
246
	endpackage
247
	def
248
	if
249
	then
250
	else
243
	else
251
	endif
244
	endif
252
	and
245
	if
253
	or
254
	xor
255
	not
256
	implies
246
	implies
257
	let
258
	in
247
	in
259
	true
248
	let
260
	false
249
	not
250
	or
251
	then
252
	xor
253
	
254
	-- CompleteOCL keywords
255
	body
256
	context
257
	def
258
	derive
259
	endpackage
260
	init
261
	inv
262
	package
263
	post
264
	pre
265
	static
261
266
262
	--
267
	--
263
	-- the following appear to have been omitted from the list of
268
	-- the following appear to have been omitted from the list of
264
	-- OCL reserved words in Section 7.4.9.  They will be treated 
269
	-- OCL reserved words in Section 7.4.9.  They will be treated 
265
	-- as unreserved for compliance
270
	-- as unreserved for compliance
266
	--
271
	--
267
	body
272
	false
268
	derive
269
	init
270
	null
273
	null
271
	invalid
274
	invalid
(-)return -- don't need a keyword for LPG purposes (-323 / +286 lines)
Lines 296-321 Link Here
296
	sortedBy
311
	sortedBy
297
312
298
	closure
313
	closure
299
300
	oclIsKindOf
301
	oclIsTypeOf
302
	oclAsType
303
	oclIsNew
304
	oclIsUndefined
305
	oclIsInvalid
306
	oclIsInState
307
	allInstances
308
309
	String
310
	Integer
311
	UnlimitedNatural
312
	Real
313
	Boolean
314
	Tuple
315
	OclAny
316
	OclVoid
317
	OclInvalid
318
	OclMessage
319
$End
314
$End
320
315
321
$Identifier
316
$Identifier
Lines 399-426 Link Here
399
	-- and are commonly used in models such as the UML metamodel, itself
394
	-- and are commonly used in models such as the UML metamodel, itself
400
	--
395
	--
401
	
396
	
402
	binaryIdentifier -> oclIsUndefined
397
	binaryKeyword -> and
403
	binaryIdentifier -> oclIsInvalid
398
	binaryKeyword -> or
404
	binaryIdentifier -> oclIsNew
399
	binaryKeyword -> xor
405
	binaryIdentifier -> oclAsType
400
	binaryPunctuation -> EQUAL
406
	binaryIdentifier -> oclIsKindOf
401
	binaryPunctuation -> NOT_EQUAL
407
	binaryIdentifier -> oclIsTypeOf
402
	binaryPunctuation -> PLUS
408
	binaryIdentifier -> EQUAL
403
	binaryPunctuation -> MULTIPLY
409
	binaryIdentifier -> NOT_EQUAL
404
	binaryPunctuation -> DIVIDE
410
	binaryIdentifier -> PLUS
405
	binaryPunctuation -> GREATER
411
	binaryIdentifier -> MULTIPLY
406
	binaryPunctuation -> LESS
412
	binaryIdentifier -> DIVIDE
407
	binaryPunctuation -> GREATER_EQUAL
413
	binaryIdentifier -> GREATER
408
	binaryPunctuation -> LESS_EQUAL
414
	binaryIdentifier -> LESS
415
	binaryIdentifier -> GREATER_EQUAL
416
	binaryIdentifier -> LESS_EQUAL
417
	binaryIdentifier -> and
418
	binaryIdentifier -> or
419
	binaryIdentifier -> xor
420
409
421
	unaryIdentifier -> MINUS
410
	unaryKeyword -> not
422
	unaryIdentifier -> not
411
	unaryPunctuation -> MINUS
423
412
413
	iterateIdentifier -> iterate
414
	
424
	iteratorIdentifier -> forAll
415
	iteratorIdentifier -> forAll
425
	iteratorIdentifier -> exists
416
	iteratorIdentifier -> exists
426
	iteratorIdentifier -> isUnique
417
	iteratorIdentifier -> isUnique
Lines 433-461 Link Here
433
	iteratorIdentifier -> sortedBy
424
	iteratorIdentifier -> sortedBy
434
	iteratorIdentifier -> closure
425
	iteratorIdentifier -> closure
435
426
436
	keywordAsIdentifier1 -> iterate
427
	reservedKeyword -> binaryKeyword
437
	keywordAsIdentifier1 -> iteratorIdentifier
428
	reservedKeyword -> unaryKeyword
438
	keywordAsIdentifier1 -> allInstances
429
	-- Eliminate these for EssentialOCL
439
	keywordAsIdentifier1 -> body
430
	reservedKeyword -> body
440
	keywordAsIdentifier1 -> derive
431
	reservedKeyword -> context
441
	keywordAsIdentifier1 -> init
432
	reservedKeyword -> def
442
	keywordAsIdentifier1 -> Set
433
	reservedKeyword -> derive
443
	keywordAsIdentifier1 -> Bag
434
	reservedKeyword -> endpackage
444
	keywordAsIdentifier1 -> Sequence
435
	reservedKeyword -> init
445
	keywordAsIdentifier1 -> Collection
436
	reservedKeyword -> inv
446
	keywordAsIdentifier1 -> OrderedSet
437
	reservedKeyword -> package
447
	--------
438
	reservedKeyword -> post
448
	keywordAsIdentifier -> keywordAsIdentifier1
439
	reservedKeyword -> pre
449
	keywordAsIdentifier -> null
440
	reservedKeyword -> static
450
441
451
	binaryName -> simpleNameCS
442
	reservedPunctuation -> binaryPunctuation
452
	binaryName ::= binaryIdentifier
443
	reservedPunctuation -> unaryPunctuation
453
		/.$NewCase./
444
454
	keywordAsName ::= keywordAsIdentifier
445
	reservedKeywordCS ::= reservedKeyword
455
		/.$NewCase./
456
	keywordAsName1 ::= keywordAsIdentifier1
457
		/.$NewCase./
446
		/.$NewCase./
458
	unaryName ::= unaryIdentifier
447
	reservedPunctuationCS ::= reservedPunctuation
459
		/.$BeginJava
448
		/.$BeginJava
460
					SimpleNameCS result = createSimpleNameCS(
449
					SimpleNameCS result = createSimpleNameCS(
461
								SimpleTypeEnum.IDENTIFIER_LITERAL,
450
								SimpleTypeEnum.IDENTIFIER_LITERAL,
Lines 466-476 Link Here
466
		  $EndJava
455
		  $EndJava
467
		./
456
		./
468
		
457
		
469
	iterateName ::= iterate
458
	iterateNameCS ::= iterateIdentifier
470
		/.$NewCase./
459
		/.$NewCase./
471
	iteratorName ::= iteratorIdentifier
460
	iteratorNameCS ::= iteratorIdentifier
472
		/.$NewCase./
473
	oclIsInStateName ::= oclIsInState
474
		/.$BeginJava
461
		/.$BeginJava
475
					SimpleNameCS result = createSimpleNameCS(
462
					SimpleNameCS result = createSimpleNameCS(
476
								SimpleTypeEnum.KEYWORD_LITERAL,
463
								SimpleTypeEnum.KEYWORD_LITERAL,
Lines 481-492 Link Here
481
		  $EndJava
468
		  $EndJava
482
		./
469
		./
483
470
471
	literalSimpleNameCS -> booleanLiteralExpCS
472
	literalSimpleNameCS -> invalidLiteralExpCS
473
	literalSimpleNameCS -> nullLiteralExpCS
474
		
475
	notIteratorNorReservedSimpleNameCS -> collectionTypeIdentifierCS
476
--	notIteratorNorReservedSimpleNameCS -> iterateNameCS
477
--	notIteratorNorReservedSimpleNameCS -> iteratorNameCS
478
	notIteratorNorReservedSimpleNameCS -> literalSimpleNameCS
479
--	notIteratorNorReservedSimpleNameCS -> reservedKeywordCS
480
	notIteratorNorReservedSimpleNameCS -> simpleIdentifierCS
481
482
	notLiteralNorReservedSimpleNameCS -> collectionTypeIdentifierCS
483
	notLiteralNorReservedSimpleNameCS -> iterateNameCS
484
	notLiteralNorReservedSimpleNameCS -> iteratorNameCS
485
--	notLiteralNorReservedSimpleNameCS -> literalSimpleNameCS
486
--	notLiteralNorReservedSimpleNameCS -> reservedKeywordCS
487
	notLiteralNorReservedSimpleNameCS -> simpleIdentifierCS	-- IDENTIFIER, self, primitiveTypeCS
488
489
	notReservedSimpleNameCS -> notLiteralNorReservedSimpleNameCS
490
	notReservedSimpleNameCS -> literalSimpleNameCS
491
492
	simpleNameCS -> notReservedSimpleNameCS
493
	simpleNameCS -> reservedKeywordCS
494
	
495
	operationOrNotReservedSimpleNameCS -> notReservedSimpleNameCS
496
	operationOrNotReservedSimpleNameCS -> reservedKeywordCS
497
	operationOrNotReservedSimpleNameCS -> reservedPunctuationCS
498
484
	--
499
	--
485
	-- the 'operationCS' non-terminal is not referenced in this grammar
500
	-- the 'operationCS' non-terminal is not referenced in this grammar
486
	--
501
	--
487
	operationCS -> operationCS1
502
	operationCS -> operationCS1
488
	operationCS -> operationCS2
503
	operationCS -> operationCS2
489
	operationCS1 ::= IDENTIFIER '(' parametersCSopt ')' ':' typeCSopt
504
	operationCS1 ::= notReservedSimpleNameCS '(' variableListCSopt ')' ':' typeCSopt
490
		/.$BeginJava
505
		/.$BeginJava
491
					CSTNode result = createOperationCS(
506
					CSTNode result = createOperationCS(
492
							getTokenText($getToken(1)),
507
							getTokenText($getToken(1)),
Lines 501-542 Link Here
501
					$setResult(result);
516
					$setResult(result);
502
		  $EndJava
517
		  $EndJava
503
		./
518
		./
504
	operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ')' ':' typeCSopt
519
	operationCS2 ::= qualifiedPathNameCS '(' variableListCSopt ')' ':' typeCSopt
505
		/.$BeginJava
520
		/.$BeginJava
521
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
522
					TypeCS typeCS = (TypeCS)$getSym(6);
506
					CSTNode result = createOperationCS(
523
					CSTNode result = createOperationCS(
507
							(PathNameCS)$getSym(1),
524
							pathNameCS,
508
							(SimpleNameCS)$getSym(3),
525
							removeLastSimpleNameCS(pathNameCS),
509
							(EList)$getSym(5),
526
							(EList)$getSym(3),
510
							(TypeCS)$getSym(8)
527
							typeCS
511
						);
528
						);
512
					if ($getSym(8) != null) {
529
					if (typeCS != null) {
513
						setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(8));
530
						setOffsets(result, pathNameCS, typeCS);
514
					} else {
531
					} else {
515
						setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(7)));
532
						setOffsets(result, pathNameCS, getIToken($getToken(5)));
516
					}
533
					}
517
					$setResult(result);
534
					$setResult(result);
518
		  $EndJava
535
		  $EndJava
519
		./
536
		./
520
537
521
522
	parametersCSopt ::= $empty
523
		/.$EmptyListAction./
524
	parametersCSopt -> parametersCS
525
	parametersCS ::= variableCS
526
		/.$BeginJava
527
					EList result = new BasicEList();
528
					result.add($getSym(1));
529
					$setResult(result);
530
		  $EndJava
531
		./
532
	parametersCS ::= parametersCS ',' variableCS
533
		/.$BeginJava
534
					EList result = (EList)$getSym(1);
535
					result.add($getSym(3));
536
					$setResult(result);
537
		  $EndJava
538
		./
539
540
	simpleNameCSopt ::= $empty
538
	simpleNameCSopt ::= $empty
541
		/.$NullAction./
539
		/.$NullAction./
542
	simpleNameCSopt -> simpleNameCS	
540
	simpleNameCSopt -> simpleNameCS	
Lines 583-610 Link Here
583
	equalityWithLet ::= equalityExpCS '<>' relationalWithLet
581
	equalityWithLet ::= equalityExpCS '<>' relationalWithLet
584
		/.$NewCase./
582
		/.$NewCase./
585
	
583
	
586
	relationalExpCS -> ifExpCSPrec
584
	relationalExpCS -> additiveExpCS
587
	-- Note that ifExp already embeds let, so we needn't deal with it here
588
	relationalWithLet -> additiveWithLet
585
	relationalWithLet -> additiveWithLet
589
	relationalExpCS ::= relationalExpCS '>' ifExpCSPrec
586
	relationalExpCS ::= relationalExpCS '>' additiveExpCS
590
		/.$NewCase./
587
		/.$NewCase./
591
	relationalWithLet ::= relationalExpCS '>' additiveWithLet
588
	relationalWithLet ::= relationalExpCS '>' additiveWithLet
592
		/.$NewCase./
589
		/.$NewCase./
593
	relationalExpCS ::= relationalExpCS '<' ifExpCSPrec
590
	relationalExpCS ::= relationalExpCS '<' additiveExpCS
594
		/.$NewCase./
591
		/.$NewCase./
595
	relationalWithLet ::= relationalExpCS '<' additiveWithLet
592
	relationalWithLet ::= relationalExpCS '<' additiveWithLet
596
		/.$NewCase./
593
		/.$NewCase./
597
	relationalExpCS ::= relationalExpCS '>=' ifExpCSPrec
594
	relationalExpCS ::= relationalExpCS '>=' additiveExpCS
598
		/.$NewCase./
595
		/.$NewCase./
599
	relationalWithLet ::= relationalExpCS '>=' additiveWithLet
596
	relationalWithLet ::= relationalExpCS '>=' additiveWithLet
600
		/.$NewCase./
597
		/.$NewCase./
601
	relationalExpCS ::= relationalExpCS '<=' ifExpCSPrec
598
	relationalExpCS ::= relationalExpCS '<=' additiveExpCS
602
		/.$NewCase./
599
		/.$NewCase./
603
	relationalWithLet ::= relationalExpCS '<=' additiveWithLet
600
	relationalWithLet ::= relationalExpCS '<=' additiveWithLet
604
		/.$NewCase./
601
		/.$NewCase./
605
	
606
	ifExpCSPrec -> additiveExpCS
607
	ifExpCSPrec -> ifExpCS
608
602
609
	additiveExpCS -> multiplicativeExpCS
603
	additiveExpCS -> multiplicativeExpCS
610
	additiveWithLet -> multiplicativeWithLet
604
	additiveWithLet -> multiplicativeWithLet
Lines 680-701 Link Here
680
		./
674
		./
681
675
682
	dotArrowExpCS -> oclExpCS
676
	dotArrowExpCS -> oclExpCS
683
	dotArrowExpCS ::= dotArrowExpCS callExpCS
677
	dotArrowExpCS -> callExpCS
684
		/.$BeginJava
678
	dotArrowExpCS -> oclMessageExpCS
685
					CallExpCS result = (CallExpCS)$getSym(2);
686
					result.setSource((OCLExpressionCS)$getSym(1));
687
					setOffsets(result, (CSTNode)$getSym(1), result);
688
					$setResult(result);
689
		  $EndJava
690
		./
691
	dotArrowExpCS ::= dotArrowExpCS messageExpCS
692
		/.$BeginJava
693
					MessageExpCS result = (MessageExpCS)$getSym(2);
694
					result.setTarget((OCLExpressionCS)$getSym(1));
695
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2));
696
					$setResult(result);
697
		  $EndJava
698
		./
699
	dotArrowExpCS ::= NUMERIC_OPERATION '(' argumentsCSopt ')'
679
	dotArrowExpCS ::= NUMERIC_OPERATION '(' argumentsCSopt ')'
700
		/.$BeginJava
680
		/.$BeginJava
701
					// NUMERIC_OPERATION -> Integer '.' Identifier
681
					// NUMERIC_OPERATION -> Integer '.' Identifier
Lines 739-763 Link Here
739
		  $EndJava
719
		  $EndJava
740
		./
720
		./
741
721
742
    -- static operation call (@pre is not permitted in this context)
722
	oclExpCS -> ifExpCS
743
	dotArrowExpCS ::=  pathNameCS '::' simpleNameCS '(' argumentsCSopt ')'
723
	oclExpCS -> associationClassCallExpCS
744
		/.$BeginJava
745
					OperationCallExpCS result = createOperationCallExpCS(
746
							(PathNameCS)$getSym(1),
747
							(SimpleNameCS)$getSym(3),
748
							(EList)$getSym(5)
749
						);
750
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6)));
751
					result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
752
					$setResult(result);
753
		  $EndJava
754
		./
755
756
757
	oclExpCS -> variableExpCS
758
	oclExpCS -> literalExpCS
724
	oclExpCS -> literalExpCS
759
	oclExpCS -> operationCallExpCS
725
	oclExpCS -> operationCallExpCS_DF
760
	oclExpCS -> keywordOperationCallExpCS
726
	oclExpCS -> operationCallExpCS_G
761
727
762
	oclExpCS ::= '(' oclExpressionCS ')'
728
	oclExpCS ::= '(' oclExpressionCS ')'
763
		/.$BeginJava
729
		/.$BeginJava
Lines 770-778 Link Here
770
		  $EndJava
736
		  $EndJava
771
		./
737
		./
772
738
773
	variableExpCS ::= simpleNameCS isMarkedPreCS
739
	associationClassCallExpCS ::= notLiteralNorReservedSimpleNameCS isMarkedPreCSopt
774
		/.$NewCase./
775
	variableExpCS ::= keywordAsName1 isMarkedPreCS
776
		/.$BeginJava
740
		/.$BeginJava
777
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2);
741
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2);
778
					CSTNode result = createVariableExpCS(
742
					CSTNode result = createVariableExpCS(
Lines 788-796 Link Here
788
					$setResult(result);
752
					$setResult(result);
789
		  $EndJava
753
		  $EndJava
790
		./
754
		./
791
	variableExpCS ::= simpleNameCS '[' argumentsCS ']' isMarkedPreCS
755
	associationClassCallExpCS ::= notReservedSimpleNameCS '[' argumentsCS ']' isMarkedPreCSopt
792
		/.$NewCase./
793
	variableExpCS ::= keywordAsName1 '[' argumentsCS ']' isMarkedPreCS
794
		/.$BeginJava
756
		/.$BeginJava
795
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5);
757
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5);
796
					CSTNode result = createVariableExpCS(
758
					CSTNode result = createVariableExpCS(
Lines 807-815 Link Here
807
		  $EndJava
769
		  $EndJava
808
		./
770
		./
809
771
810
772
	simpleIdentifierCS -> primitiveTypeCS
811
	simpleNameCS -> primitiveTypeCS
773
	simpleIdentifierCS ::= self
812
	simpleNameCS ::= self
813
		/.$BeginJava
774
		/.$BeginJava
814
					CSTNode result = createSimpleNameCS(
775
					CSTNode result = createSimpleNameCS(
815
							SimpleTypeEnum.SELF_LITERAL,
776
							SimpleTypeEnum.SELF_LITERAL,
Lines 819-825 Link Here
819
					$setResult(result);
780
					$setResult(result);
820
		  $EndJava
781
		  $EndJava
821
		./
782
		./
822
	simpleNameCS -> simpleIdentifierCS
823
	simpleIdentifierCS ::= IDENTIFIER
783
	simpleIdentifierCS ::= IDENTIFIER
824
		/.$BeginJava
784
		/.$BeginJava
825
					CSTNode result = createSimpleNameCS(
785
					CSTNode result = createSimpleNameCS(
Lines 922-928 Link Here
922
		  $EndJava
882
		  $EndJava
923
		./
883
		./
924
884
925
	pathNameCS ::= simpleIdentifierCS
885
	pathNameCS ::= notReservedSimpleNameCS
926
		/.$BeginJava
886
		/.$BeginJava
927
					SimpleNameCS simpleName = (SimpleNameCS)$getSym(1);
887
					SimpleNameCS simpleName = (SimpleNameCS)$getSym(1);
928
					PathNameCS result = createPathNameCS(simpleName);
888
					PathNameCS result = createPathNameCS(simpleName);
Lines 930-936 Link Here
930
					$setResult(result);
890
					$setResult(result);
931
		  $EndJava
891
		  $EndJava
932
		./
892
		./
933
	pathNameCS ::= pathNameCS '::' simpleNameCS
893
	qualifiedPathNameCS ::= pathNameCS '::' notReservedSimpleNameCS
934
		/.$BeginJava
894
		/.$BeginJava
935
					PathNameCS result = (PathNameCS)$getSym(1);
895
					PathNameCS result = (PathNameCS)$getSym(1);
936
					SimpleNameCS simpleName = (SimpleNameCS)$getSym(3);
896
					SimpleNameCS simpleName = (SimpleNameCS)$getSym(3);
Lines 939-952 Link Here
939
					$setResult(result);
899
					$setResult(result);
940
		  $EndJava
900
		  $EndJava
941
		./
901
		./
942
902
	pathNameCS -> qualifiedPathNameCS
943
	pathNameCSOpt ::= $empty
944
		/.$BeginJava
945
					CSTNode result = createPathNameCS();
946
					$setResult(result);
947
		  $EndJava
948
		./
949
	pathNameCSOpt -> pathNameCS
950
903
951
	literalExpCS -> enumLiteralExpCS
904
	literalExpCS -> enumLiteralExpCS
952
	literalExpCS -> collectionLiteralExpCS
905
	literalExpCS -> collectionLiteralExpCS
Lines 957-1010 Link Here
957
910
958
    -- also covers the case of static attribute call, in which
911
    -- also covers the case of static attribute call, in which
959
    --    case @pre is not allowed anyway
912
    --    case @pre is not allowed anyway
960
	enumLiteralExpCS ::= pathNameCS '::' keywordAsName
913
	enumLiteralExpCS ::= qualifiedPathNameCS
961
		/.$NewCase./
962
	enumLiteralExpCS ::= pathNameCS '::' simpleNameCS
963
		/.$BeginJava
914
		/.$BeginJava
915
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
916
					SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
964
					CSTNode result = createEnumLiteralExpCS(
917
					CSTNode result = createEnumLiteralExpCS(
965
							(PathNameCS)$getSym(1),
918
							pathNameCS,
966
							(SimpleNameCS)$getSym(3)
919
							simpleNameCS
967
						);
920
						);
968
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
921
					setOffsets(result, pathNameCS, simpleNameCS);
969
					$setResult(result);
922
					$setResult(result);
970
		  $EndJava
923
		  $EndJava
971
		./
924
		./
972
925
973
	collectionLiteralExpCS ::= collectionTypeIdentifierCS '{' collectionLiteralPartsCSopt '}'
926
	collectionLiteralExpCS ::= collectionTypeIdentifierCS '{' collectionLiteralPartsCSopt '}'
974
		/.$BeginJava
927
		/.$BeginJava
975
					Object[] objs = (Object[])$getSym(1);
928
					CollectionTypeCS typeCS = (CollectionTypeCS)$getSym(1);
976
					CSTNode result = createCollectionLiteralExpCS(
929
					CSTNode result = createCollectionLiteralExpCS(
977
							(CollectionTypeIdentifierEnum)objs[1],
930
							typeCS,
978
							(EList)$getSym(3)
931
							(EList)$getSym(3)
979
						);
932
						);
980
					setOffsets(result, (IToken)objs[0], getIToken($getToken(4)));
933
					setOffsets(result, typeCS, getIToken($getToken(4)));
981
					$setResult(result);
934
					$setResult(result);
982
		  $EndJava
935
		  $EndJava
983
		./
936
		./
984
937
985
	collectionTypeIdentifierCS ::= Set
938
	collectionTypeIdentifierCS ::= Set
986
		/.$BeginJava
939
		/.$BeginJava
987
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.SET_LITERAL});
940
					SimpleNameCS result = createCollectionTypeCS(
941
								CollectionTypeIdentifierEnum.SET_LITERAL,
942
								getTokenText($getToken(1))
943
							);
944
					setOffsets(result, getIToken($getToken(1)));
945
					$setResult(result);
988
		  $EndJava
946
		  $EndJava
989
		./
947
		./
990
	collectionTypeIdentifierCS ::= Bag
948
	collectionTypeIdentifierCS ::= Bag
991
		/.$BeginJava
949
		/.$BeginJava
992
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.BAG_LITERAL});
950
					SimpleNameCS result = createCollectionTypeCS(
951
								CollectionTypeIdentifierEnum.BAG_LITERAL,
952
								getTokenText($getToken(1))
953
							);
954
					setOffsets(result, getIToken($getToken(1)));
955
					$setResult(result);
993
		  $EndJava
956
		  $EndJava
994
		./
957
		./
995
	collectionTypeIdentifierCS ::= Sequence
958
	collectionTypeIdentifierCS ::= Sequence
996
		/.$BeginJava
959
		/.$BeginJava
997
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.SEQUENCE_LITERAL});
960
					SimpleNameCS result = createCollectionTypeCS(
961
								CollectionTypeIdentifierEnum.SEQUENCE_LITERAL,
962
								getTokenText($getToken(1))
963
							);
964
					setOffsets(result, getIToken($getToken(1)));
965
					$setResult(result);
998
		  $EndJava
966
		  $EndJava
999
		./
967
		./
1000
	collectionTypeIdentifierCS ::= Collection
968
	collectionTypeIdentifierCS ::= Collection
1001
		/.$BeginJava
969
		/.$BeginJava
1002
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.COLLECTION_LITERAL});
970
					SimpleNameCS result = createCollectionTypeCS(
971
								CollectionTypeIdentifierEnum.COLLECTION_LITERAL,
972
								getTokenText($getToken(1))
973
							);
974
					setOffsets(result, getIToken($getToken(1)));
975
					$setResult(result);
1003
		  $EndJava
976
		  $EndJava
1004
		./
977
		./
1005
	collectionTypeIdentifierCS ::= OrderedSet
978
	collectionTypeIdentifierCS ::= OrderedSet
1006
		/.$BeginJava
979
		/.$BeginJava
1007
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL});
980
					SimpleNameCS result = createCollectionTypeCS(
981
								CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL,
982
								getTokenText($getToken(1))
983
							);
984
					setOffsets(result, getIToken($getToken(1)));
985
					$setResult(result);
1008
		  $EndJava
986
		  $EndJava
1009
		./
987
		./
1010
988
Lines 1147-1289 Link Here
1147
		  $EndJava
1125
		  $EndJava
1148
		./
1126
		./
1149
1127
1150
1128
	callExpCS -> loopExpCS
1151
	callExpCS ::= '->' featureCallExpCS
1129
	callExpCS -> propertyCallExpCS
1152
		/.$NewCase./
1130
	callExpCS -> operationCallExpCS_B
1153
	callExpCS ::= '->' loopExpCS
1131
	callExpCS -> operationCallExpCS_CE
1154
		/.$BeginJava
1132
	callExpCS -> operationCallExpCS_IJ
1155
					CallExpCS result = (CallExpCS)$getSym(2);
1156
					result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
1157
					$setResult(result);
1158
		  $EndJava
1159
		./
1160
	callExpCS ::= '.' keywordOperationCallExpCS
1161
		/.$NewCase./
1162
	callExpCS ::= '.' featureCallExpCS
1163
		/.$BeginJava
1164
					CallExpCS result = (CallExpCS)$getSym(2);
1165
					result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
1166
					if (result instanceof OperationCallExpCS) {
1167
						((OperationCallExpCS)result).setIsAtomic(true);
1168
					}
1169
					$setResult(result);
1170
		  $EndJava
1171
		./
1172
1133
1173
	loopExpCS -> iteratorExpCS
1134
	loopExpCS -> iteratorExpCS
1174
	loopExpCS -> iterateExpCS
1135
	loopExpCS -> iterateExpCS
1175
1136
1176
	iteratorExpCS ::= iteratorName '(' oclExpressionCS ')'
1137
	iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' oclExpressionCS ')'
1177
		/.$BeginJava
1138
		/.$BeginJava
1178
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1139
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1140
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
1179
					CSTNode result = createIteratorExpCS(
1141
					CSTNode result = createIteratorExpCS(
1142
							source,
1180
							simpleNameCS,
1143
							simpleNameCS,
1181
							null,
1144
							null,
1182
							null,
1145
							null,
1183
							(OCLExpressionCS)$getSym(3)
1146
							(OCLExpressionCS)$getSym(5)
1184
						);
1147
						);
1185
					setOffsets(result, simpleNameCS, getIToken($getToken(4)));
1148
					setOffsets(result, source, getIToken($getToken(6)));
1186
					$setResult(result);
1149
					$setResult(result);
1187
		  $EndJava
1150
		  $EndJava
1188
		./
1151
		./
1189
	iteratorExpCS ::= iteratorName '(' variableCS '|' oclExpressionCS ')'
1152
	iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' variableCS '|' oclExpressionCS ')'
1190
		/.$BeginJava
1153
		/.$BeginJava
1191
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1154
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1155
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
1192
					CSTNode result = createIteratorExpCS(
1156
					CSTNode result = createIteratorExpCS(
1157
							source,
1193
							simpleNameCS,
1158
							simpleNameCS,
1194
							(VariableCS)$getSym(3),
1159
							(VariableCS)$getSym(5),
1195
							null,
1160
							null,
1196
							(OCLExpressionCS)$getSym(5)
1161
							(OCLExpressionCS)$getSym(7)
1197
						);
1162
						);
1198
					setOffsets(result, simpleNameCS, getIToken($getToken(6)));
1163
					setOffsets(result, source, getIToken($getToken(8)));
1199
					$setResult(result);
1164
					$setResult(result);
1200
		  $EndJava
1165
		  $EndJava
1201
		./
1166
		./
1202
	iteratorExpCS ::= iteratorName '(' variableCS ',' variableCS '|' oclExpressionCS ')'
1167
	iteratorExpCS ::= dotArrowExpCS '->' iteratorNameCS '(' variableCS ',' variableCS '|' oclExpressionCS ')'
1203
		/.$BeginJava
1168
		/.$BeginJava
1204
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1169
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1170
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
1205
					CSTNode result = createIteratorExpCS(
1171
					CSTNode result = createIteratorExpCS(
1172
							source,
1206
							simpleNameCS,
1173
							simpleNameCS,
1207
							(VariableCS)$getSym(3),
1208
							(VariableCS)$getSym(5),
1174
							(VariableCS)$getSym(5),
1209
							(OCLExpressionCS)$getSym(7)
1175
							(VariableCS)$getSym(7),
1176
							(OCLExpressionCS)$getSym(9)
1210
						);
1177
						);
1211
					setOffsets(result, simpleNameCS, getIToken($getToken(8)));
1178
					setOffsets(result, source, getIToken($getToken(10)));
1212
					$setResult(result);
1179
					$setResult(result);
1213
		  $EndJava
1180
		  $EndJava
1214
		./
1181
		./
1215
1182
1216
	iterateExpCS ::= iterateName '(' variableCS '|' oclExpressionCS ')'
1183
	iterateExpCS ::= dotArrowExpCS '->' iterateNameCS '(' variableCS '|' oclExpressionCS ')'
1217
		/.$BeginJava
1184
		/.$BeginJava
1218
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1185
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1186
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
1219
					CSTNode result = createIterateExpCS(
1187
					CSTNode result = createIterateExpCS(
1188
							source,
1220
							simpleNameCS,
1189
							simpleNameCS,
1221
							(VariableCS)$getSym(3),
1190
							(VariableCS)$getSym(5),
1222
							null,
1191
							null,
1223
							(OCLExpressionCS)$getSym(5)
1192
							(OCLExpressionCS)$getSym(7)
1224
						);
1193
						);
1225
					setOffsets(result, simpleNameCS, getIToken($getToken(6)));
1194
					setOffsets(result, source, getIToken($getToken(8)));
1226
					$setResult(result);
1195
					$setResult(result);
1227
		  $EndJava
1196
		  $EndJava
1228
		./
1197
		./
1229
	iterateExpCS ::= iterateName '(' variableCS ';' variableCS '|' oclExpressionCS ')'
1198
	iterateExpCS ::= dotArrowExpCS '->' iterateNameCS '(' variableCS ';' variableCS '|' oclExpressionCS ')'
1230
		/.$BeginJava
1199
		/.$BeginJava
1231
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1200
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1201
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
1232
					CSTNode result = createIterateExpCS(
1202
					CSTNode result = createIterateExpCS(
1203
							source,
1233
							simpleNameCS,
1204
							simpleNameCS,
1234
							(VariableCS)$getSym(3),
1235
							(VariableCS)$getSym(5),
1205
							(VariableCS)$getSym(5),
1236
							(OCLExpressionCS)$getSym(7)
1206
							(VariableCS)$getSym(7),
1207
							(OCLExpressionCS)$getSym(9)
1237
						);
1208
						);
1238
					setOffsets(result, simpleNameCS, getIToken($getToken(8)));
1209
					setOffsets(result, source, getIToken($getToken(10)));
1239
					$setResult(result);
1210
					$setResult(result);
1240
		  $EndJava
1211
		  $EndJava
1241
		./
1212
		./
1242
1213
	
1243
	variableCS ::= IDENTIFIER
1214
	-- Merging these as notReservedSimpleNameCS gives conflicts; why? LPG bug ??
1215
	variableNameCS ::= booleanLiteralExpCS
1216
		/.$NewCase./
1217
	variableNameCS ::= invalidLiteralExpCS
1218
		/.$NewCase./
1219
	variableNameCS ::= nullLiteralExpCS
1220
		/.$NewCase./
1221
	variableNameCS ::= notLiteralNorReservedSimpleNameCS
1244
		/.$BeginJava
1222
		/.$BeginJava
1245
					CSTNode result = createVariableCS(
1223
					SimpleNameCS name = (SimpleNameCS)$getSym(1);
1246
							getTokenText($getToken(1)),
1224
					CSTNode result = createVariableCS(name.getValue());
1247
							null,
1225
					setOffsets(result, name);
1248
							null
1249
						);
1250
					setOffsets(result, getIToken($getToken(1)));
1251
					$setResult(result);
1226
					$setResult(result);
1252
		  $EndJava
1227
		  $EndJava
1253
		./
1228
		./
1254
	typedVariableCS ::= IDENTIFIER ':' typeCS
1229
	typedVariableCS ::= variableNameCS ':' typeCS
1255
		/.$BeginJava
1230
		/.$BeginJava
1256
					CSTNode result = createVariableCS(
1231
					VariableCS result = (VariableCS)$getSym(1);
1257
							getTokenText($getToken(1)),
1232
					TypeCS type = (TypeCS)$getSym(3);
1258
							(TypeCS)$getSym(3),
1233
					result.setTypeCS(type);
1259
							null
1234
					setOffsets(result, result, type);
1260
						);
1261
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3));
1262
					$setResult(result);
1235
					$setResult(result);
1263
		  $EndJava
1236
		  $EndJava
1264
		./
1237
		./
1238
	variableCS -> variableNameCS
1265
	variableCS -> typedVariableCS
1239
	variableCS -> typedVariableCS
1266
	variableCS ::= IDENTIFIER ':' typeCS '=' oclExpressionCS
1240
	variableCS2 -> variableCS
1267
		/.$BeginJava
1268
					CSTNode result = createVariableCS(
1269
							getTokenText($getToken(1)),
1270
							(TypeCS)$getSym(3),
1271
							(OCLExpressionCS)$getSym(5)
1272
						);
1273
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(5));
1274
					$setResult(result);
1275
		  $EndJava
1276
		./
1277
1278
	-- this form of variable declaration is only used in tuple literals
1241
	-- this form of variable declaration is only used in tuple literals
1279
	variableCS2 ::= IDENTIFIER '=' oclExpressionCS
1242
	variableCS2 ::= variableNameCS '=' oclExpressionCS
1243
		/.$NewCase./
1244
	variableCS ::= typedVariableCS '=' oclExpressionCS
1280
		/.$BeginJava
1245
		/.$BeginJava
1281
					CSTNode result = createVariableCS(
1246
					VariableCS result = (VariableCS)$getSym(1);
1282
							getTokenText($getToken(1)),
1247
					OCLExpressionCS initExpression = (OCLExpressionCS)$getSym(3);
1283
							null,
1248
					result.setInitExpression(initExpression);
1284
							(OCLExpressionCS)$getSym(3)
1249
					setOffsets(result, result, initExpression);
1285
						);
1286
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3));
1287
					$setResult(result);
1250
					$setResult(result);
1288
		  $EndJava
1251
		  $EndJava
1289
		./
1252
		./
Lines 1292-1313 Link Here
1292
		/.$NullAction./
1255
		/.$NullAction./
1293
	typeCSopt -> typeCS
1256
	typeCSopt -> typeCS
1294
1257
1295
	-- the order of these rules is important!  Try to match primitives
1296
	--   first, then tuples (more complex), and finally collections.
1297
	--   Looking for type names in the Ecore model is a last resort
1298
	typeCS -> primitiveTypeCS
1299
	typeCS -> tupleTypeCS
1258
	typeCS -> tupleTypeCS
1300
	typeCS -> collectionTypeCS
1259
	typeCS -> collectionTypeCS
1301
	typeCS -> pathNameCS
1260
	typeCS -> qualifiedPathNameCS
1261
	typeCS ::= notReservedSimpleNameCS				-- covers primitiveTypeCS
1262
		/.$BeginJava
1263
					CSTNode result = (CSTNode)$getSym(1);
1264
					if (!(result instanceof TypeCS)) {
1265
						PathNameCS pathNameCS = createPathNameCS((SimpleNameCS)result);
1266
						setOffsets(pathNameCS, result);
1267
						result = pathNameCS;
1268
					}
1269
					$setResult(result);
1270
		  $EndJava
1271
		./
1302
1272
1303
	collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ')'
1273
	collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ')'
1304
		/.$BeginJava
1274
		/.$BeginJava
1305
					Object[] objs = (Object[])$getSym(1);
1275
					CollectionTypeCS result = (CollectionTypeCS)$getSym(1);
1306
					CSTNode result = createCollectionTypeCS(
1276
					result.setTypeCS((TypeCS)$getSym(3));
1307
							(CollectionTypeIdentifierEnum)objs[1],
1277
					setOffsets(result, result, getIToken($getToken(4)));
1308
							(TypeCS)$getSym(3)
1309
						);
1310
					setOffsets(result, (IToken)objs[0], getIToken($getToken(4)));
1311
					$setResult(result);
1278
					$setResult(result);
1312
		  $EndJava
1279
		  $EndJava
1313
		./
1280
		./
Lines 1324-1329 Link Here
1324
	variableListCSopt ::= $empty
1291
	variableListCSopt ::= $empty
1325
		/.$EmptyListAction./
1292
		/.$EmptyListAction./
1326
	variableListCSopt -> variableListCS
1293
	variableListCSopt -> variableListCS
1294
	variableListCS2 ::= variableCS2
1295
		/.$NewCase./
1327
	variableListCS ::= variableCS 
1296
	variableListCS ::= variableCS 
1328
		/.$BeginJava
1297
		/.$BeginJava
1329
					EList result = new BasicEList();
1298
					EList result = new BasicEList();
Lines 1331-1336 Link Here
1331
					$setResult(result);
1300
					$setResult(result);
1332
		  $EndJava
1301
		  $EndJava
1333
		./
1302
		./
1303
	variableListCS2 ::= variableListCS2 ',' variableCS2
1304
		/.$NewCase./
1334
	variableListCS ::= variableListCS ',' variableCS
1305
	variableListCS ::= variableListCS ',' variableCS
1335
		/.$BeginJava
1306
		/.$BeginJava
1336
					EList result = (EList)$getSym(1);
1307
					EList result = (EList)$getSym(1);
Lines 1339-1380 Link Here
1339
		  $EndJava
1310
		  $EndJava
1340
		./
1311
		./
1341
	
1312
	
1342
	-- this form of variable declaration list is only used in tuple literals
1313
	operationCallExpCS_B ::= dotArrowExpCS '->' notIteratorNorReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')'
1343
	variableListCS2 ::= variableCS2
1344
		/.$NewCase./
1345
	variableListCS2 ::= variableCS
1346
		/.$BeginJava
1314
		/.$BeginJava
1347
					EList result = new BasicEList();
1315
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1348
					result.add($getSym(1));
1316
					CSTNode result = createArrowOperationCallExpCS(
1317
							source,
1318
							(SimpleNameCS)$getSym(3),
1319
							(IsMarkedPreCS)$getSym(4),
1320
							(EList)$getSym(6)
1321
						);
1322
					setOffsets(result, source, getIToken($getToken(7)));
1349
					$setResult(result);
1323
					$setResult(result);
1350
		  $EndJava
1324
		  $EndJava
1351
		./
1325
		./
1352
	variableListCS2 ::= variableListCS2 ',' variableCS2
1326
	operationCallExpCS_CE ::= dotArrowExpCS '.' operationOrNotReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')'
1353
		/.$NewCase./
1354
	variableListCS2 ::= variableListCS2 ',' variableCS
1355
		/.$BeginJava
1327
		/.$BeginJava
1356
					EList result = (EList)$getSym(1);
1328
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1357
					result.add($getSym(3));
1329
					CSTNode result = createDotOperationCallExpCS(
1330
							source,
1331
							null,
1332
							(SimpleNameCS)$getSym(3),
1333
							(IsMarkedPreCS)$getSym(4),
1334
							(EList)$getSym(6)
1335
						);
1336
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(7)));
1358
					$setResult(result);
1337
					$setResult(result);
1359
		  $EndJava
1338
		  $EndJava
1360
		./
1339
		./
1361
	
1340
	operationCallExpCS_DF ::= notReservedSimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')'
1362
	-- covers attributeCallExpCS and navigationCallExpCS
1363
	featureCallExpCS -> attrOrNavCallExpCS
1364
1365
	featureCallExpCS -> operationCallExpCS
1366
	featureCallExpCS ::= unaryName isMarkedPreCS '(' argumentsCSopt ')'
1367
		/.$NewCase./
1368
	-- even though these operations do not use @pre or do not accept multiple arguments
1369
	-- in order to get better error reporting, the rule signature must comply with
1370
	-- the full rule of an operationCallExpCS
1371
	-- the alternative would be to remove these as keywords, but then the parser
1372
	-- would accept variable declarations where the var can be named "oclIsNew" for example
1373
	operationCallExpCS ::= binaryName isMarkedPreCS '(' argumentsCSopt ')'
1374
		/.$NewCase./
1375
	keywordOperationCallExpCS ::= keywordAsName isMarkedPreCS '(' argumentsCSopt ')'
1376
		/.$BeginJava
1341
		/.$BeginJava
1377
					CSTNode result = createOperationCallExpCS(
1342
					CSTNode result = createDotOperationCallExpCS(
1343
							null,
1344
							null,
1378
							(SimpleNameCS)$getSym(1),
1345
							(SimpleNameCS)$getSym(1),
1379
							(IsMarkedPreCS)$getSym(2),
1346
							(IsMarkedPreCS)$getSym(2),
1380
							(EList)$getSym(4)
1347
							(EList)$getSym(4)
Lines 1383-1452 Link Here
1383
					$setResult(result);
1350
					$setResult(result);
1384
		  $EndJava
1351
		  $EndJava
1385
		./
1352
		./
1386
1353
	operationCallExpCS_G ::=  qualifiedPathNameCS '(' argumentsCSopt ')'
1387
	stateExpCS ::= pathNameCSOpt
1388
		/.$BeginJava
1354
		/.$BeginJava
1389
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
1355
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
1390
					StateExpCS result = createStateExpCS(pathNameCS);
1356
					OperationCallExpCS result = createDotOperationCallExpCS(
1391
					setOffsets(result, pathNameCS);
1357
							null,
1358
							pathNameCS,
1359
							removeLastSimpleNameCS(pathNameCS),
1360
							null,
1361
							(EList)$getSym(3)
1362
						);
1363
					setOffsets(result, pathNameCS, getIToken($getToken(4)));
1392
					$setResult(result);
1364
					$setResult(result);
1393
		  $EndJava
1365
		  $EndJava
1394
		./
1366
		./
1395
	-- FIXME StateExpCS creates a needless irregularity; unwrap its content as an argument list
1367
	operationCallExpCS_IJ ::= dotArrowExpCS '.' qualifiedPathNameCS isMarkedPreCSopt '(' argumentsCSopt ')'
1396
	operationCallExpCS ::= oclIsInStateName isMarkedPreCS '(' stateExpCS ')'
1397
		/.$BeginJava
1368
		/.$BeginJava
1398
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1369
					PathNameCS pathNameCS = (PathNameCS)$getSym(3);
1399
					CSTNode result = createOperationCallExpCS(
1370
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1400
							simpleNameCS,
1371
					CallExpCS result = createDotOperationCallExpCS(
1401
							(IsMarkedPreCS)$getSym(2),
1372
							source,
1402
							(StateExpCS)$getSym(4)
1373
							pathNameCS,
1374
							removeLastSimpleNameCS(pathNameCS),
1375
							(IsMarkedPreCS)$getSym(4),
1376
							(EList)$getSym(6)
1403
						);
1377
						);
1404
					setOffsets(result, simpleNameCS, getIToken($getToken(5)));
1378
					setOffsets(result, source, getIToken($getToken(7)));
1405
					$setResult(result);
1379
					$setResult(result);
1406
		  $EndJava
1380
		  $EndJava
1407
		./
1381
		./		
1408
1382
1409
	attrOrNavCallExpCS ::= simpleNameCS isMarkedPreCS
1383
	propertyCallExpCS ::= dotArrowExpCS '.' notReservedSimpleNameCS isMarkedPreCSopt
1410
		/.$NewCase./
1411
	attrOrNavCallExpCS ::= keywordAsName isMarkedPreCS
1412
		/.$BeginJava
1384
		/.$BeginJava
1413
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2);
1385
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1386
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(4);
1414
					CSTNode result = createFeatureCallExpCS(
1387
					CSTNode result = createFeatureCallExpCS(
1415
							(SimpleNameCS)$getSym(1),
1388
							source,
1389
							(SimpleNameCS)$getSym(3),
1416
							new BasicEList(),
1390
							new BasicEList(),
1417
							isMarkedPreCS
1391
							isMarkedPreCS
1418
						);
1392
						);
1419
					if (isMarkedPreCS != null) {
1393
					if (isMarkedPreCS != null) {
1420
						setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2));
1394
						setOffsets(result, source, isMarkedPreCS);
1421
					} else {
1395
					} else {
1422
						setOffsets(result, (CSTNode)$getSym(1));
1396
						setOffsets(result, source, (SimpleNameCS)$getSym(3));
1423
					}
1397
					}
1424
					$setResult(result);
1398
					$setResult(result);
1425
		  $EndJava
1399
		  $EndJava
1426
		./
1400
		./
1427
	attrOrNavCallExpCS ::= simpleNameCS '[' argumentsCS ']' isMarkedPreCS
1401
	propertyCallExpCS ::= dotArrowExpCS '.' notReservedSimpleNameCS '[' argumentsCS ']' isMarkedPreCSopt
1428
		/.$BeginJava
1402
		/.$BeginJava
1429
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5);
1403
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
1404
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(7);
1430
					CSTNode result = createFeatureCallExpCS(
1405
					CSTNode result = createFeatureCallExpCS(
1431
							(SimpleNameCS)$getSym(1),
1406
							source,
1432
							(EList)$getSym(3),
1407
							(SimpleNameCS)$getSym(3),
1408
							(EList)$getSym(5),
1433
							isMarkedPreCS
1409
							isMarkedPreCS
1434
						);
1410
						);
1435
					if (isMarkedPreCS != null) {
1411
					if (isMarkedPreCS != null) {
1436
						setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(5));
1412
						setOffsets(result, source, isMarkedPreCS);
1437
					} else {
1413
					} else {
1438
						setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4)));
1414
						setOffsets(result, source, getIToken($getToken(6)));
1439
					}
1415
					}
1440
					$setResult(result);
1416
					$setResult(result);
1441
		  $EndJava
1417
		  $EndJava
1442
		./
1418
		./
1443
1419
1444
	isMarkedPreCS ::= $empty
1420
	isMarkedPreCSopt ::= $empty
1445
		/.$BeginJava
1421
		/.$BeginJava
1446
					$setResult(null);
1422
					$setResult(null);
1447
		  $EndJava
1423
		  $EndJava
1448
		./
1424
		./
1449
	isMarkedPreCS ::= '@pre'
1425
	isMarkedPreCSopt ::= '@pre'
1450
		/.$BeginJava
1426
		/.$BeginJava
1451
					CSTNode result = createIsMarkedPreCS();
1427
					CSTNode result = createIsMarkedPreCS();
1452
					setOffsets(result, getIToken($getToken(1)));
1428
					setOffsets(result, getIToken($getToken(1)));
Lines 1496-1511 Link Here
1496
		  $EndJava
1472
		  $EndJava
1497
		./
1473
		./
1498
1474
1499
	messageExpCS ::= '^' simpleNameCS '(' oclMessageArgumentsCSopt ')'
1475
	oclMessageExpCS ::= dotArrowExpCS '^' simpleNameCS '(' oclMessageArgumentsCSopt ')'
1500
		/.$NewCase./
1476
		/.$NewCase./
1501
	messageExpCS ::= '^^' simpleNameCS '(' oclMessageArgumentsCSopt ')'
1477
	oclMessageExpCS ::= dotArrowExpCS '^^' simpleNameCS '(' oclMessageArgumentsCSopt ')'
1502
		/.$BeginJava
1478
		/.$BeginJava
1503
					CSTNode result = createMessageExpCS(
1479
					OCLExpressionCS target = (OCLExpressionCS)$getSym(1);
1504
							getIToken($getToken(1)).getKind() == $sym_type.TK_CARET,
1480
					MessageExpCS result = createMessageExpCS(
1505
							(SimpleNameCS)$getSym(2),
1481
							target,
1506
							(EList<OCLMessageArgCS>)$getSym(4)
1482
							getIToken($getToken(2)).getKind() == $sym_type.TK_CARET,
1483
							(SimpleNameCS)$getSym(3),
1484
							(EList<OCLMessageArgCS>)$getSym(5)
1507
						);
1485
						);
1508
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
1486
					setOffsets(result, target, getIToken($getToken(6)));
1509
					$setResult(result);
1487
					$setResult(result);
1510
		  $EndJava
1488
		  $EndJava
1511
		./
1489
		./
(-)model/OCLCST.genmodel (-10 / +4 lines)
Lines 256-267 Link Here
256
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/BooleanLiteralExpCS">
256
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/BooleanLiteralExpCS">
257
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/BooleanLiteralExpCS/booleanSymbol"/>
257
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/BooleanLiteralExpCS/booleanSymbol"/>
258
      </genClasses>
258
      </genClasses>
259
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/NullLiteralExpCS">
259
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/NullLiteralExpCS"/>
260
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/NullLiteralExpCS/symbol"/>
260
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/InvalidLiteralExpCS"/>
261
      </genClasses>
262
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/InvalidLiteralExpCS">
263
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/InvalidLiteralExpCS/symbol"/>
264
      </genClasses>
265
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/CollectionRangeCS">
261
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/CollectionRangeCS">
266
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
262
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
267
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/CollectionRangeCS/lastExpressionCS"/>
263
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/CollectionRangeCS/lastExpressionCS"/>
Lines 290-300 Link Here
290
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/FeatureCallExpCS/isMarkedPreCS"/>
286
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/FeatureCallExpCS/isMarkedPreCS"/>
291
      </genClasses>
287
      </genClasses>
292
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OperationCallExpCS">
288
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OperationCallExpCS">
293
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/OperationCallExpCS/isAtomic"/>
294
      </genClasses>
295
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/StateExpCS">
296
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
289
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
297
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/StateExpCS/simpleNames"/>
290
            createChild="true" ecoreFeature="ecore:EReference OCLCST.ecore#//cst/OperationCallExpCS/pathNameCS"/>
291
        <genFeatures xsi:type="genmodel:GenFeature" createChild="false" ecoreFeature="ecore:EAttribute OCLCST.ecore#//cst/OperationCallExpCS/isAtomic"/>
298
      </genClasses>
292
      </genClasses>
299
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OCLDocumentCS">
293
      <genClasses xsi:type="genmodel:GenClass" ecoreClass="OCLCST.ecore#//cst/OCLDocumentCS">
300
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
294
        <genFeatures xsi:type="genmodel:GenFeature" property="None" children="true"
(-)model/OCLCST.ecore (-12 / +6 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 257-271 Link Here
257
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="unescapedStringSymbol"
257
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="unescapedStringSymbol"
258
          eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
258
          eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
259
    </eClassifiers>
259
    </eClassifiers>
260
    <eClassifiers xsi:type="ecore:EClass" name="BooleanLiteralExpCS" eSuperTypes="#//cst/PrimitiveLiteralExpCS">
260
    <eClassifiers xsi:type="ecore:EClass" name="BooleanLiteralExpCS" eSuperTypes="#//cst/SimpleNameCS #//cst/PrimitiveLiteralExpCS">
261
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="booleanSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
261
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="booleanSymbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
262
    </eClassifiers>
262
    </eClassifiers>
263
    <eClassifiers xsi:type="ecore:EClass" name="NullLiteralExpCS" eSuperTypes="#//cst/LiteralExpCS">
263
    <eClassifiers xsi:type="ecore:EClass" name="NullLiteralExpCS" eSuperTypes="#//cst/SimpleNameCS #//cst/LiteralExpCS"/>
264
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="symbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
264
    <eClassifiers xsi:type="ecore:EClass" name="InvalidLiteralExpCS" eSuperTypes="#//cst/SimpleNameCS #//cst/LiteralExpCS"/>
265
    </eClassifiers>
266
    <eClassifiers xsi:type="ecore:EClass" name="InvalidLiteralExpCS" eSuperTypes="#//cst/LiteralExpCS">
267
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="symbol" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
268
    </eClassifiers>
269
    <eClassifiers xsi:type="ecore:EClass" name="CollectionRangeCS" eSuperTypes="#//cst/CollectionLiteralPartCS">
265
    <eClassifiers xsi:type="ecore:EClass" name="CollectionRangeCS" eSuperTypes="#//cst/CollectionLiteralPartCS">
270
      <eStructuralFeatures xsi:type="ecore:EReference" name="lastExpressionCS" eType="#//cst/OCLExpressionCS"
266
      <eStructuralFeatures xsi:type="ecore:EReference" name="lastExpressionCS" eType="#//cst/OCLExpressionCS"
271
          containment="true">
267
          containment="true">
Lines 303-315 Link Here
303
          containment="true"/>
299
          containment="true"/>
304
    </eClassifiers>
300
    </eClassifiers>
305
    <eClassifiers xsi:type="ecore:EClass" name="OperationCallExpCS" eSuperTypes="#//cst/FeatureCallExpCS">
301
    <eClassifiers xsi:type="ecore:EClass" name="OperationCallExpCS" eSuperTypes="#//cst/FeatureCallExpCS">
302
      <eStructuralFeatures xsi:type="ecore:EReference" name="pathNameCS" eType="#//cst/PathNameCS"
303
          containment="true"/>
306
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="isAtomic" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
304
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="isAtomic" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
307
          defaultValueLiteral="false"/>
305
          defaultValueLiteral="false"/>
308
    </eClassifiers>
306
    </eClassifiers>
309
    <eClassifiers xsi:type="ecore:EClass" name="StateExpCS" eSuperTypes="#//cst/TypeCS">
310
      <eStructuralFeatures xsi:type="ecore:EReference" name="simpleNames" upperBound="-1"
311
          eType="#//cst/SimpleNameCS" containment="true"/>
312
    </eClassifiers>
313
    <eClassifiers xsi:type="ecore:EClass" name="OCLDocumentCS" eSuperTypes="#//cst/CSTNode">
307
    <eClassifiers xsi:type="ecore:EClass" name="OCLDocumentCS" eSuperTypes="#//cst/CSTNode">
314
      <eStructuralFeatures xsi:type="ecore:EReference" name="packageDeclarations"
308
      <eStructuralFeatures xsi:type="ecore:EReference" name="packageDeclarations"
315
          ordered="false" upperBound="-1" eType="#//cst/PackageDeclarationCS" containment="true"/>
309
          ordered="false" upperBound="-1" eType="#//cst/PackageDeclarationCS" containment="true"/>
(-)model/OCLCST.uml (-21 / +14 lines)
Lines 2-7 Link Here
2
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Ecore="http://www.eclipse.org/uml2/schemas/Ecore/4" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Ecore/4 pathmap://UML_PROFILES/Ecore.profile.uml#_B7dOIMEREduRdatXodjBjA">
2
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Ecore="http://www.eclipse.org/uml2/schemas/Ecore/4" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Ecore/4 pathmap://UML_PROFILES/Ecore.profile.uml#_B7dOIMEREduRdatXodjBjA">
3
  <uml:Model xmi:id="_qdx8sQ8fEduhWtVvKtiQ7w" name="ocl">
3
  <uml:Model xmi:id="_qdx8sQ8fEduhWtVvKtiQ7w" name="ocl">
4
    <packagedElement xmi:type="uml:Package" xmi:id="_qdx8sP8fEduhWtVvKtiQ7w" name="cst">
4
    <packagedElement xmi:type="uml:Package" xmi:id="_qdx8sP8fEduhWtVvKtiQ7w" name="cst">
5
      <elementImport xmi:id="_5DyD0LD5Ed6LkdYdYK9_JA"/>
5
      <packageImport xmi:id="_CSYeEI2GEd2mlKUM3HGxZg">
6
      <packageImport xmi:id="_CSYeEI2GEd2mlKUM3HGxZg">
6
        <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#_0"/>
7
        <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#_0"/>
7
      </packageImport>
8
      </packageImport>
Lines 353-358 Link Here
353
        <ownedEnd xmi:id="_qdx9lP8fEduhWtVvKtiQ7w" type="_qdx9j_8fEduhWtVvKtiQ7w" association="_qdx9k_8fEduhWtVvKtiQ7w"/>
354
        <ownedEnd xmi:id="_qdx9lP8fEduhWtVvKtiQ7w" type="_qdx9j_8fEduhWtVvKtiQ7w" association="_qdx9k_8fEduhWtVvKtiQ7w"/>
354
      </packagedElement>
355
      </packagedElement>
355
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx9lf8fEduhWtVvKtiQ7w" name="CollectionTypeCS">
356
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx9lf8fEduhWtVvKtiQ7w" name="CollectionTypeCS">
357
        <generalization xmi:id="_2NUGIJw2Ed6az7Hq7e93gA" general="_qdx83P8fEduhWtVvKtiQ7w"/>
356
        <generalization xmi:id="_qdx9lv8fEduhWtVvKtiQ7w" general="_qdx8xP8fEduhWtVvKtiQ7w"/>
358
        <generalization xmi:id="_qdx9lv8fEduhWtVvKtiQ7w" general="_qdx8xP8fEduhWtVvKtiQ7w"/>
357
        <ownedAttribute xmi:id="_qdx9l_8fEduhWtVvKtiQ7w" name="collectionTypeIdentifier" visibility="public" type="_qdx9m_8fEduhWtVvKtiQ7w" isOrdered="true">
359
        <ownedAttribute xmi:id="_qdx9l_8fEduhWtVvKtiQ7w" name="collectionTypeIdentifier" visibility="public" type="_qdx9m_8fEduhWtVvKtiQ7w" isOrdered="true">
358
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx9mP8fEduhWtVvKtiQ7w"/>
360
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx9mP8fEduhWtVvKtiQ7w"/>
Lines 549-554 Link Here
549
        </ownedAttribute>
551
        </ownedAttribute>
550
      </packagedElement>
552
      </packagedElement>
551
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-E_8fEduhWtVvKtiQ7w" name="BooleanLiteralExpCS">
553
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-E_8fEduhWtVvKtiQ7w" name="BooleanLiteralExpCS">
554
        <generalization xmi:id="_HVRk0LKtEd6RC43VVMBX9w" general="_qdx83P8fEduhWtVvKtiQ7w"/>
552
        <generalization xmi:id="_qdx-FP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/>
555
        <generalization xmi:id="_qdx-FP8fEduhWtVvKtiQ7w" general="_qdx9__8fEduhWtVvKtiQ7w"/>
553
        <ownedAttribute xmi:id="_qdx-Ff8fEduhWtVvKtiQ7w" name="booleanSymbol" visibility="public" isOrdered="true">
556
        <ownedAttribute xmi:id="_qdx-Ff8fEduhWtVvKtiQ7w" name="booleanSymbol" visibility="public" isOrdered="true">
554
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EBooleanObject"/>
557
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EBooleanObject"/>
Lines 556-573 Link Here
556
        </ownedAttribute>
559
        </ownedAttribute>
557
      </packagedElement>
560
      </packagedElement>
558
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-F_8fEduhWtVvKtiQ7w" name="NullLiteralExpCS">
561
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-F_8fEduhWtVvKtiQ7w" name="NullLiteralExpCS">
562
        <generalization xmi:id="_GYa7ALKtEd6RC43VVMBX9w" general="_qdx83P8fEduhWtVvKtiQ7w"/>
559
        <generalization xmi:id="_qdx-GP8fEduhWtVvKtiQ7w" general="_qdx93f8fEduhWtVvKtiQ7w"/>
563
        <generalization xmi:id="_qdx-GP8fEduhWtVvKtiQ7w" general="_qdx93f8fEduhWtVvKtiQ7w"/>
560
        <ownedAttribute xmi:id="_qdx-Gf8fEduhWtVvKtiQ7w" name="symbol" visibility="public" isOrdered="true">
561
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EString"/>
562
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Gv8fEduhWtVvKtiQ7w"/>
563
        </ownedAttribute>
564
      </packagedElement>
564
      </packagedElement>
565
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-G_8fEduhWtVvKtiQ7w" name="InvalidLiteralExpCS">
565
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-G_8fEduhWtVvKtiQ7w" name="InvalidLiteralExpCS">
566
        <generalization xmi:id="_9073ALKsEd6RC43VVMBX9w" general="_qdx83P8fEduhWtVvKtiQ7w"/>
566
        <generalization xmi:id="_qdx-HP8fEduhWtVvKtiQ7w" general="_qdx93f8fEduhWtVvKtiQ7w"/>
567
        <generalization xmi:id="_qdx-HP8fEduhWtVvKtiQ7w" general="_qdx93f8fEduhWtVvKtiQ7w"/>
567
        <ownedAttribute xmi:id="_qdx-Hf8fEduhWtVvKtiQ7w" name="symbol" visibility="public" isOrdered="true">
568
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EString"/>
569
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qdx-Hv8fEduhWtVvKtiQ7w"/>
570
        </ownedAttribute>
571
      </packagedElement>
568
      </packagedElement>
572
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-H_8fEduhWtVvKtiQ7w" name="CollectionRangeCS">
569
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-H_8fEduhWtVvKtiQ7w" name="CollectionRangeCS">
573
        <generalization xmi:id="_qdx-IP8fEduhWtVvKtiQ7w" general="_qdx98P8fEduhWtVvKtiQ7w"/>
570
        <generalization xmi:id="_qdx-IP8fEduhWtVvKtiQ7w" general="_qdx98P8fEduhWtVvKtiQ7w"/>
Lines 652-668 Link Here
652
      </packagedElement>
649
      </packagedElement>
653
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-Vf8fEduhWtVvKtiQ7w" name="OperationCallExpCS">
650
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-Vf8fEduhWtVvKtiQ7w" name="OperationCallExpCS">
654
        <generalization xmi:id="_qdx-Vv8fEduhWtVvKtiQ7w" general="_qdx-Sv8fEduhWtVvKtiQ7w"/>
651
        <generalization xmi:id="_qdx-Vv8fEduhWtVvKtiQ7w" general="_qdx-Sv8fEduhWtVvKtiQ7w"/>
655
        <ownedAttribute xmi:id="_306UMJXiEd6Wx-S3aeq4Aw" name="isAtomic" visibility="public" isOrdered="true">
652
        <ownedAttribute xmi:id="_uREjQJrAEd6qQcRgrpdjbQ" name="pathNameCS" type="_qdx8v_8fEduhWtVvKtiQ7w" isOrdered="true" aggregation="composite">
656
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EBooleanObject"/>
653
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_uREjQZrAEd6qQcRgrpdjbQ"/>
657
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_306UMZXiEd6Wx-S3aeq4Aw"/>
658
          <defaultValue xmi:type="uml:LiteralString" xmi:id="_8lGFsJXiEd6Wx-S3aeq4Aw" value="false"/>
659
        </ownedAttribute>
654
        </ownedAttribute>
660
      </packagedElement>
655
        <ownedAttribute xmi:id="_z9V7sLI8Ed6kyPEWd5jeqw" name="isAtomic" visibility="public" isOrdered="true">
661
      <packagedElement xmi:type="uml:Class" xmi:id="_qdx-V_8fEduhWtVvKtiQ7w" name="StateExpCS">
656
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/EcorePrimitiveTypes.library.uml#EBooleanObject"/>
662
        <generalization xmi:id="_qdx-WP8fEduhWtVvKtiQ7w" general="_qdx8xP8fEduhWtVvKtiQ7w"/>
657
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_z9V7sbI8Ed6kyPEWd5jeqw"/>
663
        <ownedAttribute xmi:id="_pS7AEJPiEd6yA_hAShwLtA" name="simpleNames" type="_qdx83P8fEduhWtVvKtiQ7w" isOrdered="true" aggregation="composite">
658
          <defaultValue xmi:type="uml:LiteralString" xmi:id="_3WtEMLI8Ed6kyPEWd5jeqw" value="false"/>
664
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_pS7AEZPiEd6yA_hAShwLtA" value="*"/>
665
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_pS7AEpPiEd6yA_hAShwLtA"/>
666
        </ownedAttribute>
659
        </ownedAttribute>
667
      </packagedElement>
660
      </packagedElement>
668
      <packagedElement xmi:type="uml:PrimitiveType" xmi:id="_tvVQwI2FEd2mlKUM3HGxZg" name="IToken"/>
661
      <packagedElement xmi:type="uml:PrimitiveType" xmi:id="_tvVQwI2FEd2mlKUM3HGxZg" name="IToken"/>
Lines 839-847 Link Here
839
  <Ecore:EClass xmi:id="_qfsogP8fEduhWtVvKtiQ7w" base_Class="_qdx-E_8fEduhWtVvKtiQ7w"/>
832
  <Ecore:EClass xmi:id="_qfsogP8fEduhWtVvKtiQ7w" base_Class="_qdx-E_8fEduhWtVvKtiQ7w"/>
840
  <Ecore:EAttribute xmi:id="_qfsogf8fEduhWtVvKtiQ7w" base_Property="_qdx-Ff8fEduhWtVvKtiQ7w"/>
833
  <Ecore:EAttribute xmi:id="_qfsogf8fEduhWtVvKtiQ7w" base_Property="_qdx-Ff8fEduhWtVvKtiQ7w"/>
841
  <Ecore:EClass xmi:id="_qfsogv8fEduhWtVvKtiQ7w" base_Class="_qdx-F_8fEduhWtVvKtiQ7w"/>
834
  <Ecore:EClass xmi:id="_qfsogv8fEduhWtVvKtiQ7w" base_Class="_qdx-F_8fEduhWtVvKtiQ7w"/>
842
  <Ecore:EAttribute xmi:id="_qfsog_8fEduhWtVvKtiQ7w" base_Property="_qdx-Gf8fEduhWtVvKtiQ7w"/>
835
  <Ecore:EAttribute xmi:id="_qfsog_8fEduhWtVvKtiQ7w"/>
843
  <Ecore:EClass xmi:id="_qfsohP8fEduhWtVvKtiQ7w" base_Class="_qdx-G_8fEduhWtVvKtiQ7w"/>
836
  <Ecore:EClass xmi:id="_qfsohP8fEduhWtVvKtiQ7w" base_Class="_qdx-G_8fEduhWtVvKtiQ7w"/>
844
  <Ecore:EAttribute xmi:id="_qfsohf8fEduhWtVvKtiQ7w" base_Property="_qdx-Hf8fEduhWtVvKtiQ7w"/>
837
  <Ecore:EAttribute xmi:id="_qfsohf8fEduhWtVvKtiQ7w"/>
845
  <Ecore:EClass xmi:id="_qfsohv8fEduhWtVvKtiQ7w" base_Class="_qdx-H_8fEduhWtVvKtiQ7w"/>
838
  <Ecore:EClass xmi:id="_qfsohv8fEduhWtVvKtiQ7w" base_Class="_qdx-H_8fEduhWtVvKtiQ7w"/>
846
  <Ecore:EReference xmi:id="_qfsoh_8fEduhWtVvKtiQ7w" xmlName="lastOclExpressionCS" base_Property="_qdx-If8fEduhWtVvKtiQ7w"/>
839
  <Ecore:EReference xmi:id="_qfsoh_8fEduhWtVvKtiQ7w" xmlName="lastOclExpressionCS" base_Property="_qdx-If8fEduhWtVvKtiQ7w"/>
847
  <Ecore:EClass xmi:id="_qfsoiP8fEduhWtVvKtiQ7w" base_Class="_qdx-Jf8fEduhWtVvKtiQ7w"/>
840
  <Ecore:EClass xmi:id="_qfsoiP8fEduhWtVvKtiQ7w" base_Class="_qdx-Jf8fEduhWtVvKtiQ7w"/>
Lines 862-868 Link Here
862
  <Ecore:EReference xmi:id="_qf-8Jf8fEduhWtVvKtiQ7w" base_Property="_qdx-TP8fEduhWtVvKtiQ7w"/>
855
  <Ecore:EReference xmi:id="_qf-8Jf8fEduhWtVvKtiQ7w" base_Property="_qdx-TP8fEduhWtVvKtiQ7w"/>
863
  <Ecore:EReference xmi:id="_qf-8Jv8fEduhWtVvKtiQ7w" base_Property="_qdx-T_8fEduhWtVvKtiQ7w"/>
856
  <Ecore:EReference xmi:id="_qf-8Jv8fEduhWtVvKtiQ7w" base_Property="_qdx-T_8fEduhWtVvKtiQ7w"/>
864
  <Ecore:EClass xmi:id="_qf-8J_8fEduhWtVvKtiQ7w" base_Class="_qdx-Vf8fEduhWtVvKtiQ7w"/>
857
  <Ecore:EClass xmi:id="_qf-8J_8fEduhWtVvKtiQ7w" base_Class="_qdx-Vf8fEduhWtVvKtiQ7w"/>
865
  <Ecore:EClass xmi:id="_qf-8KP8fEduhWtVvKtiQ7w" base_Class="_qdx-V_8fEduhWtVvKtiQ7w"/>
858
  <Ecore:EClass xmi:id="_qf-8KP8fEduhWtVvKtiQ7w"/>
866
  <Ecore:EAttribute xmi:id="_qf-8Kf8fEduhWtVvKtiQ7w"/>
859
  <Ecore:EAttribute xmi:id="_qf-8Kf8fEduhWtVvKtiQ7w"/>
867
  <Ecore:EDataType xmi:id="_wn-44I2FEd2mlKUM3HGxZg" instanceClassName="lpg.lpgjavaruntime.IToken" base_PrimitiveType="_tvVQwI2FEd2mlKUM3HGxZg"/>
860
  <Ecore:EDataType xmi:id="_wn-44I2FEd2mlKUM3HGxZg" instanceClassName="lpg.lpgjavaruntime.IToken" base_PrimitiveType="_tvVQwI2FEd2mlKUM3HGxZg"/>
868
  <Ecore:EAttribute xmi:id="_qkehgI2JEd2mlKUM3HGxZg" isTransient="true" base_Property="_PkTnII2GEd2mlKUM3HGxZg"/>
861
  <Ecore:EAttribute xmi:id="_qkehgI2JEd2mlKUM3HGxZg" isTransient="true" base_Property="_PkTnII2GEd2mlKUM3HGxZg"/>
(-)src/org/eclipse/ocl/parser/backtracking/OCLParserErrors.g (-5 / +1 lines)
Lines 55-65 Link Here
55
		./
55
		./
56
	defExpressionCS ::= IDENTIFIER ERROR_Colon
56
	defExpressionCS ::= IDENTIFIER ERROR_Colon
57
		/.$BeginJava
57
		/.$BeginJava
58
					VariableCS variableCS = createVariableCS(
58
					VariableCS variableCS = createVariableCS(getTokenText($getToken(1)));
59
								getTokenText($getToken(1)),
60
								null,
61
								null
62
							);
63
					setOffsets(variableCS, getIToken($getToken(1)), getIToken($getToken(2)));
59
					setOffsets(variableCS, getIToken($getToken(1)), getIToken($getToken(2)));
64
					CSTNode result = createDefExpressionCS(
60
					CSTNode result = createDefExpressionCS(
65
							variableCS,
61
							variableCS,
(-)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 ::= collectionTypeIdentifierCS '(' 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 (-71 / +129 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./
127
	keywordOperationCallExpCS ::= keywordAsName ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
128
		/.$NewCase./
129
	operationCallExpCS ::= binaryName ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
130
		/.$BeginJava
128
		/.$BeginJava
131
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
129
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
132
					CSTNode result = createOperationCallExpCS(
130
					CallExpCS result = createArrowOperationCallExpCS(
133
							simpleNameCS,
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 ::= notReservedSimpleNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
171
		/.$BeginJava
172
					CSTNode result = createDotOperationCallExpCS(
173
							null,
174
							null,
175
							(SimpleNameCS)$getSym(1),
134
							(IsMarkedPreCS)$getSym(2),
176
							(IsMarkedPreCS)$getSym(2),
135
							(EList)$getSym(4)
177
							(EList)$getSym(4)
136
						);
178
						);
137
					setOffsets(result, simpleNameCS, getIToken($getToken(5)));
179
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
138
					$setResult(result);
180
					$setResult(result);
139
		  $EndJava
181
		  $EndJava
140
		./
182
		./
141
	operationCallExpCS ::= oclIsInStateName ERROR_IsMarkedPreCS '(' stateExpCS ')'
183
184
	operationCallExpCS_G ::=  pathNameCS '::' ERROR_SimpleNameCS '(' argumentsCSopt ')'
142
		/.$BeginJava
185
		/.$BeginJava
143
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
186
					OperationCallExpCS result = createDotOperationCallExpCS(
144
					CSTNode result = createOperationCallExpCS(
187
							null,
145
							simpleNameCS,
188
							(PathNameCS)$getSym(1),
146
							(IsMarkedPreCS)$getSym(2),
189
							(SimpleNameCS)$getSym(3),
147
							(StateExpCS)$getSym(4)
190
							null,
191
							(EList)$getSym(5)
148
						);
192
						);
149
					setOffsets(result, simpleNameCS, getIToken($getToken(5)));
193
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6)));
150
					$setResult(result);
194
					$setResult(result);
151
		  $EndJava
195
		  $EndJava
152
		./
196
		./
197
		
198
	operationCallExpCS_IJ ::= dotArrowExpCS '.' qualifiedPathNameCS ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
199
		/.$BeginJava
200
					PathNameCS pathName = (PathNameCS)$getSym(3);
201
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
202
					CallExpCS result = createDotOperationCallExpCS(
203
							source,
204
							pathName,
205
							removeLastSimpleNameCS(pathName),
206
							(IsMarkedPreCS)$getSym(4),
207
							(EList)$getSym(6)
208
						);
209
					setOffsets(result, source, getIToken($getToken(7)));
210
					$setResult(result);
211
		  $EndJava
212
		./		
213
	operationCallExpCS_IJ ::= dotArrowExpCS '.' pathNameCS '::' ERROR_SimpleNameCS isMarkedPreCSopt '(' argumentsCSopt ')'
214
		/.$BeginJava
215
					OCLExpressionCS source = (OCLExpressionCS)$getSym(1);
216
					CallExpCS result = createDotOperationCallExpCS(
217
							source,
218
							(PathNameCS)$getSym(3),
219
							(SimpleNameCS)$getSym(5),
220
							(IsMarkedPreCS)$getSym(6),
221
							(EList)$getSym(8)
222
						);
223
					setOffsets(result, source, getIToken($getToken(9)));
224
					$setResult(result);
225
		  $EndJava
226
		./	
153
227
154
	ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS ERROR_TOKEN
228
	ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS ERROR_TOKEN
155
		/.$BeginJava
229
		/.$BeginJava
Lines 200-230 Link Here
200
		  $EndJava
274
		  $EndJava
201
		./
275
		./
202
		
276
		
203
	messageExpCS ::= '^' simpleNameCS ERROR_TOKEN
277
	oclMessageExpCS ::= dotArrowExpCS '^' simpleNameCS ERROR_TOKEN
204
		/.$NewCase./
278
		/.$NewCase./
205
	messageExpCS ::= '^^' simpleNameCS ERROR_TOKEN
279
	oclMessageExpCS ::= dotArrowExpCS '^^' simpleNameCS ERROR_TOKEN
206
		/.$BeginJava
280
		/.$BeginJava
207
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS);
281
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS);
208
					CSTNode result = createMessageExpCS(
282
					OCLExpressionCS target = (OCLExpressionCS)$getSym(1);
209
							getIToken($getToken(1)).getKind() == $sym_type.TK_CARET,
283
					MessageExpCS result = createMessageExpCS(
210
							(SimpleNameCS)$getSym(2),
284
							target,
285
							getIToken($getToken(2)).getKind() == $sym_type.TK_CARET,
286
							(SimpleNameCS)$getSym(3),
211
							new BasicEList<OCLMessageArgCS>()
287
							new BasicEList<OCLMessageArgCS>()
212
						);
288
						);
213
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
289
					setOffsets(result, target, getIToken($getToken(4)));
214
					$setResult(result);
290
					$setResult(result);
215
		  $EndJava
291
		  $EndJava
216
		./
292
		./
217
	messageExpCS ::= '^' ERROR_SimpleNameCS
293
	oclMessageExpCS ::= dotArrowExpCS '^' ERROR_SimpleNameCS
218
		/.$NewCase./
294
		/.$NewCase./
219
	messageExpCS ::= '^^' ERROR_SimpleNameCS
295
	oclMessageExpCS ::= dotArrowExpCS '^^' ERROR_SimpleNameCS
220
		/.$BeginJava
296
		/.$BeginJava
221
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(2);
297
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
222
					CSTNode result = createMessageExpCS(
298
					OCLExpressionCS target = (OCLExpressionCS)$getSym(1);
223
							getIToken($getToken(1)).getKind() == $sym_type.TK_CARET,
299
					MessageExpCS result = createMessageExpCS(
300
							target,
301
							getIToken($getToken(2)).getKind() == $sym_type.TK_CARET,
224
							simpleNameCS,
302
							simpleNameCS,
225
							new BasicEList<OCLMessageArgCS>()
303
							new BasicEList<OCLMessageArgCS>()
226
						);
304
						);
227
					setOffsets(result, getIToken($getToken(1)), simpleNameCS);
305
					setOffsets(result, target, 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 ::= notReservedSimpleNameCS '(' variableListCSopt ')' ERROR_Colon
250
		/.$BeginJava
328
		/.$BeginJava
251
					CSTNode result = createOperationCS(
329
					CSTNode result = createOperationCS(
252
							getTokenText($getToken(1)),
330
							getTokenText($getToken(1)),
Lines 257-263 Link Here
257
					$setResult(result);
335
					$setResult(result);
258
		  $EndJava
336
		  $EndJava
259
		./
337
		./
260
	operationCS1 ::= IDENTIFIER '(' parametersCSopt ERROR_TOKEN
338
	operationCS1 ::= notReservedSimpleNameCS '(' variableListCSopt ERROR_TOKEN
261
		/.$BeginJava
339
		/.$BeginJava
262
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN);
340
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN);
263
					CSTNode result = createOperationCS(
341
					CSTNode result = createOperationCS(
Lines 269-275 Link Here
269
					$setResult(result);
347
					$setResult(result);
270
		  $EndJava
348
		  $EndJava
271
		./
349
		./
272
	operationCS1 ::= IDENTIFIER ERROR_TOKEN
350
	operationCS1 ::= notReservedSimpleNameCS ERROR_TOKEN
273
		/.$BeginJava
351
		/.$BeginJava
274
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN);
352
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN);
275
					CSTNode result = createOperationCS(
353
					CSTNode result = createOperationCS(
Lines 293-336 Link Here
293
					$setResult(result);
371
					$setResult(result);
294
		  $EndJava
372
		  $EndJava
295
		./
373
		./
296
	operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ')' ERROR_Colon
374
	operationCS2 ::= qualifiedPathNameCS '(' variableListCSopt ')' ERROR_Colon
297
		/.$BeginJava
375
		/.$BeginJava
298
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
376
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
299
					CSTNode result = createOperationCS(
377
					CSTNode result = createOperationCS(
300
							pathNameCS,
378
							pathNameCS,
301
							(SimpleNameCS)$getSym(3),
379
							removeLastSimpleNameCS(pathNameCS),
302
							(EList)$getSym(5),
380
							(EList)$getSym(3),
303
							(TypeCS)$getSym(8)
381
							null
304
						);
382
						);
305
					setOffsets(result, pathNameCS, getIToken($getToken(7)));
383
					setOffsets(result, pathNameCS, getIToken($getToken(5)));
306
					$setResult(result);
384
					$setResult(result);
307
		  $EndJava
385
		  $EndJava
308
		./
386
		./
309
	operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ERROR_TOKEN
387
	operationCS2 ::= qualifiedPathNameCS '(' variableListCSopt ERROR_TOKEN
310
		/.$BeginJava
388
		/.$BeginJava
311
					reportErrorTokenMessage($getToken(6), OCLParserErrors.MISSING_RPAREN);
389
					reportErrorTokenMessage($getToken(6), OCLParserErrors.MISSING_RPAREN);
312
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
390
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
313
					CSTNode result = createOperationCS(
391
					CSTNode result = createOperationCS(
314
							pathNameCS,
392
							pathNameCS,
315
							(SimpleNameCS)$getSym(3),
393
							removeLastSimpleNameCS(pathNameCS),
316
							(EList)$getSym(5),
394
							(EList)$getSym(3),
317
							null
395
							null
318
						);
396
						);
319
					setOffsets(result, pathNameCS, getIToken($getToken(7)));
397
					setOffsets(result, pathNameCS, getIToken($getToken(4)));
320
					$setResult(result);
398
					$setResult(result);
321
		  $EndJava
399
		  $EndJava
322
		./
400
		./
323
	operationCS2 ::= pathNameCS '::' simpleNameCS ERROR_TOKEN
401
	operationCS2 ::= qualifiedPathNameCS ERROR_TOKEN
324
		/.$BeginJava
402
		/.$BeginJava
325
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_LPAREN);
403
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_LPAREN);
326
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
404
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
327
					CSTNode result = createOperationCS(
405
					CSTNode result = createOperationCS(
328
							pathNameCS,
406
							pathNameCS,
329
							(SimpleNameCS)$getSym(3),
407
							removeLastSimpleNameCS(pathNameCS),
330
							new BasicEList(),
408
							new BasicEList(),
331
							null
409
							null
332
						);
410
						);
333
					setOffsets(result, pathNameCS, getIToken($getToken(4)));
411
					setOffsets(result, pathNameCS, getIToken($getToken(2)));
334
					$setResult(result);
412
					$setResult(result);
335
		  $EndJava
413
		  $EndJava
336
		./
414
		./
Lines 375-407 Link Here
375
		  $EndJava
453
		  $EndJava
376
		./
454
		./
377
455
378
	variableCS ::= IDENTIFIER ERROR_TOKEN
456
--	variableCS ::= notLiteralNorReservedSimpleNameCS ERROR_TOKEN
379
		/.$BeginJava
457
--		/.$BeginJava
380
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE);
458
--					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE);
381
					CSTNode result = createVariableCS(
459
--					SimpleNameCS name = (SimpleNameCS)$getSym(1);
382
							getTokenText($getToken(1)),
460
--					CSTNode result = createVariableCS(name.getValue());
383
							null,
461
--					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(2)));
384
							null
462
--					$setResult(result);
385
						);
463
--		  $EndJava
386
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(2)));
464
--		./
387
					$setResult(result);
388
		  $EndJava
389
		./
390
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
465
406
	variableListCS ::= ERROR_TOKEN
466
	variableListCS ::= ERROR_TOKEN
407
		/.$NewCase./
467
		/.$NewCase./
(-)src/org/eclipse/ocl/cst/util/CSTAdapterFactory.java (-20 lines)
Lines 67-73 Link Here
67
import org.eclipse.ocl.cst.PropertyContextCS;
67
import org.eclipse.ocl.cst.PropertyContextCS;
68
import org.eclipse.ocl.cst.RealLiteralExpCS;
68
import org.eclipse.ocl.cst.RealLiteralExpCS;
69
import org.eclipse.ocl.cst.SimpleNameCS;
69
import org.eclipse.ocl.cst.SimpleNameCS;
70
import org.eclipse.ocl.cst.StateExpCS;
71
import org.eclipse.ocl.cst.StringLiteralExpCS;
70
import org.eclipse.ocl.cst.StringLiteralExpCS;
72
import org.eclipse.ocl.cst.TupleLiteralExpCS;
71
import org.eclipse.ocl.cst.TupleLiteralExpCS;
73
import org.eclipse.ocl.cst.TupleTypeCS;
72
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 383-393 Link Here
383
		}
382
		}
384
383
385
		@Override
384
		@Override
386
		public Adapter caseStateExpCS(StateExpCS object) {
387
			return createStateExpCSAdapter();
388
		}
389
390
		@Override
391
		public Adapter caseOCLDocumentCS(OCLDocumentCS object) {
385
		public Adapter caseOCLDocumentCS(OCLDocumentCS object) {
392
			return createOCLDocumentCSAdapter();
386
			return createOCLDocumentCSAdapter();
393
		}
387
		}
Lines 1014-1033 Link Here
1014
	}
1008
	}
1015
1009
1016
	/**
1010
	/**
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>}'.
1011
	 * Creates a new adapter for an object of class '{@link org.eclipse.ocl.cst.OCLDocumentCS <em>OCL Document CS</em>}'.
1032
	 * <!-- begin-user-doc -->
1012
	 * <!-- begin-user-doc -->
1033
	 * This default implementation returns null so that we can easily ignore cases;
1013
	 * This default implementation returns null so that we can easily ignore cases;
(-)src/org/eclipse/ocl/cst/util/CSTSwitch.java (-29 / +8 lines)
Lines 67-73 Link Here
67
import org.eclipse.ocl.cst.PropertyContextCS;
67
import org.eclipse.ocl.cst.PropertyContextCS;
68
import org.eclipse.ocl.cst.RealLiteralExpCS;
68
import org.eclipse.ocl.cst.RealLiteralExpCS;
69
import org.eclipse.ocl.cst.SimpleNameCS;
69
import org.eclipse.ocl.cst.SimpleNameCS;
70
import org.eclipse.ocl.cst.StateExpCS;
71
import org.eclipse.ocl.cst.StringLiteralExpCS;
70
import org.eclipse.ocl.cst.StringLiteralExpCS;
72
import org.eclipse.ocl.cst.TupleLiteralExpCS;
71
import org.eclipse.ocl.cst.TupleLiteralExpCS;
73
import org.eclipse.ocl.cst.TupleTypeCS;
72
import org.eclipse.ocl.cst.TupleTypeCS;
Lines 401-406 Link Here
401
				CollectionTypeCS collectionTypeCS = (CollectionTypeCS) theEObject;
400
				CollectionTypeCS collectionTypeCS = (CollectionTypeCS) theEObject;
402
				T result = caseCollectionTypeCS(collectionTypeCS);
401
				T result = caseCollectionTypeCS(collectionTypeCS);
403
				if (result == null)
402
				if (result == null)
403
					result = caseSimpleNameCS(collectionTypeCS);
404
				if (result == null)
404
					result = caseTypeCS(collectionTypeCS);
405
					result = caseTypeCS(collectionTypeCS);
405
				if (result == null)
406
				if (result == null)
406
					result = caseOCLExpressionCS(collectionTypeCS);
407
					result = caseOCLExpressionCS(collectionTypeCS);
Lines 588-593 Link Here
588
				BooleanLiteralExpCS booleanLiteralExpCS = (BooleanLiteralExpCS) theEObject;
589
				BooleanLiteralExpCS booleanLiteralExpCS = (BooleanLiteralExpCS) theEObject;
589
				T result = caseBooleanLiteralExpCS(booleanLiteralExpCS);
590
				T result = caseBooleanLiteralExpCS(booleanLiteralExpCS);
590
				if (result == null)
591
				if (result == null)
592
					result = caseSimpleNameCS(booleanLiteralExpCS);
593
				if (result == null)
591
					result = casePrimitiveLiteralExpCS(booleanLiteralExpCS);
594
					result = casePrimitiveLiteralExpCS(booleanLiteralExpCS);
592
				if (result == null)
595
				if (result == null)
593
					result = caseLiteralExpCS(booleanLiteralExpCS);
596
					result = caseLiteralExpCS(booleanLiteralExpCS);
Lines 603-608 Link Here
603
				NullLiteralExpCS nullLiteralExpCS = (NullLiteralExpCS) theEObject;
606
				NullLiteralExpCS nullLiteralExpCS = (NullLiteralExpCS) theEObject;
604
				T result = caseNullLiteralExpCS(nullLiteralExpCS);
607
				T result = caseNullLiteralExpCS(nullLiteralExpCS);
605
				if (result == null)
608
				if (result == null)
609
					result = caseSimpleNameCS(nullLiteralExpCS);
610
				if (result == null)
606
					result = caseLiteralExpCS(nullLiteralExpCS);
611
					result = caseLiteralExpCS(nullLiteralExpCS);
607
				if (result == null)
612
				if (result == null)
608
					result = caseOCLExpressionCS(nullLiteralExpCS);
613
					result = caseOCLExpressionCS(nullLiteralExpCS);
Lines 616-621 Link Here
616
				InvalidLiteralExpCS invalidLiteralExpCS = (InvalidLiteralExpCS) theEObject;
621
				InvalidLiteralExpCS invalidLiteralExpCS = (InvalidLiteralExpCS) theEObject;
617
				T result = caseInvalidLiteralExpCS(invalidLiteralExpCS);
622
				T result = caseInvalidLiteralExpCS(invalidLiteralExpCS);
618
				if (result == null)
623
				if (result == null)
624
					result = caseSimpleNameCS(invalidLiteralExpCS);
625
				if (result == null)
619
					result = caseLiteralExpCS(invalidLiteralExpCS);
626
					result = caseLiteralExpCS(invalidLiteralExpCS);
620
				if (result == null)
627
				if (result == null)
621
					result = caseOCLExpressionCS(invalidLiteralExpCS);
628
					result = caseOCLExpressionCS(invalidLiteralExpCS);
Lines 718-736 Link Here
718
					result = defaultCase(theEObject);
725
					result = defaultCase(theEObject);
719
				return result;
726
				return result;
720
			}
727
			}
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 : {
728
			case CSTPackage.OCL_DOCUMENT_CS : {
735
				OCLDocumentCS oclDocumentCS = (OCLDocumentCS) theEObject;
729
				OCLDocumentCS oclDocumentCS = (OCLDocumentCS) theEObject;
736
				T result = caseOCLDocumentCS(oclDocumentCS);
730
				T result = caseOCLDocumentCS(oclDocumentCS);
Lines 1452-1472 Link Here
1452
	}
1446
	}
1453
1447
1454
	/**
1448
	/**
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>'.
1449
	 * Returns the result of interpreting the object as an instance of '<em>OCL Document CS</em>'.
1471
	 * <!-- begin-user-doc -->
1450
	 * <!-- begin-user-doc -->
1472
	 * This implementation returns null;
1451
	 * This implementation returns null;
(-)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

Return to bug 184048