Browse Source

Fixed some warnings and build that was not working due to missing dir called jars.

Cláudio Gomes 3 years ago
parent
commit
9c921f60ff

+ 1 - 1
DSL_SemanticAdaptation/README.txt

@@ -5,7 +5,7 @@ git clone <repo-url>
 git submodule update --init --recursive
 ```
 
-# Development environmant:
+# Development environment:
 
 Install instructions:
 - Download Eclipse NEON (64 bits) installer.

BIN
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp/jars/.gitkeep


+ 1 - 1
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/generation/GeneralConditionSwitch.xtend

@@ -25,7 +25,7 @@ class GeneralConditionSwitch extends SemanticAdaptationSwitch<ReturnInformation>
 		return retInfo;
 	}
 	
-		override ReturnInformation caseBoolLiteral(BoolLiteral object) {
+	override ReturnInformation caseBoolLiteral(BoolLiteral object) {
 		var retInfo = new ReturnInformation();
 		retInfo.type = SVType.Boolean;
 		retInfo.value = Conversions.convertTypeToObject(retInfo.type, object);

+ 7 - 7
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/src/be/uantwerpen/ansymo/semanticadaptation/generator/SemanticAdaptationPythonGenerator.xtend

@@ -3,12 +3,12 @@
  */
 package be.uantwerpen.ansymo.semanticadaptation.generator
 
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Adaptation
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.SemanticAdaptation
 import org.eclipse.emf.ecore.resource.Resource
 import org.eclipse.xtext.generator.AbstractGenerator
 import org.eclipse.xtext.generator.IFileSystemAccess2
 import org.eclipse.xtext.generator.IGeneratorContext
-import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.*
-import org.eclipse.emf.ecore.EClass
 
 /**
  * Generates code from your model files on save.
@@ -31,12 +31,12 @@ import logging
 
 from abstract_units.AbstractSimulationUnit import AbstractSimulationUnit, \
     STEP_ACCEPT
-«/*FOR fmu:a.inner.instances.filter(AtomicFMU)»
-from case_study.units.ct_based.«fmu.name» import «fmu.name»
-«ENDFOR»
-«FOR i:a.inner.instances.filter(Adaptation)»
+�/*FOR fmu:a.inner.instances.filter(AtomicFMU)�
+from case_study.units.ct_based.�fmu.name� import �fmu.name�
+�ENDFOR�
+�FOR i:a.inner.instances.filter(Adaptation)�
 NOT YET IMPLEMENTED
-«ENDFOR*/»
+�ENDFOR*/�
 
 l = logging.getLogger()
 

+ 4 - 4
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/src/be/uantwerpen/ansymo/semanticadaptation/interpreter/Interpreter.xtend

@@ -7,10 +7,10 @@
  *******************************************************************************/
 package be.uantwerpen.ansymo.semanticadaptation.interpreter
 
-import com.google.common.collect.ImmutableMap
-import com.google.common.collect.Maps
-import java.math.BigDecimal
-import java.math.RoundingMode
+//import com.google.common.collect.ImmutableMap
+//import com.google.common.collect.Maps
+//import java.math.BigDecimal
+//import java.math.RoundingMode
 
 /** 
  * an interpreter for instances of EClasses of the {@link ArithmeticsPackage}.

+ 33 - 17
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/src/be/uantwerpen/ansymo/semanticadaptation/scoping/SemanticAdaptationScopeProvider.xtend

@@ -7,23 +7,39 @@
  *******************************************************************************/
 package be.uantwerpen.ansymo.semanticadaptation.scoping
 
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Adaptation
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.AlgebraicLoopSolution
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Component
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Connection
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.DataRule
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Declaration
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.FMU
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.For
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.FunctionDeclaration
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.If
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.InOutRules
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.OutputFunction
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Port
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.SemanticAdaptation
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.SemanticAdaptationPackage
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.StateTransitionFunction
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Variable
+import com.google.common.base.Predicate
+import com.google.inject.Inject
+import java.util.LinkedList
+import java.util.List
+import org.eclipse.emf.common.util.BasicEList
+import org.eclipse.emf.common.util.EList
+import org.eclipse.emf.ecore.EObject
 import org.eclipse.emf.ecore.EReference
+import org.eclipse.emf.ecore.resource.Resource
 import org.eclipse.xtext.EcoreUtil2
+import org.eclipse.xtext.resource.IEObjectDescription
+import org.eclipse.xtext.scoping.IGlobalScopeProvider
 import org.eclipse.xtext.scoping.IScope
 import org.eclipse.xtext.scoping.Scopes
-import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.*
-import org.eclipse.emf.common.util.BasicEList
 import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.xtext.scoping.IGlobalScopeProvider
-import com.google.inject.Inject
-import org.eclipse.emf.ecore.resource.Resource
-import com.google.common.base.Predicate
-import org.eclipse.xtext.resource.IEObjectDescription
 import org.eclipse.xtext.scoping.impl.IScopeWrapper
-import org.eclipse.emf.common.util.EList
-import java.util.List
-import java.util.LinkedList
 
 /**
  * This class contains custom scoping description.
@@ -75,9 +91,9 @@ class SemanticAdaptationScopeProvider extends AbstractDeclarativeScopeProvider
 		//var scope = __getImportedScope(context, r)
 		var EList<EObject> elements = __getAllPorts(context)
 		val outputfunction = EcoreUtil2.getContainerOfType(context, OutputFunction)
-		if (outputfunction != null) {
+		if (outputfunction !== null) {
 			val rule = outputfunction.eContainer as DataRule
-			if (rule.statetransitionfunction != null) {
+			if (rule.statetransitionfunction !== null) {
 				elements += rule.statetransitionfunction.statements
 			}
 		}
@@ -186,16 +202,16 @@ class SemanticAdaptationScopeProvider extends AbstractDeclarativeScopeProvider
 			if (containertype.isInstance(object)) {
 				val List<EObject> listOfElements = new LinkedList<EObject>()
 				val feature = object.eClass.EAllStructuralFeatures.findFirst(f | f.name.equals(featurename))
-				if (feature != null) {
+				if (feature !== null) {
 					val featurevalue = object.eGet(feature)
 					if (featurevalue instanceof EList) {
-						if (featuretype != null) {
+						if (featuretype !== null) {
 							listOfElements.addAll(featurevalue.filter(v | featuretype.isInstance(v)).map(v | v as EObject))
 						} else {
 							listOfElements.addAll(featurevalue)
 						}
 					} else if (featurevalue instanceof EObject) {
-						if (featuretype == null || featuretype.isInstance(featurevalue)) {
+						if (featuretype === null || featuretype.isInstance(featurevalue)) {
 							listOfElements.add(featurevalue)
 						}
 					} else {
@@ -242,7 +258,7 @@ class SemanticAdaptationScopeProvider extends AbstractDeclarativeScopeProvider
 	}
 
 	def protected IScope wrap(IScope scope) {
-		if (scopeWrapper!=null){
+		if (scopeWrapper!==null){
 			return scopeWrapper.wrap(scope)
 		} else {
 			return scope

+ 0 - 9
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/src/be/uantwerpen/ansymo/semanticadaptation/validation/SemanticAdaptationValidator.xtend

@@ -7,15 +7,6 @@
  *******************************************************************************/
 package be.uantwerpen.ansymo.semanticadaptation.validation
 
-import com.google.inject.Inject
-import org.eclipse.xtext.EcoreUtil2
-import be.uantwerpen.ansymo.semanticadaptation.interpreter.Interpreter
-import org.eclipse.xtext.validation.Check
-import org.eclipse.xtext.validation.ValidationMessageAcceptor
-import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.*
-
-import static be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.SemanticAdaptationPackage.Literals.*
-
 /**
  * Custom validation rules. 
  *