Commit 386eee28 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* scoping and validator refinements

parent 787b5074
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -361,8 +361,10 @@ public class TDLScopeProvider extends AbstractDeclarativeScopeProvider {
					return scope;
				} else if (context.eContainer() instanceof ProcedureCall) {
//					if (((FunctionCall)context.eContainer()).getFunction().get instanceof StructuredDataInstance) {
					if (((ProcedureCall)context.eContainer()).getSignature() != null) {
						IScope scope = Scopes.scopeFor(((ProcedureCall)context.eContainer()).getSignature().getParameter());
						return scope;
					}
//					}
				} else if (context.eContainer() instanceof DataElementUse) {
					//TODO: extract and simplify
+2 −1
Original line number Diff line number Diff line
@@ -41,10 +41,10 @@ public class Validator {
		Validator.removeValidator(StructuredObjectivesPackage.eINSTANCE);
		Validator.removeValidator(ExtendedConfigurationsPackage.eINSTANCE);
		validator = null;
		org.eclipse.ocl.pivot.model.OCLstdlib.install(); //needed? move to create?
		Validator.registerValidator("model/tdl-constraints.ocl", tdlPackage.eINSTANCE);
		Validator.registerValidator("model/tdl-structured-constraints.ocl", StructuredObjectivesPackage.eINSTANCE);
		Validator.registerValidator("model/tdl-configurations-constraints.ocl", ExtendedConfigurationsPackage.eINSTANCE);
		org.eclipse.ocl.pivot.model.OCLstdlib.install(); //needed? move to create?
	}
	
	public static void registerValidator(String path, EValidatorRegistrar registrar, BundleContext context) {
@@ -116,6 +116,7 @@ public class Validator {
			private CSResource xtextResource;
			@Override
			public boolean initialize(@NonNull EnvironmentFactoryInternal environmentFactory) {
				System.out.println("Init..");
				boolean success = super.initialize(environmentFactory);
				if (success) {
					resourceSet = environmentFactory.getResourceSet();