Commit 393ca683 authored by Julian Johannes Steinsberger-Dührßen's avatar Julian Johannes Steinsberger-Dührßen
Browse files

Merge branch 'master' into develop

parents 8e597aed 681d5d74
Pipeline #348605 passed with stage
in 1 minute and 54 seconds
......@@ -11,6 +11,28 @@ stages:
- windows
- linux
githubjob:
image: maven:3-jdk-8
stage: linux
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$GITHUB_SSH_PRIV_KEY")
- echo "$GITHUB_SSH_PRIV_KEY" | tr -d '\r' | ssh-add -
- git config --global user.email "kusmenko@se-rwth.de"
- git config --global user.name "EMA CI Robot"
- mkdir -p ~/.ssh
# - cat gitlab-known-hosts >> ~/.ssh/known_hosts
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
script:
- git clone git@github.com:MontiCore/EmbeddedMontiArc.git
- cd EmbeddedMontiArc
- git subtree pull --prefix $PRJ_NAME https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/${PRJ_NAME}.git master --squash
- git push --force
only:
- master
masterJobLinux:
stage: linux
image: maven:3-jdk-8
......
<!--
(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 -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
......@@ -24,22 +16,24 @@
<properties>
<!-- .. EMA-Libraries ................................................. -->
<Common-MontiCar.version>0.2.12-SNAPSHOT</Common-MontiCar.version>
<Embedded-MontiArc.version>0.2.12-SNAPSHOT</Embedded-MontiArc.version>
<Embedded-MontiArc-Math.version>0.2.12-SNAPSHOT</Embedded-MontiArc-Math.version>
<Embedded-MontiArc-Dynamics.version>0.2.12-SNAPSHOT</Embedded-MontiArc-Dynamics.version>
<Embedded-MontiArc-Behaviour.version>0.2.12-SNAPSHOT</Embedded-MontiArc-Behaviour.version>
<Math.version>0.2.12-SNAPSHOT</Math.version>
<MathOpt.version>0.2.12-SNAPSHOT</MathOpt.version>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>5.0.1</monticore.version>
<se-commons.version>1.7.8</se-commons.version>
<mc.grammars.assembly.version>0.0.6</mc.grammars.assembly.version>
<Common-MontiCar.version>0.0.19-SNAPSHOT</Common-MontiCar.version>
<Embedded-MontiArc.version>0.1.9-SNAPSHOT</Embedded-MontiArc.version>
<Embedded-MontiArc-Math.version>0.1.9-SNAPSHOT</Embedded-MontiArc-Math.version>
<Embedded-MontiArc-Behaviour.version>0.0.16-SNAPSHOT</Embedded-MontiArc-Behaviour.version>
<CNNArch.version>0.3.7-SNAPSHOT</CNNArch.version>
<Math.version>0.0.19-SNAPSHOT</Math.version>
<MathOpt.version>0.1.1-SNAPSHOT</MathOpt.version>
<embedded-montiarc-dynamics.version>0.0.4-SNAPSHOT</embedded-montiarc-dynamics.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
<guava.version>25.1-jre</guava.version>
<junit.version>4.13.1</junit.version>
<logback.version>1.1.2</logback.version>
<jscience.version>4.3.1</jscience.version>
<commons-io.version>2.6</commons-io.version>
......@@ -225,13 +219,13 @@
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-dynamics</artifactId>
<version>${embedded-montiarc-dynamics.version}</version>
<version>${Embedded-MontiArc-Dynamics.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-dynamics</artifactId>
<version>${embedded-montiarc-dynamics.version}</version>
<version>${Embedded-MontiArc-Dynamics.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
......@@ -433,7 +427,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>
......
/**
* (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.monticar.emadl._symboltable;
......@@ -29,23 +23,30 @@ public class ModifiedExpandedComponentInstanceBuilder extends EMAComponentInstan
@Override
public EMAComponentInstanceSymbol build() {
EMAComponentInstanceSymbol instance = super.build();
EMAComponentSymbol component = instance.getComponentType().getReferencedSymbol();
Optional<ArchitectureSymbol> architecture = component.getSpannedScope()
Optional<ArchitectureSymbol> architecture = instance.getSpannedScope()
.resolve("", ArchitectureSymbol.KIND);
if (architecture.isPresent()){
// Need to be done after parameter exchange, so after build
if (architecture.isPresent())
addArchitectureParameterSymbolsToInstance(instance);
return instance;
}
addPortArraySymbolsToInstance(instance);
addParameterSymbolsToInstance(instance);
@Override protected void addOtherToComponentInstance(EMAComponentInstanceSymbol sym) {
EMAComponentSymbol component = sym.getComponentType().getReferencedSymbol();
Optional<ArchitectureSymbol> architecture = component.getSpannedScope()
.resolve("", ArchitectureSymbol.KIND);
if (architecture.isPresent()){
ArchitectureSymbol architectureInstance = architecture.get()
.preResolveDeepCopy(instance.getSpannedScope());
instance.getSpannedScope().getAsMutableScope().add(architectureInstance);
.preResolveDeepCopy(sym.getSpannedScope());
sym.getSpannedScope().getAsMutableScope().add(architectureInstance);
}
return instance;
}
public void addParameterSymbolsToInstance(EMAComponentInstanceSymbol instance){
public void addArchitectureParameterSymbolsToInstance(EMAComponentInstanceSymbol instance){
//add generics
for (ResolutionDeclarationSymbol sym : instance.getResolutionDeclarationSymbols()){
if (sym.getASTResolution() instanceof ASTUnitNumberResolution){
......@@ -87,24 +88,4 @@ public class ModifiedExpandedComponentInstanceBuilder extends EMAComponentInstan
}
}
public void addPortArraySymbolsToInstance(EMAComponentInstanceSymbol instance){
Map<String, List<EMAPortInstanceSymbol>> nameToPortList = new HashMap<>();
for (EMAPortInstanceSymbol port : instance.getPortInstanceList()){
List<EMAPortInstanceSymbol> list = nameToPortList
.computeIfAbsent(port.getNameWithoutArrayBracketPart(), k -> new ArrayList<>());
list.add(port);
}
for (String name : nameToPortList.keySet()){
if (!instance.getSpannedScope().resolveLocally(name, EMAPortArraySymbol.KIND).isPresent()) {
List<EMAPortInstanceSymbol> ports = nameToPortList.get(name);
EMAPortArraySymbol portArray = new EMAPortArraySymbol(name, null);
portArray.setDimension(ports.size());
portArray.setDirection(ports.get(0).isIncoming());
portArray.setTypeReference(ports.get(0).getTypeReference());
instance.getSpannedScope().getAsMutableScope().add(portArray);
}
}
}
}
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