Commit 86abd069 authored by Malte Heithoff's avatar Malte Heithoff
Browse files

Initial Try to Update to MC 6

parent 88e60370
Pipeline #347587 failed with stage
in 16 seconds
......@@ -10,7 +10,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc</artifactId>
<version>0.2.12-SNAPSHOT</version>
<version>6.5.0-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......@@ -18,15 +18,16 @@
<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>
<struct.version>6.5.0-SNAPSHOT</struct.version>
<Common-MontiCar.version>6.5.0-SNAPSHOT</Common-MontiCar.version>
<tagging.version>6.5.0-SNAPSHOT</tagging.version>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>5.0.0</monticore.version>
<monticore.version>6.5.0-SNAPSHOT</monticore.version>
<siunits.version>6.5.0-SNAPSHOT</siunits.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>
<!-- .. Libraries .................................................. -->
<guava.version>25.1-jre</guava.version>
<junit.version>4.13.1</junit.version>
......@@ -34,7 +35,6 @@
<jscience.version>4.3.1</jscience.version>
<jsr305.version>3.0.0</jsr305.version>
<!-- .. Plugins ....................................................... -->
<monticore.plugin>5.0.0</monticore.plugin>
<assembly.plugin>2.5.4</assembly.plugin>
<compiler.plugin>3.3</compiler.plugin>
<source.plugin>2.4</source.plugin>
......@@ -114,6 +114,14 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>siunits</artifactId>
<version>${siunits.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
......@@ -183,7 +191,7 @@
<plugin>
<groupId>de.monticore.mojo</groupId>
<artifactId>monticore-maven-plugin</artifactId>
<version>${monticore.plugin}</version>
<version>${monticore.version}</version>
<configuration>
<skip>false</skip>
<script>de/monticore/monticore_noemf.groovy</script>
......@@ -274,32 +282,32 @@
</executions>
</plugin>
<!-- to add copyright information automatically-->
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<header>${project.baseUri}/src/license/se/license.txt</header>
<properties>
<owner>Michael von Wenckstern</owner>
<email>vonwenckstern@se-rwth.de</email>
</properties>
<excludes>
<exclude>**/README</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>src/license/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
<phase>process-sources</phase>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>com.mycila</groupId>-->
<!-- <artifactId>license-maven-plugin</artifactId>-->
<!-- <version>3.0</version>-->
<!-- <configuration>-->
<!-- <header>${project.baseUri}/src/license/se/license.txt</header>-->
<!-- <properties>-->
<!-- <owner>Michael von Wenckstern</owner>-->
<!-- <email>vonwenckstern@se-rwth.de</email>-->
<!-- </properties>-->
<!-- <excludes>-->
<!-- <exclude>**/README</exclude>-->
<!-- <exclude>src/test/resources/**</exclude>-->
<!-- <exclude>src/main/resources/**</exclude>-->
<!-- <exclude>src/license/**</exclude>-->
<!-- </excludes>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>format</goal>-->
<!-- </goals>-->
<!-- <phase>process-sources</phase>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
......
......@@ -6,7 +6,8 @@ package de.monticore.lang.embeddedmontiarc;
* Grammar for EmbeddedMontiArc.
*
*/
grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2,
de.monticore.lang.monticar.Stream {
/** ASTEMACompilationUnit represents the complete component
* @attribute package The package declaration of this component
......@@ -14,9 +15,9 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
* @attribute Component the root component of the component
*/
EMACompilationUnit =
("package" package:(Name& || ".")+ ";")?
(ImportStatement )*
Component;
MCPackageDeclaration?
MCImportStatement*
EMAComponent;
/* ======================================================*/
......@@ -28,7 +29,7 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
* This interface may be used as an extension point to
* enrich components with further elements.
*/
interface Element;
interface EMAElement;
/**
......@@ -63,14 +64,17 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
* component
*/
symbol scope Component implements Element =
symbol scope EMAComponent implements EMAElement =
"component" (["interface"])? Name
//("component" | ["component_interface"]) Name
genericTypeParameters:TypeParameters2?
GenericTypeParameters?
( "(" (Parameter || ",")+ ")" )?
("implements" superComponent:ReferenceType)?
("implements" superComponent:MCQualifiedType)?
body:ComponentBody;
GenericTypeParameters =
"<" ResolutionDeclaration ">";
/**
* The body contains architectural elements of
......@@ -80,7 +84,7 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
*/
ComponentBody =
("{"
Element*
EMAElement*
"}" );
/**
......@@ -89,9 +93,9 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
* @attribute ports a list of ports that are contained in
* this interface
*/
Interface implements Element =
Interface implements EMAElement =
("port"|"ports")
ports:(Port || ",")+ ";" ;
ports:(EMAPort || ",")+ ";" ;
/**a
* An incoming port is used to receive messages, an
......@@ -106,9 +110,9 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
/**might support auto type adding based on last previous type
* declaration later on
*/
Port =
symbol EMAPort =
AdaptableKeyword? (incoming:["in"] | outgoing:["out"])
Type (Name? | Name ( "[" UnitNumberResolution "]" )?) ;
MCType (Name? | Name ( "[" UnitNumberResolution "]" )?) ;
/**
......@@ -122,9 +126,9 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
* @attribute instances list of instances that should be
* created
*/
SubComponent implements Element =
SubComponent implements EMAElement =
"instance"
type:ReferenceType
type:MCQualifiedType
("(" arguments:(Expression || ",")+ ")" )?
instances:(SubComponentInstance || ",")* ";" ;
......@@ -165,7 +169,7 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
* @attribute targets a list of target ports or component
* instance names
*/
Connector implements Element=
symbol EMAConnector implements EMAElement=
"connect" (source:QualifiedNameWithArrayAndStar |
boolLiteral:BooleanLiteral |
stringLiteral:StringLiteral|
......@@ -174,7 +178,19 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
ConnectorTargets = ["#"] | // route symbol terminates inputs
(QualifiedNameWithArrayAndStar || "," )+;
symbol scope EMAComponentInstance;
symbol EMAPortInstance;
symbol EMAPortArray;
symbol EMAConnectorInstance;
interface symbol EMAComponentImplementation;
symbol scope EMAComponentInstantiation;
// autoconnect and autoinstantiate is removed
// for autoconnect use "connect this.* -> sub1.*;" to connect all inports of the parent component to the inports of the sub1 subcomponent having the same name
}
/* (c) https://github.com/MontiCore/monticore */
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc;
import de.monticore.lang.embeddedmontiarc.helper.AutoconnectMode;
......
......@@ -3,8 +3,8 @@ package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTComponentCoCo;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.se_rwth.commons.logging.Log;
import java.util.Collection;
......
/* (c) https://github.com/MontiCore/monticore */
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.monticar.common2._ast.ASTParameter;
......
/* (c) https://github.com/MontiCore/monticore */
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTConnectorCoCo;
......
......@@ -3,8 +3,8 @@ package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTComponentCoCo;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.ros.RosConnectionSymbol;
import de.monticore.symboltable.Symbol;
import de.monticore.symboltable.resolving.ResolvedSeveralEntriesException;
......
......@@ -3,7 +3,7 @@ package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTPort;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTPortCoCo;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAPortSymbol;
import de.monticore.symboltable.Symbol;
import de.se_rwth.commons.logging.Log;
......
/* (c) https://github.com/MontiCore/monticore */
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.monticar.common2._ast.ASTParameter;
......
......@@ -3,9 +3,9 @@ package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTComponentCoCo;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConnectorSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAConnectorSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAPortSymbol;
import de.se_rwth.commons.logging.Log;
import java.util.Collection;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.helper.ArcTypePrinter;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTSubComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTSubComponentCoCo;
......
......@@ -3,11 +3,11 @@ package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTComponentCoCo;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbolReference;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConnectorSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAConnectorSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentInstantiationSymbol;
import de.se_rwth.commons.logging.Log;
import java.util.Optional;
......
......@@ -3,10 +3,10 @@ package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTComponentCoCo;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConnectorSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAConnectorSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAPortSymbol;
import de.se_rwth.commons.logging.Log;
import java.util.Collection;
......
/* (c) https://github.com/MontiCore/monticore */
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
......
/* (c) https://github.com/MontiCore/monticore */
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.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;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast;
import de.monticore.lang.monticar.common2._ast.ASTParameter;
import de.monticore.types.types._ast.ASTReferenceType;
import de.monticore.lang.monticar.types2._ast.ASTTypeParameters2;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* TODO: Write me!
*
*/
public class ASTComponent extends ASTComponentTOP {
public ASTComponent() {
super();
}
public ASTComponent(String name, Optional<ASTTypeParameters2> genericTypeParameters, List<ASTParameter> parameters, Optional<ASTReferenceType> superComponent, ASTComponentBody body, boolean r__interface) {
super(name, genericTypeParameters, parameters, superComponent, body, r__interface);
}
// do not use symbol table, since symbol table must not be created
public List<ASTPort> getPortsList() {
List<ASTPort> ret = new ArrayList<>();
for (ASTElement element : this.getBody().getElementList()) {
if (element instanceof ASTInterface) {
ret.addAll(((ASTInterface) element).getPortsList());
}
}
return ret;
}
// do not use symbol table, since symbol table must not be created
public List<ASTConnector> getConnectors() {
return this.getBody().getElementList().stream().filter(a -> a instanceof ASTConnector).
map(a -> (ASTConnector) a).collect(Collectors.toList());
}
// do not use symbol table, since symbol table must not be created
public List<ASTSubComponent> getSubComponents() {
return this.getBody().getElementList().stream().filter(a -> a instanceof ASTSubComponent).
map(a -> (ASTSubComponent) a).collect(Collectors.toList());
}
// do not use symbol table, since symbol table must not be created
public List<ASTComponent> getInnerComponents() {
return this.getBody().getElementList().stream().filter(a -> a instanceof ASTComponent).
map(a -> (ASTComponent) a).collect(Collectors.toList());
}
}
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast;
import de.monticore.lang.monticar.common2._ast.ASTParameter;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* TODO: Write me!
*
*/
public class ASTEMAComponent extends ASTEMAComponentTOP {
// do not use symbol table, since symbol table must not be created
public List<ASTEMAPort> getPortsList() {
List<ASTEMAPort> ret = new ArrayList<>();
for (ASTEMAElement element : this.getBody().getEMAElementList()) {
if (element instanceof ASTInterface) {
ret.addAll(((ASTInterface) element).getPortsList());
}
}
return ret;
}
// do not use symbol table, since symbol table must not be created
public List<ASTEMAConnector> getConnectors() {
return this.getBody().getEMAElementList().stream().filter(a -> a instanceof ASTEMAConnector).
map(a -> (ASTEMAConnector) a).collect(Collectors.toList());
}
// do not use symbol table, since symbol table must not be created
public List<ASTSubComponent> getSubComponents() {
return this.getBody().getEMAElementList().stream().filter(a -> a instanceof ASTSubComponent).
map(a -> (ASTSubComponent) a).collect(Collectors.toList());
}
// do not use symbol table, since symbol table must not be created
public List<ASTEMAComponent> getInnerComponents() {
return this.getBody().getEMAElementList().stream().filter(a -> a instanceof ASTEMAComponent).
map(a -> (ASTEMAComponent) a).collect(Collectors.toList());
}
}
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import de.monticore.types.types._ast.ASTTypeArgument;
import de.monticore.symboltable.types.TypeSymbol;
import de.monticore.symboltable.types.references.ActualTypeArgument;
import de.monticore.symboltable.types.references.TypeReference;
/**
*/
public class ActualTypeArgumentASTElement extends ActualTypeArgument {
ASTTypeArgument astTypeArguments;
public ActualTypeArgumentASTElement(boolean isLowerBound, boolean isUpperBound, TypeReference<? extends TypeSymbol> type) {
super(isLowerBound, isUpperBound, type);
}
public ActualTypeArgumentASTElement(TypeReference<? extends TypeSymbol> type) {
super(type);
}
public ASTTypeArgument getAstTypeArguments() {
return astTypeArguments;
}
public ActualTypeArgumentASTElement setAstTypeArguments(ASTTypeArgument astTypeArguments) {
this.astTypeArguments = astTypeArguments;
return this;
}
}
///**
// * (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.embeddedmontiarc._symboltable;
//
//import de.monticore.types.types._ast.ASTTypeArgument;
//import de.monticore.symboltable.types.TypeSymbol;
//import de.monticore.symboltable.types.references.ActualTypeArgument;
//import de.monticore.symboltable.types.references.TypeReference;
//
///**
// */
//public class ActualTypeArgumentASTElement extends ActualTypeArgument {
//
// ASTTypeArgument astTypeArguments;
//
// public ActualTypeArgumentASTElement(boolean isLowerBound, boolean isUpperBound, TypeReference<? extends TypeSymbol> type) {
// super(isLowerBound, isUpperBound, type);
// }
//
// public ActualTypeArgumentASTElement(TypeReference<? extends TypeSymbol> type) {
// super(type);
// }
//
// public ASTTypeArgument getAstTypeArguments() {
// return astTypeArguments;
// }
//
// public ActualTypeArgumentASTElement setAstTypeArguments(ASTTypeArgument astTypeArguments) {
// this.astTypeArguments = astTypeArguments;
// return this;
// }
//}