Aufgrund von Umarbeiten des s3 Storage wird es in GitLab, in nächster Zeit, mögliche Performance-Einbußen geben. Näheres dazu unter: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/43/show_ticket/6670

Commit 6b5607b0 authored by Malte Heithoff's avatar Malte Heithoff

Update instance structure building

parent ed7962be
......@@ -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