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 294698
Collapse All | Expand All

(-)src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java (-13 / +1 lines)
Lines 236-253 Link Here
236
	}
236
	}
237
237
238
	/**
238
	/**
239
	 * @since 3.0
240
	 */
241
	public void initPathNameAst(PathNameCS pathNameCS, Object astNode) {
242
		pathNameCS.setAst(astNode);
243
		List<SimpleNameCS> simpleNames = pathNameCS.getSimpleNames();
244
		for (int i = simpleNames.size() - 1; i >= 0; --i) {
245
			simpleNames.get(i).setAst(astNode);
246
			astNode = astNode instanceof EObject ? ((EObject)astNode).eContainer() : null;
247
		}
248
	}
249
250
	/**
251
	 * Returns true if the token kind is an identifier or keyword, otherwise
239
	 * Returns true if the token kind is an identifier or keyword, otherwise
252
	 * false.
240
	 * false.
253
	 * 
241
	 * 
Lines 1754-1760 Link Here
1754
				ERROR(typeCS, "typeCS", message);//$NON-NLS-1$
1742
				ERROR(typeCS, "typeCS", message);//$NON-NLS-1$
1755
				astNode = createDummyInvalidType(env, typeCS, message);
1743
				astNode = createDummyInvalidType(env, typeCS, message);
1756
			}
1744
			}
1757
			initPathNameAst((PathNameCS)typeCS, astNode);
1745
			typeCS.setAst(astNode);
1758
		} else if (typeCS instanceof CollectionTypeCS
1746
		} else if (typeCS instanceof CollectionTypeCS
1759
			|| typeCS instanceof TupleTypeCS) {
1747
			|| typeCS instanceof TupleTypeCS) {
1760
			if (typeCS instanceof CollectionTypeCS) {
1748
			if (typeCS instanceof CollectionTypeCS) {
(-)src/org/eclipse/ocl/cst/impl/PathNameCSImpl.java (-1 / +10 lines)
Lines 22-27 Link Here
22
import org.eclipse.emf.common.notify.NotificationChain;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
24
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
25
import org.eclipse.emf.ecore.EObject;
25
import org.eclipse.emf.ecore.InternalEObject;
26
import org.eclipse.emf.ecore.InternalEObject;
26
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
27
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
27
import org.eclipse.emf.ecore.util.InternalEList;
28
import org.eclipse.emf.ecore.util.InternalEList;
Lines 167-175 Link Here
167
		return super.eIsSet(featureID);
168
		return super.eIsSet(featureID);
168
	}
169
	}
169
170
171
	/**
172
	 * Set the associated AST object to newAst, and set the correspondiing
173
	 * AST objects of the child simpleNames to newAst and its containers.
174
	 */
170
	@Override
175
	@Override
171
	public void setAst(Object newAst) {
176
	public void setAst(Object newAst) {
172
		// TODO Auto-generated method stub
177
		Object node = newAst;
178
		for (int i = simpleNames.size() - 1; i >= 0; --i) {
179
			simpleNames.get(i).setAst(node);
180
			node = node instanceof EObject ? ((EObject)node).eContainer() : null;
181
		}
173
		super.setAst(newAst);
182
		super.setAst(newAst);
174
	}
183
	}
175
184

Return to bug 294698