Commit fbba592f authored by Sascha Niklas Schneiders's avatar Sascha Niklas Schneiders
Browse files

cleanup

parent 1f0858a7
Pipeline #218404 failed with stage
in 2 minutes and 14 seconds
...@@ -29,7 +29,7 @@ import de.se_rwth.commons.logging.Log; ...@@ -29,7 +29,7 @@ import de.se_rwth.commons.logging.Log;
public class InRosPortRosSender implements EmbeddedMontiArcASTEMAComponentCoCo { public class InRosPortRosSender implements EmbeddedMontiArcASTEMAComponentCoCo {
//TODO IMPLEMENT ME!F //TODO IMPLEMENT ME!D
@Override @Override
public void check(ASTEMAComponent node) { public void check(ASTEMAComponent node) {
EMAComponentSymbol symbol = node.isPresentSymbol()?node.getSymbol():(null); EMAComponentSymbol symbol = node.isPresentSymbol()?node.getSymbol():(null);
......
...@@ -46,7 +46,7 @@ public class PortUsage implements EmbeddedMontiArcASTEMAComponentCoCo { ...@@ -46,7 +46,7 @@ public class PortUsage implements EmbeddedMontiArcASTEMAComponentCoCo {
return ports.stream().map(p -> p.getName()).collect(Collectors.toList()); return ports.stream().map(p -> p.getName()).collect(Collectors.toList());
} }
//TODO IMPLEMENT ME! //TODO IMPLEMENT ME!D
private Collection<String> getSourceNames(Collection<ASTEMAConnector> connectors) { private Collection<String> getSourceNames(Collection<ASTEMAConnector> connectors) {
return connectors.stream().map(c -> c.getSource().getQualifedNameAsString(true)).collect(Collectors.toList()); return connectors.stream().map(c -> c.getSource().getQualifedNameAsString(true)).collect(Collectors.toList());
} }
...@@ -99,7 +99,7 @@ public class PortUsage implements EmbeddedMontiArcASTEMAComponentCoCo { ...@@ -99,7 +99,7 @@ public class PortUsage implements EmbeddedMontiArcASTEMAComponentCoCo {
remainingPorts = getNames(entry.getOutgoingPorts()); remainingPorts = getNames(entry.getOutgoingPorts());
Collection<String> connectorTargets = getTargetNames(entry.getConnectors()); Collection<String> connectorTargets = getTargetNames(entry.getConnectors());
// add simple connectors of all subcomponents that might connect the ports. // add simple connectors of all subcomponents that might connect the ports.
//TODO IMPLEMENT ME! //TODO IMPLEMENT ME!D
entry.getSubComponents() entry.getSubComponents()
.forEach(sc -> connectorTargets.addAll(getTargetNames(sc.getConnectorInstances()))); .forEach(sc -> connectorTargets.addAll(getTargetNames(sc.getConnectorInstances())));
......
...@@ -21,10 +21,14 @@ ...@@ -21,10 +21,14 @@
package de.monticore.lang.embeddedmontiarc.cocos; package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTEMAComponent; import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTEMAComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTEMAConnector;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTEMAComponentCoCo; import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTEMAComponentCoCo;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentInstantiationSymbol; import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol; import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAComponentSymbolLoader;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMAPortSymbol;
import de.se_rwth.commons.logging.Log; import de.se_rwth.commons.logging.Log;
import java.util.Optional;
/** /**
* Implementation of R7 * Implementation of R7
...@@ -50,28 +54,28 @@ public class SimpleConnectorSourceExists implements EmbeddedMontiArcASTEMACompon ...@@ -50,28 +54,28 @@ public class SimpleConnectorSourceExists implements EmbeddedMontiArcASTEMACompon
} }
for (EMAComponentInstantiationSymbol instanceSymbol : symbol.getSubComponents()) { for (EMAComponentInstantiationSymbol instanceSymbol : symbol.getSubComponents()) {
//TODO IMPLEMENT ME! //TODO IMPLEMENT ME!D
/*for (ASTEMAConnector emaConnectorSymbol : instanceSymbol.getSimpleConnectors()) { for (ASTEMAConnector emaConnectorSymbol : instanceSymbol.getConnectors()) {
EMAComponentSymbolLoader typeReference = instanceSymbol.getComponentType(); EMAComponentSymbolLoader typeReference = instanceSymbol.getComponentType();
if (!typeReference.existsReferencedSymbol()) { if (!typeReference.isSymbolLoaded()) {
Log.error(String.format("0xBEA8B The component type \"%s\" can't be resolved.", Log.error(String.format("0xBEA8B The component type \"%s\" can't be resolved.",
typeReference.getFullName())); typeReference.getFullName()));
return; return;
} }
EMAComponentSymbol sourceComponent = typeReference.getLoadedSymbol(); EMAComponentSymbol sourceComponent = typeReference.getLoadedSymbol();
String sourcePort = emaConnectorSymbol.getSource(); String sourcePort = emaConnectorSymbol.getSource().getQualifedNameAsString(true);
Optional<EMAPortSymbol> outgoingPort = sourceComponent.getOutgoingPort(sourcePort); Optional<EMAPortSymbol> outgoingPort = sourceComponent.getOutgoingPort(sourcePort);
if (!outgoingPort.isPresent()) { if (!outgoingPort.isPresent()) {
Log.error(String.format("0xF4D71 Out port \"%s\" is not present in component \"%s\".", Log.error(String.format("0xF4D71 Out port \"%s\" is not present in component \"%s\".",
sourcePort, sourceComponent.getName()), sourcePort, sourceComponent.getName()),
emaConnectorSymbol.getSourcePosition()); emaConnectorSymbol.get_SourcePositionStart());
} }
}*/ }
} }
} }
......
...@@ -121,18 +121,18 @@ public class SubComponentsConnected implements EmbeddedMontiArcASTEMAComponentCo ...@@ -121,18 +121,18 @@ public class SubComponentsConnected implements EmbeddedMontiArcASTEMAComponentCo
Collection<String> outerConnectorSources = getSourceNames(entry.getConnectors()); Collection<String> outerConnectorSources = getSourceNames(entry.getConnectors());
remainingSubOut.removeAll(outerConnectorSources); remainingSubOut.removeAll(outerConnectorSources);
//TODO IMPLEMENT ME! //TODO IMPLEMENT ME!D
/*if (!remainingSubOut.isEmpty()) { if (!remainingSubOut.isEmpty()) {
// qualified sources of simple connectors // qualified sources of simple connectors
List<Object> outerSubSimpleConnectorSources = List<Object> outerSubSimpleConnectorSources =
entry.getSubComponents().stream().flatMap(sc -> sc.getSimpleConnectors().stream() entry.getSubComponents().stream().flatMap(sc -> sc.getConnectors().stream()
// map connector to qualified source name // map connector to qualified source name
.map(c -> sc.getName() + "." + c.getSource())).collect(Collectors.toList()); .map(c -> sc.getName() + "." + c.getSource())).collect(Collectors.toList());
remainingSubOut.removeAll(outerSubSimpleConnectorSources); remainingSubOut.removeAll(outerSubSimpleConnectorSources);
if (!remainingSubOut.isEmpty()) { if (!remainingSubOut.isEmpty()) {
remainingSubOut.forEach(p -> Log.error(String.format("0xAC009 Port %s of subcomponent " + "%s is not used!", p, sub.getFullName()), node.get_SourcePositionStart())); remainingSubOut.forEach(p -> Log.error(String.format("0xAC009 Port %s of subcomponent " + "%s is not used!", p, sub.getFullName()), node.get_SourcePositionStart()));
} }
}*/ }
} }
} }
......
/**
*
* ******************************************************************************
* MontiCAR Modeling Family, www.se-rwth.de
* Copyright (c) 2017, Software Engineering Group at RWTH Aachen,
* All rights reserved.
*
* This project is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast;
import external1.types._ast.ASTReferenceType;
/**
* @author Sascha Schneiders
*/
public class ASTEMAComponentInstantiation extends ASTEMAComponentInstantiationTOP {
protected ASTReferenceType type;
public ASTReferenceType getType() {
return type;
}
public void setType(ASTReferenceType type) {
this.type = type;
}
}
...@@ -72,7 +72,6 @@ public class ASTEMAConnector extends ASTEMAConnectorTOP { ...@@ -72,7 +72,6 @@ public class ASTEMAConnector extends ASTEMAConnectorTOP {
* shouldInflate to true * shouldInflate to true
*/ */
public Collection<String> getTargetsAsString(boolean shouldInflate) { public Collection<String> getTargetsAsString(boolean shouldInflate) {
//TODO IMPLEMENT ME!F handle shouldInflate? was handled by symbol table previously
List<String> targetNames = new ArrayList<>(); List<String> targetNames = new ArrayList<>();
for (ASTQualifiedNameWithArrayAndStar astQualifiedNameWithArrayAndStar : for (ASTQualifiedNameWithArrayAndStar astQualifiedNameWithArrayAndStar :
getTargets().getQualifiedNameWithArrayAndStarList()) { getTargets().getQualifiedNameWithArrayAndStarList()) {
...@@ -121,7 +120,7 @@ public class ASTEMAConnector extends ASTEMAConnectorTOP { ...@@ -121,7 +120,7 @@ public class ASTEMAConnector extends ASTEMAConnectorTOP {
} }
try { try {
if (name.equals( if (name.equals(
"#")) {// TODO IMPLEMENT ME!F Evgeny was not aware of this language feature when asked and looking into the test "#")) {// Evgeny was not aware of this language feature when asked and looking into the test
// that belongs to it, the comment in the test states that it is there to avoid a // that belongs to it, the comment in the test states that it is there to avoid a
// warning/coco that all ports have to be used in a component // warning/coco that all ports have to be used in a component
targets.qualifiedNameWithArrayAndStars targets.qualifiedNameWithArrayAndStars
......
...@@ -24,6 +24,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTEMAConnector; ...@@ -24,6 +24,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTEMAConnector;
import de.monticore.lang.embeddedmontiarc.helper.SymbolPrinter; import de.monticore.lang.embeddedmontiarc.helper.SymbolPrinter;
import de.monticore.lang.monticar.types2._symboltable.ITypes2Scope; import de.monticore.lang.monticar.types2._symboltable.ITypes2Scope;
import de.se_rwth.commons.logging.Log; import de.se_rwth.commons.logging.Log;
import external1.types._ast.ASTType;
import external1.types._symboltable.ResolvedTypeSymbol; import external1.types._symboltable.ResolvedTypeSymbol;
import java.util.Collection; import java.util.Collection;
...@@ -70,8 +71,7 @@ public class EMAComponentBuilder { ...@@ -70,8 +71,7 @@ public class EMAComponentBuilder {
} }
public static EMAComponentBuilder removePort(EMAComponentSymbol cs, EMAPortSymbol ps) { public static EMAComponentBuilder removePort(EMAComponentSymbol cs, EMAPortSymbol ps) {
//TODO IMPLEMENT ME!F (cs.getSpannedScope()).remove(ps);
//((Scope) cs.getSpannedScope()).remove(ps);
return getInstance(); return getInstance();
} }
...@@ -105,24 +105,6 @@ public class EMAComponentBuilder { ...@@ -105,24 +105,6 @@ public class EMAComponentBuilder {
return getInstance(); return getInstance();
} }
public static EMAComponentBuilder removeConnector(EMAComponentSymbol cs, ASTEMAConnector con) {
//TODO IMPLEMENT ME!F
//((Scope) cs.getSpannedScope()).remove(con);
return getInstance();
}
public static EMAComponentBuilder removeConnectors(EMAComponentSymbol cs, ASTEMAConnector... con) {
for (ASTEMAConnector c : con) {
removeConnector(cs, c);
}
return getInstance();
}
public static EMAComponentBuilder removeConnectors(EMAComponentSymbol cs, Collection<ASTEMAConnector> con) {
con.stream().forEachOrdered(c -> removeConnector(cs, c));
return getInstance();
}
////////////////////////// inner components ////////////////////////////////////////////// ////////////////////////// inner components //////////////////////////////////////////////
public static EMAComponentBuilder addInnerComponent(EMAComponentSymbol cs, EMAComponentSymbol innerComponent) { public static EMAComponentBuilder addInnerComponent(EMAComponentSymbol cs, EMAComponentSymbol innerComponent) {
...@@ -142,8 +124,7 @@ public class EMAComponentBuilder { ...@@ -142,8 +124,7 @@ public class EMAComponentBuilder {
} }
public static EMAComponentBuilder removeInnerComponent(EMAComponentSymbol cs, EMAComponentSymbol innerComponent) { public static EMAComponentBuilder removeInnerComponent(EMAComponentSymbol cs, EMAComponentSymbol innerComponent) {
//TODO IMPLEMENT ME!F ( cs.getSpannedScope()).remove(innerComponent);
//((Scope) cs.getSpannedScope()).remove(innerComponent);
return getInstance(); return getInstance();
} }
...@@ -162,23 +143,22 @@ public class EMAComponentBuilder { ...@@ -162,23 +143,22 @@ public class EMAComponentBuilder {
////////////////////////// formal type parameters ////////////////////////////////////////////// ////////////////////////// formal type parameters //////////////////////////////////////////////
public static EMAComponentBuilder addFormalTypeParameter(EMAComponentSymbol cs, public static EMAComponentBuilder addFormalTypeParameter(EMAComponentSymbol cs,
ResolvedTypeSymbol formalTypeParameter) { ASTType formalTypeParameter) {
if (!formalTypeParameter.getAstNode().isFormalTypeParameter()) { if (!formalTypeParameter.isFormalTypeParameter()) {
//TODO IMPLEMENT ME!F Log.error(String.format("%s is not a formal type parameter. ResolvedTypeSymbol#isFormalTypeParameter() is false.",
//Log.error(String.format("%s is not a formal type parameter. ResolvedTypeSymbol#isFormalTypeParameter() is false.", SymbolPrinter.printFormalTypeParameters(formalTypeParameter)));
// SymbolPrinter.printFormalTypeParameters(formalTypeParameter)));
} }
return getInstance(); return getInstance();
} }
public static EMAComponentBuilder addFormalTypeParameters(EMAComponentSymbol cs, ResolvedTypeSymbol... formalTypeParameter) { public static EMAComponentBuilder addFormalTypeParameters(EMAComponentSymbol cs, ASTType... formalTypeParameter) {
for (ResolvedTypeSymbol f : formalTypeParameter) { for (ASTType f : formalTypeParameter) {
addFormalTypeParameter(cs, f); addFormalTypeParameter(cs, f);
} }
return getInstance(); return getInstance();
} }
public static EMAComponentBuilder addFormalTypeParameters(EMAComponentSymbol cs, Collection<ResolvedTypeSymbol> formalTypeParameter) { public static EMAComponentBuilder addFormalTypeParameters(EMAComponentSymbol cs, Collection<ASTType> formalTypeParameter) {
formalTypeParameter.stream().forEachOrdered(f -> addFormalTypeParameter(cs, f)); formalTypeParameter.stream().forEachOrdered(f -> addFormalTypeParameter(cs, f));
return getInstance(); return getInstance();
} }
......
...@@ -58,5 +58,5 @@ public class EMAComponentInstantiationGenericTypeReplacer implements EmbeddedMon ...@@ -58,5 +58,5 @@ public class EMAComponentInstantiationGenericTypeReplacer implements EmbeddedMon
} }
handled = true; handled = true;
} }
//TODO IMPLEMENT ME!F Handle other cases //TODO Handle other cases if required
} }
...@@ -52,7 +52,7 @@ public class EMAComponentInstantiationSymbol extends EMAComponentInstantiationSy ...@@ -52,7 +52,7 @@ public class EMAComponentInstantiationSymbol extends EMAComponentInstantiationSy
protected EMAComponentSymbolLoader type = null; protected EMAComponentSymbolLoader type = null;
protected List<GenericReplacement> actualTypeArguments = new ArrayList<>(); protected List<GenericReplacement> actualTypeArguments = new ArrayList<>();
protected List<ASTResolutionDeclaration> resolutionDeclarations = new ArrayList<>();//TODO IMPLEMENT ME!F Remove this? protected List<ASTResolutionDeclaration> resolutionDeclarations = new ArrayList<>();
protected List<EMAVariable> parameters = new ArrayList<>(); protected List<EMAVariable> parameters = new ArrayList<>();
protected List<ASTExpression> arguments = new ArrayList<>(); protected List<ASTExpression> arguments = new ArrayList<>();
protected List<ASTEMAConnector> connectors = new ArrayList<>(); protected List<ASTEMAConnector> connectors = new ArrayList<>();
...@@ -188,6 +188,22 @@ public class EMAComponentInstantiationSymbol extends EMAComponentInstantiationSy ...@@ -188,6 +188,22 @@ public class EMAComponentInstantiationSymbol extends EMAComponentInstantiationSy
return connectors; return connectors;
} }
/**
* @param target target of the connector to get
* @return a connector with the given target, absent optional, if it does not exist
*/
public Optional<ASTEMAConnector> getConnector(String target) {
// no check for reference required
for (ASTEMAConnector con : getConnectors()) {
Collection<String> targets = con.getTargetsAsString(true);
for (String connectorTarget : targets) {
if (connectorTarget.equals(target)) {
return Optional.of(con);
}
}
}
return Optional.empty();
}
public void setConnectors( public void setConnectors(
List<ASTEMAConnector> connectors) { List<ASTEMAConnector> connectors) {
this.connectors = connectors; this.connectors = connectors;
...@@ -330,7 +346,6 @@ public class EMAComponentInstantiationSymbol extends EMAComponentInstantiationSy ...@@ -330,7 +346,6 @@ public class EMAComponentInstantiationSymbol extends EMAComponentInstantiationSy
for (GenericReplacement replacement : actualTypeArguments) { for (GenericReplacement replacement : actualTypeArguments) {
Log.debug(replacement.toString(), "Replacement:"); Log.debug(replacement.toString(), "Replacement:");
//TODO IMPLEMENT ME!F
for (EMAPortArraySymbol portArraySymbol : getPortArrayList()) { for (EMAPortArraySymbol portArraySymbol : getPortArrayList()) {
Log.debug("port array to fix size " + portArraySymbol.getName() + Log.debug("port array to fix size " + portArraySymbol.getName() +
"nameSizeDependsOn: " + portArraySymbol.getNameSizeDependsOn(), "FixInstances:"); "nameSizeDependsOn: " + portArraySymbol.getNameSizeDependsOn(), "FixInstances:");
......
...@@ -158,12 +158,10 @@ public class EMAComponentInstantiationSymbolBuilder ...@@ -158,12 +158,10 @@ public class EMAComponentInstantiationSymbolBuilder
Collection<EMAPortSymbol> ports, List<ASTType> formalTypeParameters, Collection<EMAPortSymbol> ports, List<ASTType> formalTypeParameters,
List<ASTType> actualTypeArguments) { List<ASTType> actualTypeArguments) {
List<EMAPortSymbol> pList = ports.stream().collect(Collectors.toList()); List<EMAPortSymbol> pList = ports.stream().collect(Collectors.toList());
//TODO IMPLEMENT ME!D
createMap(formalTypeParameters, actualTypeArguments).forEach((k, v) -> createMap(formalTypeParameters, actualTypeArguments).forEach((k, v) ->
ports.stream().filter(p -> p.getTypeReference().equals(k)) ports.stream().filter(p -> p.getTypeReference().equals(k))
.forEachOrdered(p -> { .forEachOrdered(p -> {
EMAPortSymbol pCloned = EMAPortBuilder.clone(p); EMAPortSymbol pCloned = EMAPortBuilder.clone(p);
//TODO IMPLEMENT ME!F
pCloned.setTypeReference(v); pCloned.setTypeReference(v);
Collections.replaceAll(pList, p, pCloned); Collections.replaceAll(pList, p, pCloned);
}) })
...@@ -242,7 +240,7 @@ public class EMAComponentInstantiationSymbolBuilder ...@@ -242,7 +240,7 @@ public class EMAComponentInstantiationSymbolBuilder
return this; return this;
} }
//TODO IMPLEMENT ME!F Replace Map with List of <new class> that contains replacement mappings like t -> B or N1 n -> N1 n = 6 //Would be better to replace Map with List of <new class> that contains replacement mappings like t -> B or N1 n -> N1 n = 6
protected void exchangeGenerics(EMAComponentInstantiationSymbol inst, protected void exchangeGenerics(EMAComponentInstantiationSymbol inst,
List<GenericReplacement> mapTypeArguments) { List<GenericReplacement> mapTypeArguments) {
Log.debug("amount of observed generic parameters: " + inst.getGenericParameters().size(), Log.debug("amount of observed generic parameters: " + inst.getGenericParameters().size(),
...@@ -302,7 +300,7 @@ public class EMAComponentInstantiationSymbolBuilder ...@@ -302,7 +300,7 @@ public class EMAComponentInstantiationSymbolBuilder
Log.debug(s.getComponentType().toString(), "ComponentType"); Log.debug(s.getComponentType().toString(), "ComponentType");
Log.debug(s.getComponentType().getLoadedSymbol().getFormalTypeParameters().toString(), Log.debug(s.getComponentType().getLoadedSymbol().getFormalTypeParameters().toString(),
"FormalTypeParameters"); "FormalTypeParameters");
//TODO IMPLEMENT ME!F //ActualTypeArguments do not exist anymore
/*exchangeGenerics(s, createMap(s.getComponentType().getFormalTypeParameters(), /*exchangeGenerics(s, createMap(s.getComponentType().getFormalTypeParameters(),
s.getActualTypeArguments()));*/ s.getActualTypeArguments()));*/
......
...@@ -80,7 +80,7 @@ public class EMAConnectorBuilder { ...@@ -80,7 +80,7 @@ public class EMAConnectorBuilder {
con.addTargets(this.targets); con.addTargets(this.targets);
} }
if (portSymbol.orElse(null) != null) { if (portSymbol.orElse(null) != null) {
//TODO IMPLEMENT ME!D //only needed if constant ports are to be handed separately in connector
//con.setConstantPortSymbol(portSymbol.get()); //con.setConstantPortSymbol(portSymbol.get());
} }
return con; return con;
...@@ -88,7 +88,6 @@ public class EMAConnectorBuilder { ...@@ -88,7 +88,6 @@ public class EMAConnectorBuilder {
Log.error("not all parameters have been set before to build the connector symbol"); Log.error("not all parameters have been set before to build the connector symbol");
throw new Error("not all parameters have been set before to build the connector symbol"); throw new Error("not all parameters have been set before to build the connector symbol");
} }
//TODO IMPLEMENT ME!F
public EMAConnectorBuilder setConstantPortSymbol(EMAPortSymbol portSymbol) { public EMAConnectorBuilder setConstantPortSymbol(EMAPortSymbol portSymbol) {
this.portSymbol = Optional.of(portSymbol); this.portSymbol = Optional.of(portSymbol);
...@@ -97,7 +96,7 @@ public class EMAConnectorBuilder { ...@@ -97,7 +96,7 @@ public class EMAConnectorBuilder {
public static ASTEMAConnector instantiate(ASTEMAConnector connector, IEmbeddedMontiArcScope definingScope) { public static ASTEMAConnector instantiate(ASTEMAConnector connector, IEmbeddedMontiArcScope definingScope) {
ASTEMAConnector connectorInstance = new ASTEMAConnector(connector); ASTEMAConnector connectorInstance = new ASTEMAConnector(connector);
//connectorInstance.setIsConstantConnector(connector.isConstant);//TODO IMPLEMENT ME!F //connectorInstance.setIsConstantConnector(connector.isConstant);//TODO reenable if connector has to be explicitly marked as constant
//connectorInstance.setConstantEMAPortSymbol(connector.constantEmaPortSymbol); //connectorInstance.setConstantEMAPortSymbol(connector.constantEmaPortSymbol);
connectorInstance.setDefiningScope(definingScope); connectorInstance.setDefiningScope(definingScope);
return connectorInstance; return connectorInstance;
......
...@@ -390,10 +390,6 @@ public class EMAPortHelper { ...@@ -390,10 +390,6 @@ public class EMAPortHelper {
List<String> sourceNames = getPortName(node.getSource(), symbolTableCreator); List<String> sourceNames = getPortName(node.getSource(), symbolTableCreator);
Log.info("" + sourceNames.size(), "SourcePorts"); Log.info("" + sourceNames.size(), "SourcePorts");
int counter = 0, targetnum = 0; int counter = 0, targetnum = 0;
/*for(ASTQualifiedNameWithArrayAndStar target :
node.getTargets().getQualifiedNameWithArrayAndStarList()){
Log.debug(target.getQualifedNameAsString(true), "TTTArget");
}*/
for (ASTQualifiedNameWithArrayAndStar target : for (ASTQualifiedNameWithArrayAndStar target :
node.getTargets().getQualifiedNameWithArrayAndStarList()) { node.getTargets().getQualifiedNameWithArrayAndStarList()) {
counter = 0; counter = 0;
...@@ -414,11 +410,9 @@ public class EMAPortHelper { ...@@ -414,11 +410,9 @@ public class EMAPortHelper {
EMAComponentSymbol emaComponentSymbol = symbolTableCreator.componentStack.peek(); EMAComponentSymbol emaComponentSymbol = symbolTableCreator.componentStack.peek();
emaComponentSymbol.addConnector(connector); emaComponentSymbol.addConnector(connector);
connector.setDefiningScope(emaComponentSymbol.getSpannedScope()); connector.setDefiningScope(emaComponentSymbol.getSpannedScope());
//TODO IMPLEMENT ME!D Should not be needed anymore
//symbolTableCreator.addToScopeAndLinkWithNode(sym, node);
++counter; ++counter;
}else{ }else{
//Log.error("TODO IMPLEMENT ME!");//TODO IMPLEMENT ME!F This should not be an issue if everything else is handled correctly //Log.error("TODO IMPLEMENT ME!");//This should not be an issue if everything else is handled correctly
} }
} }
// TODO enable checking again if it is fixed // TODO enable checking again if it is fixed
......
...@@ -42,7 +42,7 @@ import java.util.stream.Collectors; ...@@ -42,7 +42,7 @@ import java.util.stream.Collectors;
*/ */
public class EMAPortSymbol extends EMAPortSymbolTOP implements EMAElementSymbol { public class EMAPortSymbol extends EMAPortSymbolTOP implements EMAElementSymbol {
EMAComponentInstantiationSymbolLoader reference; //TODO IMPLEMENT ME!F set this in symbol EMAComponentInstantiationSymbolLoader reference;
// table creator! // table creator!
/** /**
* Maps direction incoming to true. * Maps direction incoming to true.
...@@ -56,9 +56,6 @@ public class EMAPortSymbol extends EMAPortSymbolTOP implements EMAElementSymbol ...@@ -56,9 +56,6 @@ public class EMAPortSymbol extends EMAPortSymbolTOP implements EMAElementSymbol
private boolean config = false; private boolean config = false;