major changes according to new specification

parent bd9d7783
Pipeline #72694 failed with stage
in 2 minutes and 5 seconds
......@@ -22,7 +22,7 @@ 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.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.se_rwth.commons.logging.Log;
......
......@@ -49,7 +49,7 @@ public class ReferencedSubComponentExists implements EmbeddedMontiArcASTSubCompo
.<EMAComponentSymbol> resolve(referenceName, EMAComponentSymbol.KIND);
if (!componentSymbol.isPresent()) {
Log.error(String.format("0x069B7 Type \"%s\" could not be resolved", referenceName),
Log.error(String.format("0x069B7 TypeSymbol \"%s\" could not be resolved", referenceName),
node.get_SourcePositionStart());
}
}
......
......@@ -26,7 +26,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel
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.cncModel.EMAComponentInstantiationSymbol;
import de.se_rwth.commons.logging.Log;
import java.util.Optional;
......
......@@ -22,7 +22,7 @@ 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.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;
......
......@@ -21,12 +21,12 @@
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import de.monticore.ast.ASTNode;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConnectorResolvingFilter;
import de.monticore.lang.embeddedmontiarc.helper.EMAConnectorResolvingFilter;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConnectorSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortArraySymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAConnectorInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAPortInstanceSymbol;
import de.monticore.lang.monticar.ts.MCASTTypeSymbol;
......
......@@ -33,7 +33,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortArraySymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentInstantiationSymbol;
import de.monticore.symboltable.SymbolKind;
import de.se_rwth.commons.Joiners;
import de.se_rwth.commons.Splitters;
......
......@@ -31,7 +31,6 @@ import de.monticore.lang.embeddedmontiarc.helper.ArcTypePrinter;
import de.monticore.lang.embeddedmontiarc.helper.EMAJavaHelper;
import de.monticore.lang.monticar.ValueSymbol;
import de.monticore.lang.monticar.common2._ast.ASTCommonMatrixType;
import de.monticore.lang.monticar.common2._ast.ASTQualifiedNameWithArray;
import de.monticore.lang.monticar.resolution._ast.ASTUnitNumberExpression;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.MontiCarSymbolFactory;
......@@ -49,7 +48,7 @@ import de.se_rwth.commons.logging.Log;
import java.util.*;
import static de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortHelper.*;
import static de.monticore.lang.embeddedmontiarc.helper.EMAPortHelper.*;
import static de.monticore.lang.embeddedmontiarc.helper.EMATypeHelper.addTypeArgumentsToTypeSymbol;
import static de.monticore.lang.embeddedmontiarc.helper.EMATypeHelper.initTypeRef;
import static de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbolCreator.getGlobalScope;
......@@ -251,7 +250,7 @@ public class EmbeddedMontiArcSymbolTableCreator extends EmbeddedMontiArcSymbolTa
* ArcTypePrinter.printSubComponentName(node); else */
referencedCompName = ArcTypePrinter
.printTypeWithoutTypeArgumentsAndDimension(node.getType());
Log.debug(node.getType().toString(), "Type");
Log.debug(node.getType().toString(), "TypeSymbol");
// String refCompPackage = Names.getQualifier(referencedCompName);
String simpleCompName = Names.getSimpleName(referencedCompName);
Log.debug(referencedCompName, "referencedCompName");
......
......@@ -24,8 +24,8 @@ import com.google.common.collect.Lists;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.*;
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.EMAPortHelper;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.helper.EMAPortHelper;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.InstanceInformation;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.InstancingRegister;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.TypesHelper;
......
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel;
import de.monticore.symboltable.CommonSymbol;
import de.monticore.symboltable.SymbolKind;
import java.util.Collections;
import java.util.Set;
public class CnCModelSymbol extends CommonSymbol {
public CnCModelSymbol(String name, SymbolKind kind) {
super(name, kind);
}
public ComponentInstantiationSymbol getMain() {
return null;
}
public Set<EffectorSymbol> getEffectors() {
return Collections.emptySet();
}
public Set<ConnectorSymbol> getConnectors() {
return Collections.emptySet();
}
public Set<ComponentSymbol> getComponents() {
return Collections.emptySet();
}
}
/**
*
* ******************************************************************************
* 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._symboltable.cncModel;
import java.util.*;
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.type.NaturalNumberSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.type.ParameterBindingSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationKind;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAElementInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.InstanceInformation;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.InstancingRegister;
import de.monticore.lang.embeddedmontiarc.helper.SymbolPrinter;
import de.monticore.lang.monticar.ValueSymbol;
import de.monticore.symboltable.CommonScopeSpanningSymbol;
import de.monticore.symboltable.CommonSymbol;
import de.monticore.symboltable.SymbolKind;
import de.monticore.symboltable.types.TypeSymbol;
import de.monticore.symboltable.types.references.TypeReference;
/**
* Represents an instance of a component.
*
* @author Robert Heim
*/
public class ComponentInstantiationSymbol extends CommonSymbol {
public static final EMAComponentInstantiationKind KIND = EMAComponentInstantiationKind.INSTANCE;
public ComponentInstantiationSymbol(String name, SymbolKind kind) {
super(name, kind);
}
public NaturalNumberSymbol getDimension() {
return null;
}
public Set<ParameterBindingSymbol> getValues() {
return null;
}
public ComponentTypeSymbol getType() {
return null;
}
}
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.type.ParameterSymbol;
import de.monticore.symboltable.CommonScopeSpanningSymbol;
import de.monticore.symboltable.SymbolKind;
import java.util.Set;
public class ComponentInterfaceSymbol extends CommonScopeSpanningSymbol implements ComponentTypeSymbol {
public ComponentInterfaceSymbol(String name, SymbolKind kind) {
super(name, kind);
}
@Override
public Set<ComponentInstantiationSymbol> getImplements() {
return null;
}
public Set<PortSymbol> getPorts() {
return null;
}
public Set<ParameterSymbol> getParameters() {
return null;
}
}
/**
*
* ******************************************************************************
* 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._symboltable.cncModel;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.type.ParameterSymbol;
import de.monticore.symboltable.CommonScopeSpanningSymbol;
import de.monticore.symboltable.SymbolKind;
import java.util.Set;
public class ComponentSymbol extends CommonScopeSpanningSymbol implements ComponentTypeSymbol {
public ComponentSymbol(String name, SymbolKind kind) {
super(name, kind);
}
@Override
public Set<ComponentInstantiationSymbol> getImplements() {
return null;
}
public Set<PortSymbol> getPorts() {
return null;
}
public Set<ParameterSymbol> getParameters() {
return null;
}
public Set<ComponentInstantiationSymbol> getSubs() {
return null;
}
}
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel;
import de.monticore.symboltable.Symbol;
import java.util.Set;
public interface ComponentTypeSymbol extends Symbol {
Set<ComponentInstantiationSymbol> getImplements();
}
/**
*
* ******************************************************************************
* 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._symboltable.cncModel;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.type.RangeSymbol;
import de.monticore.symboltable.CommonSymbol;
import de.monticore.symboltable.SymbolKind;
import java.util.Optional;
public class ConnectorSymbol extends CommonSymbol {
public ConnectorSymbol(String name, SymbolKind kind) {
super(name, kind);
}
public PortInstantiationSymbol getSourcePort() {
return null;
}
public PortInstantiationSymbol getTargetPort() {
return null;
}
public RangeSubPortSymbol getSourceIndices() {
// If not present then 1:1
return null;
}
public RangeSubPortSymbol getTargetIndices() {
// If not present then 1:1
return null;
}
}
......@@ -18,27 +18,30 @@
* License along with this project. If not, see <http://www.gnu.org/licenses/>.
* *******************************************************************************
*/
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel;
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.EMAComponentInstantiationKind;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAElementInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.InstanceInformation;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.InstancingRegister;
import de.monticore.lang.embeddedmontiarc.helper.SymbolPrinter;
import de.monticore.lang.monticar.ValueSymbol;
import de.monticore.symboltable.CommonScopeSpanningSymbol;
import de.monticore.symboltable.CommonSymbol;
import de.monticore.symboltable.types.TypeSymbol;
import de.monticore.symboltable.types.references.TypeReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
/**
* Represents an instance of a component.
*
* @author Robert Heim
*/
public class EMAComponentInstantiationSymbol extends CommonScopeSpanningSymbol implements EMAElementInstanceSymbol {
public class EMAComponentInstantiationSymbolOld extends CommonSymbol implements EMAElementInstanceSymbol {
public static final EMAComponentInstantiationKind KIND = EMAComponentInstantiationKind.INSTANCE;
......@@ -52,12 +55,12 @@ public class EMAComponentInstantiationSymbol extends CommonScopeSpanningSymbol i
private String value = "";
/**
* Constructor for de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol
* Constructor for de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentInstantiationSymbol
*
* @param name
* @param componentType the referenced component definition
*/
public EMAComponentInstantiationSymbol(String name, EMAComponentSymbolReference componentType) {
public EMAComponentInstantiationSymbolOld(String name, EMAComponentSymbolReference componentType) {
super(name, KIND);
this.componentType = componentType;
......
......@@ -23,9 +23,8 @@ package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncMode
import com.google.common.collect.ImmutableList;
import de.monticore.expressionsbasis._ast.ASTExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ComponentKind;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstantiationSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.EMAVariable;
import de.monticore.lang.embeddedmontiarc.helper.EMAComponentBuilder;
import de.monticore.lang.embeddedmontiarc.helper.SymbolPrinter;
import de.monticore.lang.monticar.common2._ast.ASTParameter;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
......@@ -52,7 +51,7 @@ import static de.monticore.symboltable.Symbols.sortSymbolsByPosition;
*
* @author Robert Heim
*/
public class EMAComponentSymbol extends CommonScopeSpanningSymbol implements EMAElementSymbol{
public class EMAComponentSymbolOld extends CommonScopeSpanningSymbol implements EMAElementSymbol{
public static final ComponentKind KIND = new ComponentKind();
......@@ -67,7 +66,7 @@ public class EMAComponentSymbol extends CommonScopeSpanningSymbol implements EMA
// when "this" not actually is a component, but a reference to a component, this optional
// attribute is set by the symbol-table creator to the referenced component and must be used for
// implementation.
private Optional<EMAComponentSymbol> referencedComponent = Optional.empty();
private Optional<EMAComponentSymbolOld> referencedComponent = Optional.empty();
private List<ImportStatement> imports = new ArrayList<>();
......@@ -77,25 +76,25 @@ public class EMAComponentSymbol extends CommonScopeSpanningSymbol implements EMA
private List<ASTExpression> arguments = new ArrayList<>();
public EMAComponentSymbol(String name) {
public EMAComponentSymbolOld(String name) {
super(name, KIND);
}
public EMAComponentSymbol(String name, SymbolKind kind) {
public EMAComponentSymbolOld(String name, SymbolKind kind) {
super(name, kind);
}
/**
* @return referencedComponent
*/
public Optional<EMAComponentSymbol> getReferencedComponent() {
public Optional<EMAComponentSymbolOld> getReferencedComponent() {
return this.referencedComponent;
}
/**
* @param referencedComponent the referencedComponent to set
*/
public void setReferencedComponent(Optional<EMAComponentSymbol> referencedComponent) {
public void setReferencedComponent(Optional<EMAComponentSymbolOld> referencedComponent) {
// to fix port instancing
this.referencedComponent = referencedComponent;
}
......@@ -212,16 +211,16 @@ public class EMAComponentSymbol extends CommonScopeSpanningSymbol implements EMA
/**
* @return innerComponents
*/
public Collection<EMAComponentSymbol> getInnerComponents() {
public Collection<EMAComponentSymbolOld> getInnerComponents() {
return referencedComponent.orElse(this).getSpannedScope()
.<EMAComponentSymbol>resolveLocally(EMAComponentSymbol.KIND);
.<EMAComponentSymbolOld>resolveLocally(EMAComponentSymbolOld.KIND);
}
/**
* @param name inner component name
* @return inner component with the given name, empty Optional, if it does not exist
*/
public Optional<EMAComponentSymbol> getInnerComponent(String name) {
public Optional<EMAComponentSymbolOld> getInnerComponent(String name) {
// no check for reference required
return getInnerComponents().stream()
.filter(c -> c.getName().equals(name))
......@@ -232,7 +231,7 @@ public class EMAComponentSymbol extends CommonScopeSpanningSymbol implements EMA
* @param visibility visibility
* @return inner components with the given visibility
*/
public Collection<EMAComponentSymbol> getInnerComponents(AccessModifier visibility) {
public Collection<EMAComponentSymbolOld> getInnerComponents(AccessModifier visibility) {
// no check for reference require
return getInnerComponents().stream()
.filter(s -> s.getAccessModifier().includes(visibility))
......@@ -664,7 +663,7 @@ public class EMAComponentSymbol extends CommonScopeSpanningSymbol implements EMA
// TODO implement me
}
public Optional<EMAComponentSymbol> getParent() {
return (Optional<EMAComponentSymbol>) getEnclosingScope().getSpanningSymbol();
public Optional<EMAComponentSymbolOld> getParent() {
return (Optional<EMAComponentSymbolOld>) getEnclosingScope().getSpanningSymbol();
}
}
/**
*
* ******************************************************************************
* 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