blob: db67fd4a9c86c210643b1fd3d853664c81769e1f [file] [log] [blame]
// Copied from org.eclipse.ocl.examples.test.xtext.PivotDocumentationExamples.java
// Create an EPackage.Registry for just the EXTLibraryPackage
EPackage.Registry registry = new EPackageRegistryImpl();
registry.put(EXTLibraryPackage.eNS_URI, EXTLibraryPackage.eINSTANCE);
// Create an OCL that creates a ResourceSet using the minimal EPackage.Registry
OCL ocl = OCL.newInstance(registry);
ResourceSet resourceSet = ocl.getResourceSet();
// get an OCL text file via some hypothetical API
URI uri = getInputURI("/model/parsingDocumentsExample.ocl");
// parse the contents as an OCL document
Resource asResource = ocl.parse(uri);