Commit 2a40a6cb authored by Malte Heithoff's avatar Malte Heithoff
Browse files

Merge branch 'UpdateVersions' into 'master'

Update versions

See merge request !24
parents f43b69ce 31fa64fe
Pipeline #352049 passed with stage
in 3 minutes and 31 seconds
......@@ -10,22 +10,23 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc</artifactId>
<version>0.1.19-SNAPSHOT</version>
<version>0.2.12-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<wagon.provider.version>2.6</wagon.provider.version>
<!-- .. EMA-Libraries ................................................. -->
<struct.version>0.2.12-SNAPSHOT</struct.version>
<Common-MontiCar.version>0.2.12-SNAPSHOT</Common-MontiCar.version>
<tagging.version>0.2.12-SNAPSHOT</tagging.version>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>5.0.0</monticore.version>
<se-commons.version>1.7.7</se-commons.version>
<mc.grammars.assembly.version>0.0.6-SNAPSHOT</mc.grammars.assembly.version>
<languages.version>4.0.1-SNAPSHOT</languages.version>
<struct.version>0.0.18-SNAPSHOT</struct.version>
<Common-MontiCar.version>0.0.19-SNAPSHOT</Common-MontiCar.version>
<tagging.version>0.0.6</tagging.version>
<languages.version>4.0.1-SNAPSHOT</languages.version>
<!-- .. Libraries .................................................. -->
<guava.version>25.1-jre</guava.version>
<junit.version>4.12</junit.version>
......@@ -302,7 +303,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<version>2.22.2</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
......
......@@ -3,8 +3,11 @@ package de.monticore.lang.embeddedmontiarc.embeddedmontiarc;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.monticar.stream._symboltable.StreamLanguage;
import de.monticore.lang.monticar.streamunits._ast.ASTStreamUnitsCompilationUnit;
import de.monticore.lang.monticar.streamunits._parser.StreamUnitsParser;
import de.monticore.lang.monticar.streamunits._symboltable.ComponentStreamUnitsSymbol;
import de.monticore.symboltable.Scope;
import de.se_rwth.commons.Joiners;
import de.se_rwth.commons.Names;
import de.se_rwth.commons.logging.Log;
......@@ -15,13 +18,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
public final class StreamScanner {
......@@ -67,11 +64,23 @@ public final class StreamScanner {
}
Path relativePath = scanner.basePath.relativize(file);
String streamModelName = getStreamModelName(relativePath);
ComponentStreamUnitsSymbol s = scanner.symTab.<ComponentStreamUnitsSymbol>resolve(streamModelName, ComponentStreamUnitsSymbol.KIND).orElse(null);
if (s != null) {
processComponentStreamUnitsSymbol(s, f);
Optional<ASTStreamUnitsCompilationUnit> ast = new StreamUnitsParser().parse(f.getAbsolutePath());
if (ast.isPresent()) {
String packageName = Joiners.DOT.join(ast.get().getPackageList());
String modelName = f.getName().substring(0, f.getName().indexOf("."));
if (streamModelName.equals(packageName + "." + modelName)){
ComponentStreamUnitsSymbol s = scanner.symTab.<ComponentStreamUnitsSymbol>resolve(streamModelName,
ComponentStreamUnitsSymbol.KIND).orElse(null);
if (s != null) {
processComponentStreamUnitsSymbol(s, f);
} else {
Log.warn("could not resolve stream model defined in file " + f.getAbsolutePath());
}
} else {
Log.warn("package structure does not match file structure in file " + f.getAbsolutePath());
}
} else {
Log.warn("could not resolve stream model defined in file " + f.getAbsolutePath());
Log.warn("could not parse stream model defined in file " + f.getAbsolutePath());
}
return FileVisitResult.CONTINUE;
}
......
......@@ -91,7 +91,11 @@ public class EMAComponentInstanceSymbolCreator {
createInstance(inst.getComponentType(), filters, inst.getComponentType().getReferencedSymbol().getResolutionDeclarationSymbols(), packageName + "." + inst.getName())
.setName(inst.getName()).setPackageName(packageName)
.addActualTypeArguments(inst.getComponentType().getFormalTypeParameters(),
inst.getComponentType().getActualTypeArguments()).addResolvingFilters(filters).addResolutionDeclarationSymbols(inst.getComponentType().getResolutionDeclarationSymbols()).addParameters(inst.getComponentType().getReferencedSymbol().getParameters()).addArguments(inst.getComponentType().getReferencedSymbol().getArguments()).build());
inst.getComponentType().getActualTypeArguments())
.addResolvingFilters(filters)
.addResolutionDeclarationSymbols(inst.getComponentType().getResolutionDeclarationSymbols())
.addParameters(inst.getComponentType().getReferencedSymbol().getParameters())
.addArguments(inst.getComponentType().getReferencedSymbol().getArguments()).build());
Log.debug(inst.getInstanceInformation().get().getInstanceNumberForArgumentIndex(0) + "", "InstanceInformation:");
Log.debug(inst.toString(), "ComponentInstance CreateInstance PostSub");
......
......@@ -249,7 +249,7 @@ public class EMATypeHelper {
// typeArgumentSymbolReference.setStringRepresentation(TypesPrinter
// .printType(astTypeNoBound));
addTypeArgumentsToTypeSymbol(typeArgumentSymbolReference, astTypeNoBound, symbolTableCreator);
typeArgumentSymbolReference = addTypeArgumentsToTypeSymbol(typeArgumentSymbolReference, astTypeNoBound, symbolTableCreator);
actualTypeArguments.add(new ActualTypeArgument(typeArgumentSymbolReference));
} else {
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.tagging.middleware.mqtt;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.tagging.middleware.mqtt;
......
/**
* (c) https://github.com/MontiCore/monticore
*
* The license generally applicable for this project
* can be found under https://github.com/MontiCore/monticore.
*/
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.tagging.middleware.someip;
......
......@@ -195,6 +195,47 @@ public class ExpandedComponentInstanceTest extends AbstractSymtabTest {
assertEquals("1", symbol2.getTextualRepresentation());
}
@Test
public void testExpandedParameterInstance() {
Scope symTab = createSymTab("src/test/resources");
EMAComponentInstanceSymbol inst = symTab.<EMAComponentInstanceSymbol>resolve(
"testing.expandedParameterInstanceInstance", EMAComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(inst);
assertEquals(2, inst.getSubComponents().size());
assertEquals(1, inst.getSubComponents().iterator().next().getParameters().size());
for (ASTExpression astExpression : inst.getSubComponents().iterator().next().getArguments()) {
Log.info(astExpression.toString(), "info:");
}
Iterator<EMAComponentInstanceSymbol> iterator = inst.getSubComponents().iterator();
EMAComponentInstanceSymbol sub1 = iterator.next();
EMAComponentInstanceSymbol sub2 = iterator.next();
Iterator<EMAComponentInstanceSymbol> iterator1 = sub1.getSubComponents().iterator();
EMAComponentInstanceSymbol sub11 = iterator1.next();
EMAComponentInstanceSymbol sub12 = iterator1.next();
Iterator<EMAComponentInstanceSymbol> iterator2 = sub2.getSubComponents().iterator();
EMAComponentInstanceSymbol sub21 = iterator2.next();
EMAComponentInstanceSymbol sub22 = iterator2.next();
UnitNumberExpressionSymbol symbol1 = (UnitNumberExpressionSymbol) sub1.getArguments().get(0).getSymbolOpt().get();
UnitNumberExpressionSymbol symbol2 = (UnitNumberExpressionSymbol) sub2.getArguments().get(0).getSymbolOpt().get();
UnitNumberExpressionSymbol symbol11 =
(UnitNumberExpressionSymbol) sub11.getArguments().get(0).getSymbolOpt().get();
UnitNumberExpressionSymbol symbol12 =
(UnitNumberExpressionSymbol) sub12.getArguments().get(0).getSymbolOpt().get();
UnitNumberExpressionSymbol symbol21 =
(UnitNumberExpressionSymbol) sub21.getArguments().get(0).getSymbolOpt().get();
UnitNumberExpressionSymbol symbol22 =
(UnitNumberExpressionSymbol) sub22.getArguments().get(0).getSymbolOpt().get();
assertEquals("2", symbol1.getTextualRepresentation());
assertEquals("9", symbol2.getTextualRepresentation());
assertEquals("2", symbol11.getTextualRepresentation());
assertEquals("2", symbol12.getTextualRepresentation());
assertEquals("9", symbol21.getTextualRepresentation());
assertEquals("9", symbol22.getTextualRepresentation());
}
@Test
public void testAdaptableParameterInstance() {
Scope symtab = createSymTab("src/test/resources");
......
/* (c) https://github.com/MontiCore/monticore */
package testing;
component ExpandedParameter(N1 default){
}
/* (c) https://github.com/MontiCore/monticore */
package testing;
component ExpandedParameterInstance(N1 val = 2){
instance ExpandedParameter(val) basicParameter;
instance ExpandedParameter(val) basicParameter2;
}
/* (c) https://github.com/MontiCore/monticore */
package testing;
component ExpandedParameterInstanceInstance {
instance ExpandedParameterInstance basicParameter;
instance ExpandedParameterInstance(9) basicParameter2;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment