Commit f4f67d74 authored by Alexander David Hellwig's avatar Alexander David Hellwig Committed by Evgeny Kusmenko
Browse files

Version up

parent be909e68
......@@ -30,7 +30,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-deeplearning</artifactId>
<version>0.2.3</version>
<version>0.2.4</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......@@ -41,19 +41,20 @@
<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.14-20180704.113055-2</Common-MontiCar.version>
<Embedded-MontiArc.version>0.0.18-20180615.111713-1</Embedded-MontiArc.version>
<Embedded-MontiArc-Math.version>0.0.19-20180718.152548-1</Embedded-MontiArc-Math.version>
<Embedded-MontiArc-MathOpt.version>0.1.1</Embedded-MontiArc-MathOpt.version>
<Embedded-MontiArc-Behaviour.version>0.0.14-20180704.112922-2</Embedded-MontiArc-Behaviour.version>
<Embedded-MontiArc.version>0.1.7-SNAPSHOT</Embedded-MontiArc.version>
<Embedded-MontiArc-Math.version>0.1.4-SNAPSHOT</Embedded-MontiArc-Math.version>
<Embedded-MontiArc-MathOpt.version>0.1.3-SNAPSHOT</Embedded-MontiArc-MathOpt.version>
<Embedded-MontiArc-Behaviour.version>0.0.15-SNAPSHOT</Embedded-MontiArc-Behaviour.version>
<CNNArch.version>0.2.7</CNNArch.version>
<Math.version>0.0.19-20180727.084044-1</Math.version>
<MathOpt.version>0.1.0</MathOpt.version>
<Math.version>0.0.19-SNAPSHOT</Math.version>
<MathOpt.version>0.1.1-SNAPSHOT</MathOpt.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
<logback.version>1.1.2</logback.version>
<jscience.version>4.3.1</jscience.version>
<commons-io.version>2.6</commons-io.version>
<!-- .. Plugins ....................................................... -->
<monticore.plugin>5.0.1</monticore.plugin>
......@@ -75,6 +76,12 @@
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
......@@ -88,6 +95,12 @@
<version>${se-commons.version}</version>
</dependency>
<dependency>
<groupId>de.se_rwth.commons</groupId>
<artifactId>se-commons-utilities</artifactId>
<version>${se-commons.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
......@@ -423,6 +436,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
......
......@@ -20,13 +20,13 @@
*/
package de.monticore.lang.monticar.emadl._cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.cnnarch._cocos.CNNArchCocos;
import de.monticore.lang.monticar.cnnarch._symboltable.ArchitectureSymbol;
public class CheckArchitecture{
public static void check(ExpandedComponentInstanceSymbol instance) {
public static void check(EMAComponentInstanceSymbol instance) {
ArchitectureSymbol architecture = instance.getSpannedScope().
<ArchitectureSymbol>resolve("", ArchitectureSymbol.KIND).get();
CNNArchCocos.checkAll(architecture);
......
......@@ -21,7 +21,7 @@
package de.monticore.lang.monticar.emadl._cocos;
import de.monticore.lang.embeddedmontiarc.cocos.*;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath.cocos.AtomicComponentCoCo;
import de.monticore.lang.math._cocos.MatrixAssignmentDeclarationCheck;
import de.monticore.lang.monticar.cnnarch._cocos.CNNArchCocos;
......@@ -32,7 +32,7 @@ import java.util.Optional;
//check all cocos
public class EMADLCocos {
public static void checkAll(ExpandedComponentInstanceSymbol instance){
public static void checkAll(EMAComponentInstanceSymbol instance){
Optional<ArchitectureSymbol> architecture = instance.getSpannedScope().
resolve("", ArchitectureSymbol.KIND);
......
......@@ -21,8 +21,8 @@
package de.monticore.lang.monticar.emadl._symboltable;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTEMACompilationUnit;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EmbeddedMontiArcSymbolTableCreator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.symboltable.MutableScope;
import de.monticore.symboltable.ResolvingConfiguration;
import de.se_rwth.commons.logging.Log;
......@@ -50,7 +50,7 @@ public class ModifiedEMASymbolTableCreator extends EmbeddedMontiArcSymbolTableCr
this.removeCurrentScope();
if (!this.aboartVisitComponent) {
Log.debug("endVisit of " + node.getComponent().getSymbolOpt().get().getFullName(), "SymbolTableCreator:");
getInstanceSymbolCreator().createInstances((ComponentSymbol)(Log.errorIfNull(node.getComponent().getSymbolOpt().orElse(null))));
getInstanceSymbolCreator().createInstances((EMAComponentSymbol)(Log.errorIfNull(node.getComponent().getSymbolOpt().orElse(null))),node.getComponent().getSymbolOpt().get().getName());
}
}
......
......@@ -20,7 +20,11 @@
*/
package de.monticore.lang.monticar.emadl._symboltable;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.*;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortArraySymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceBuilder;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAPortInstanceSymbol;
import de.monticore.lang.math._ast.ASTNumberExpression;
import de.monticore.lang.monticar.cnnarch._symboltable.ArchSimpleExpressionSymbol;
import de.monticore.lang.monticar.cnnarch._symboltable.ArchitectureSymbol;
......@@ -33,12 +37,12 @@ import de.se_rwth.commons.logging.Log;
import java.util.*;
public class ModifiedExpandedComponentInstanceBuilder extends ExpandedComponentInstanceBuilder {
public class ModifiedExpandedComponentInstanceBuilder extends EMAComponentInstanceBuilder {
@Override
public ExpandedComponentInstanceSymbol build() {
ExpandedComponentInstanceSymbol instance = super.build();
ComponentSymbol component = instance.getComponentType().getReferencedSymbol();
public EMAComponentInstanceSymbol build() {
EMAComponentInstanceSymbol instance = super.build();
EMAComponentSymbol component = instance.getComponentType().getReferencedSymbol();
Optional<ArchitectureSymbol> architecture = component.getSpannedScope()
.resolve("", ArchitectureSymbol.KIND);
......@@ -54,7 +58,7 @@ public class ModifiedExpandedComponentInstanceBuilder extends ExpandedComponentI
return instance;
}
public void addVariableSymbolsToInstance(ExpandedComponentInstanceSymbol instance){
public void addVariableSymbolsToInstance(EMAComponentInstanceSymbol instance){
//add generics
for (ResolutionDeclarationSymbol sym : instance.getResolutionDeclarationSymbols()){
if (sym.getASTResolution() instanceof ASTUnitNumberResolution){
......@@ -96,18 +100,18 @@ public class ModifiedExpandedComponentInstanceBuilder extends ExpandedComponentI
}
}
public void addPortArraySymbolsToInstance(ExpandedComponentInstanceSymbol instance){
Map<String, List<PortSymbol>> nameToPortList = new HashMap<>();
for (PortSymbol port : instance.getPortsList()){
List<PortSymbol> list = nameToPortList
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, PortArraySymbol.KIND).isPresent()) {
List<PortSymbol> ports = nameToPortList.get(name);
PortArraySymbol portArray = new PortArraySymbol(name, null);
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());
......
......@@ -20,7 +20,12 @@
*/
package de.monticore.lang.monticar.emadl._symboltable;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.*;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.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.instanceStructure.EMAComponentInstanceBuilder;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbolCreator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.monticore.symboltable.Symbol;
import de.monticore.symboltable.resolving.ResolvingFilter;
......@@ -29,26 +34,26 @@ import de.se_rwth.commons.logging.Log;
import java.util.List;
import java.util.Set;
public class ModifiedExpandedInstanceSymbolCreator extends EmbeddedMontiArcExpandedComponentInstanceSymbolCreator {
public class ModifiedExpandedInstanceSymbolCreator extends EMAComponentInstanceSymbolCreator {
@Override
protected ExpandedComponentInstanceBuilder createInstance(ComponentSymbol cmp, Set<ResolvingFilter<? extends Symbol>> filters, List<ResolutionDeclarationSymbol> resolutionDeclarationSymbols) {
protected EMAComponentInstanceBuilder createInstance(EMAComponentSymbol cmp, Set<ResolvingFilter<? extends Symbol>> filters, List<ResolutionDeclarationSymbol> resolutionDeclarationSymbols, String packageName) {
ModifiedExpandedComponentInstanceBuilder builder = new ModifiedExpandedComponentInstanceBuilder();
builder.setPackageName(packageName);
//everything below is copied from super class
builder.setSymbolReference(new ComponentSymbolReference(cmp.getName(), cmp.getEnclosingScope()))
builder.setSymbolReference(new EMAComponentSymbolReference(cmp.getName(), cmp.getEnclosingScope()))
.addPorts(cmp.getPortsList())
.addConnectors(cmp.getConnectors()).addResolutionDeclarationSymbols(cmp.getResolutionDeclarationSymbols()).addParameters(cmp.getParameters()).addArguments(cmp.getArguments());
for (ConnectorSymbol connectorSymbol : cmp.getConnectors())
for (EMAConnectorSymbol connectorSymbol : cmp.getConnectors())
Log.info(connectorSymbol.toString(), "Building Connector:");
// add sub components
for (ComponentInstanceSymbol inst : cmp.getSubComponents()) {
for (EMAComponentInstantiationSymbol inst : cmp.getSubComponents()) {
// System.err.println("would create now: " + inst.getName() + "[" + inst.getComponentType().getFullName() + "]");
Log.info(inst.getComponentType().getReferencedSymbol().howManyResolutionDeclarationSymbol() + "", "Important:");
Log.debug(inst.toString(), "ComponentInstance CreateInstance PreSub");
builder.addSubComponent(
createInstance(inst.getComponentType(), filters, inst.getComponentType().getReferencedSymbol().getResolutionDeclarationSymbols())
createInstance(inst.getComponentType(), filters, inst.getComponentType().getReferencedSymbol().getResolutionDeclarationSymbols(), packageName)
.setName(inst.getName())
.addActualTypeArguments(inst.getComponentType().getFormalTypeParameters(),
inst.getComponentType().getActualTypeArguments()).addResolvingFilters(filters).addResolutionDeclarationSymbols(inst.getComponentType().getResolutionDeclarationSymbols()).addParameters(inst.getComponentType().getReferencedSymbol().getParameters()).addArguments(inst.getComponentType().getReferencedSymbol().getArguments()).build());
......@@ -58,7 +63,7 @@ public class ModifiedExpandedInstanceSymbolCreator extends EmbeddedMontiArcExpan
}
// add inherited ports and sub components
for (ComponentSymbol superCmp = cmp;
for (EMAComponentSymbol superCmp = cmp;
superCmp.getSuperComponent().isPresent();
superCmp = superCmp.getSuperComponent().get()) {
......@@ -79,7 +84,7 @@ public class ModifiedExpandedInstanceSymbolCreator extends EmbeddedMontiArcExpan
//Log.debug(superCmp.toString(), "superCmp pre lambda");
superCmp.getSuperComponent().get().getSubComponents().stream().forEachOrdered(
inst -> builder.addSubComponentIfNameDoesNotExists(
createInstance(inst.getComponentType(), filters, null).setName(inst.getName())
createInstance(inst.getComponentType(), filters, null, packageName).setName(inst.getName())
.addActualTypeArguments(inst.getComponentType().getFormalTypeParameters(),
inst.getComponentType().getActualTypeArguments())
.addResolvingFilters(filters).addResolutionDeclarationSymbols(inst.getComponentType().getReferencedSymbol().getResolutionDeclarationSymbols()).addParameters(inst.getComponentType().getReferencedSymbol().getParameters()).build())
......@@ -93,7 +98,7 @@ public class ModifiedExpandedInstanceSymbolCreator extends EmbeddedMontiArcExpan
}
@Override
public void createInstances(ComponentSymbol topComponent) {
super.createInstances(topComponent);
public void createInstances(EMAComponentSymbol topComponent, String instanceName) {
super.createInstances(topComponent,instanceName.substring(0,1).toLowerCase() + instanceName.substring(1));
}
}
......@@ -22,7 +22,7 @@ package de.monticore.lang.monticar.emadl.adapter;
import de.monticore.ast.ASTNode;
import de.monticore.expressionsbasis._ast.ASTExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.PortArraySymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortArraySymbol;
import de.monticore.lang.math._ast.ASTNameExpression;
import de.monticore.lang.math._ast.ASTNumberExpression;
import de.monticore.lang.monticar.cnnarch._symboltable.ArchSimpleExpressionSymbol;
......@@ -42,11 +42,11 @@ import java.util.List;
import java.util.Optional;
public class PortArraySymbol2IODeclarationSymbol extends IODeclarationSymbol
implements SymbolAdapter<PortArraySymbol> {
implements SymbolAdapter<EMAPortArraySymbol> {
private final PortArraySymbol adaptee;
private final EMAPortArraySymbol adaptee;
public PortArraySymbol2IODeclarationSymbol(PortArraySymbol ps) {
public PortArraySymbol2IODeclarationSymbol(EMAPortArraySymbol ps) {
super(ps.getName());
setInput(ps.isIncoming());
setArrayLength(ps.getDimension());
......@@ -71,12 +71,12 @@ public class PortArraySymbol2IODeclarationSymbol extends IODeclarationSymbol
}
@Override
public PortArraySymbol getAdaptee() {
public EMAPortArraySymbol getAdaptee() {
return adaptee;
}
private ASTType getASTType(PortArraySymbol port){
private ASTType getASTType(EMAPortArraySymbol port){
MCTypeSymbol type = port.getTypeReference().getReferencedSymbol();
if (type instanceof MCASTTypeSymbol){
return ((MCASTTypeSymbol) type).getAstType();
......@@ -86,7 +86,7 @@ public class PortArraySymbol2IODeclarationSymbol extends IODeclarationSymbol
}
}
private List<ArchSimpleExpressionSymbol> getShape(PortArraySymbol port){
private List<ArchSimpleExpressionSymbol> getShape(EMAPortArraySymbol port){
List<ArchSimpleExpressionSymbol> dimensionList = new ArrayList<>(4);
ASTType astType = getASTType(port);
......@@ -109,7 +109,7 @@ public class PortArraySymbol2IODeclarationSymbol extends IODeclarationSymbol
return dimensionList;
}
private ASTElementType getElementType(PortArraySymbol port){
private ASTElementType getElementType(EMAPortArraySymbol port){
ASTType astType = getASTType(port);
if (astType instanceof ASTCommonMatrixType){
return ((ASTCommonMatrixType) astType).getElementType();
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.emadl.adapter;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.PortArraySymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortArraySymbol;
import de.monticore.lang.monticar.cnnarch._symboltable.IODeclarationSymbol;
import de.monticore.symboltable.Symbol;
import de.monticore.symboltable.resolving.TransitiveAdaptedResolvingFilter;
......@@ -28,14 +28,14 @@ import de.monticore.symboltable.resolving.TransitiveAdaptedResolvingFilter;
public class PortArraySymbol2IODeclarationSymbolTypeFilter extends TransitiveAdaptedResolvingFilter<IODeclarationSymbol> {
public PortArraySymbol2IODeclarationSymbolTypeFilter() {
super(PortArraySymbol.KIND,
super(EMAPortArraySymbol.KIND,
IODeclarationSymbol.class,
IODeclarationSymbol.KIND);
}
@Override
public Symbol translate(Symbol adaptee) {
assert adaptee instanceof PortArraySymbol;
return new PortArraySymbol2IODeclarationSymbol((PortArraySymbol) adaptee);
assert adaptee instanceof EMAPortArraySymbol;
return new PortArraySymbol2IODeclarationSymbol((EMAPortArraySymbol) adaptee);
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@ package de.monticore.lang.monticar.emadl;
import de.monticore.ModelingLanguageFamily;
import de.monticore.io.paths.ModelPath;
import de.monticore.lang.embeddedmontiarc.LogConfig;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ConstantPortSymbol;
import de.monticore.lang.embeddedmontiarc.helper.ConstantPortHelper;
import de.monticore.lang.monticar.emadl._symboltable.EMADLLanguage;
import de.monticore.lang.monticar.enumlang._symboltable.EnumLangLanguage;
import de.monticore.lang.monticar.streamunits._symboltable.StreamUnitsLanguage;
......@@ -35,7 +35,7 @@ import java.nio.file.Paths;
public class AbstractSymtabTest {
protected static Scope createSymTab(String... modelPath) {
ConstantPortSymbol.resetLastID();
ConstantPortHelper.resetLastID();
ModelingLanguageFamily fam = new ModelingLanguageFamily();
EMADLLanguage montiArcLanguage = new EMADLLanguage();
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.emadl;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.cnnarch._symboltable.ArchitectureSymbol;
import de.monticore.lang.monticar.cnnarch._symboltable.CompositeElementSymbol;
import de.monticore.lang.monticar.cnnarch._symboltable.LayerSymbol;
......@@ -44,12 +44,15 @@ public class InstanceTest extends AbstractSymtabTest {
@Test
public void testInstances(){
Scope symtab = createSymTab("src/test/resources/models/");
ExpandedComponentInstanceSymbol mainInstance = symtab.<ExpandedComponentInstanceSymbol>
resolve("InstanceTest.mainB", ExpandedComponentInstanceSymbol.KIND).get();
ExpandedComponentInstanceSymbol net1 = mainInstance.getSpannedScope().<ExpandedComponentInstanceSymbol>
resolve("net1", ExpandedComponentInstanceSymbol.KIND).get();
ExpandedComponentInstanceSymbol net2 = mainInstance.getSpannedScope().<ExpandedComponentInstanceSymbol>
resolve("net2", ExpandedComponentInstanceSymbol.KIND).get();
EMAComponentInstanceSymbol mainInstance = symtab.<EMAComponentInstanceSymbol>
resolve("InstanceTest.mainB", EMAComponentInstanceSymbol.KIND).get();
EMAComponentInstanceSymbol net1 = mainInstance.getSpannedScope().<EMAComponentInstanceSymbol>
resolve("net1", EMAComponentInstanceSymbol.KIND).get();
EMAComponentInstanceSymbol net2 = mainInstance.getSpannedScope().<EMAComponentInstanceSymbol>
resolve("net2", EMAComponentInstanceSymbol.KIND).get();
assertEquals("InstanceTest.mainB.net1",net1.getFullName());
assertEquals("InstanceTest.mainB.net2",net2.getFullName());
ArchitectureSymbol arch1 = net1.getSpannedScope().<ArchitectureSymbol>
resolve("", ArchitectureSymbol.KIND).get();
......
......@@ -20,8 +20,8 @@
*/
package de.monticore.lang.monticar.emadl;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.emadl._parser.EMADLParser;
import de.monticore.symboltable.Scope;
import de.se_rwth.commons.logging.Log;
......@@ -50,8 +50,8 @@ public class SymtabTest extends AbstractSymtabTest {
@Test
public void testAlexnet(){
Scope symTab = createSymTab("src/test/resources/models");
ComponentSymbol a = symTab.<ComponentSymbol>resolve("ResNet34", ComponentSymbol.KIND).orElse(null);
ExpandedComponentInstanceSymbol c = symTab.<ExpandedComponentInstanceSymbol>resolve("resNet34", ExpandedComponentInstanceSymbol.KIND).orElse(null);
EMAComponentSymbol a = symTab.<EMAComponentSymbol>resolve("ResNet34", EMAComponentSymbol.KIND).orElse(null);
EMAComponentInstanceSymbol c = symTab.<EMAComponentInstanceSymbol>resolve("resNet34", EMAComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(a);
}
......
......@@ -20,8 +20,8 @@
*/
package de.monticore.lang.monticar.emadl.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.emadl.AbstractSymtabTest;
import de.monticore.lang.monticar.emadl._cocos.EMADLCocos;
import de.monticore.symboltable.Scope;
......@@ -44,15 +44,15 @@ public class AbstractCoCoTest extends AbstractSymtabTest {
private static final String MODEL_PATH = "src/test/resources/";
protected static ExpandedComponentInstanceSymbol getComponentInstance(String modelPath, String model) {
protected static EMAComponentInstanceSymbol getComponentInstance(String modelPath, String model) {
Scope symTab = createSymTab(MODEL_PATH + modelPath);
ComponentSymbol comp = symTab.<ComponentSymbol> resolve(
model, ComponentSymbol.KIND).orElse(null);
EMAComponentSymbol comp = symTab.<EMAComponentSymbol> resolve(
model, EMAComponentSymbol.KIND).orElse(null);
assertNotNull("Could not resolve model " + model, comp);
return (ExpandedComponentInstanceSymbol) comp.getEnclosingScope()
.resolveLocally(ExpandedComponentInstanceSymbol.KIND)
return (EMAComponentInstanceSymbol) comp.getEnclosingScope()
.resolveLocally(EMAComponentInstanceSymbol.KIND)
.stream().findFirst().get();
}
......
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