Commit f4867c69 authored by Christoph Richter's avatar Christoph Richter
Browse files

Updated to newest version of languagescommon

parent 72dfc426
......@@ -43,7 +43,7 @@
<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>
<SIUnit.version>0.0.11-SNAPSHOT</SIUnit.version>
<SIUnit.version>0.0.13-SNAPSHOT</SIUnit.version>
<struct.version>0.0.11</struct.version>
<Common-MontiCar.version>0.0.13-SNAPSHOT</Common-MontiCar.version>
<tagging.version>0.0.2</tagging.version>
......
......@@ -24,7 +24,7 @@ package de.monticore.lang.embeddedmontiarc;
*
* @author Michael von Wenckstern, Nina Pichler, Sascha Schneiders, Sining Wang, Yu Qiao
*/
grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2, de.monticore.lang.monticar.Ranges {
grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2 {
/** ASTEMACompilationUnit represents the complete component
* @attribute package The package declaration of this component
......@@ -212,13 +212,6 @@ grammar EmbeddedMontiArc extends de.monticore.lang.monticar.Common2, de.monticor
NEWLINETOKEN* "autoinstantiate"
(["on"] | ["off"]) ";" NEWLINETOKEN*;
//TODO investigate what is wrong with monticore
//this is needed otherwise something with the generated parser is wrong
Ranges implements PrintType,TypeArgument=
"[" Range+ "]";
token NEWLINETOKEN =
('\r' '\n' |
'\r' |
......
......@@ -42,7 +42,7 @@ public class ComponentWithTypeParametersHasInstance
*/
@Override
public void check(ASTComponent node) {
ComponentSymbol componentSymbol = (ComponentSymbol) node.getSymbol().get();
ComponentSymbol componentSymbol = (ComponentSymbol) node.getSymbolOpt().get();
Collection<ComponentInstanceSymbol> subComponents = componentSymbol.getSubComponents();
......
......@@ -40,13 +40,13 @@ public class ParameterNamesUnique implements EmbeddedMontiArcASTComponentCoCo {
List<String> parameterNames = new ArrayList<>();
for (ASTParameter parameter : parameters) {
if (parameterNames.contains(parameter.getName())) {
Log.error(String.format("0xC4A61 Parameter name \"%s\" not unique", parameter.getName()),
if (parameterNames.contains(parameter.getNameWithArray().getName())) {
Log.error(String.format("0xC4A61 Parameter name \"%s\" not unique", parameter.getNameWithArray().getName()),
parameter.get_SourcePositionStart());
}
else {
parameterNames.add(parameter.getName());
parameterNames.add(parameter.getNameWithArray().getName());
}
}
}
......
......@@ -28,6 +28,8 @@ import de.monticore.lang.monticar.ranges._ast.ASTRanges;
//import de.monticore.types.types._ast.ASTPrimitiveType;
//import de.monticore.types.types._ast.ASTType;
import de.monticore.lang.monticar.types2._ast.*;
import de.monticore.types.types._ast.ASTPrimitiveType;
import de.monticore.types.types._ast.ASTType;
import de.se_rwth.commons.logging.Log;
/**
......
......@@ -55,7 +55,7 @@ public class PortUsage implements EmbeddedMontiArcASTComponentCoCo {
@Override
public void check(ASTComponent node) {
ComponentSymbol entry = (ComponentSymbol) node.getSymbol().get();
ComponentSymbol entry = (ComponentSymbol) node.getSymbolOpt().get();
// %%%%%%%%%%%%%%%% CV5 %%%%%%%%%%%%%%%%
if (entry.isDecomposed()) {
......
......@@ -42,7 +42,7 @@ public class SimpleConnectorSourceExists implements EmbeddedMontiArcASTComponent
*/
@Override
public void check(ASTComponent node) {
ComponentSymbol symbol = (ComponentSymbol) node.getSymbol().orElse(null);
ComponentSymbol symbol = (ComponentSymbol) node.getSymbolOpt().orElse(null);
if (null == symbol) {
Log.error(String.format("0x9AF6C ASTComponent node \"%s\" has no symbol. Did you forget to "
......
......@@ -57,7 +57,7 @@ public class SubComponentsConnected implements EmbeddedMontiArcASTComponentCoCo
@Override
public void check(ASTComponent node) {
ComponentSymbol entry = (ComponentSymbol) node.getSymbol().get();
ComponentSymbol entry = (ComponentSymbol) node.getSymbolOpt().get();
// Implemented on the symTab as it takes auto-instantiation into account which is not reflected
// in the AST.
for (ComponentInstanceSymbol sub : entry.getSubComponents()) {
......
......@@ -22,15 +22,16 @@ 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.types.types._ast.ASTTypeParameters;
//import de.monticore.types.types._ast.ASTTypeVariableDeclaration;
import de.monticore.lang.monticar.types2._ast.ASTTypeParameters;
import de.monticore.lang.monticar.types2._ast.ASTTypeVariableDeclaration;
import de.monticore.types.types._ast.ASTTypeParameters;
import de.monticore.types.types._ast.ASTTypeVariableDeclaration;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
import java.util.List;
//import de.monticore.types.types._ast.ASTTypeParameters;
//import de.monticore.types.types._ast.ASTTypeVariableDeclaration;
/**
* @author (last commit) Crispin Kirchner
*/
......@@ -47,12 +48,12 @@ public class TypeParameterNamesUnique implements EmbeddedMontiArcASTComponentCoC
}
List<String> typeParameterNames = new ArrayList<>();
for (ASTTypeVariableDeclaration typeParameter : typeParameters.getTypeVariableDeclarationsList()) {
for (ASTTypeVariableDeclaration typeParameter : typeParameters.getTypeVariableDeclarationList()) {
if (typeParameter.getNamingResolutionOpt().isPresent() && typeParameterNames.contains(typeParameter.getNamingResolution().getName())) {
if (typeParameterNames.contains(typeParameter.getName())) {
Log.error(String.format(
"0x35F1A The formal type parameter name \"%s\" is not unique",
typeParameter.getNamingResolution().getName()), typeParameter.get_SourcePositionStart());
typeParameter.getName()), typeParameter.get_SourcePositionStart());
} else {
//typeParameterNames.add(typeParameter.getNamingResolution().get().getName());
}
......
......@@ -53,7 +53,7 @@ public class UniquePorts implements EmbeddedMontiArcASTInterfaceCoCo {
// calc implicit name
String implicitName = ArcTypePrinter.printType(port.getType());
// TODO use symTab
// PortSymbol entry = ((PortSymbol) port.getSymbol().get());
// PortSymbol entry = ((PortSymbol) port.getSymbolOpt().get());
// String implicitName = entry.getTypeReference().getReferencedSymbol().getName();
name = StringTransformations.uncapitalize(implicitName);
}
......
......@@ -21,8 +21,8 @@
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast;
import de.monticore.lang.monticar.common2._ast.ASTParameter;
import de.monticore.lang.monticar.types2._ast.ASTReferenceType;
import de.monticore.lang.monticar.types2._ast.ASTTypeParameters;
import de.monticore.types.types._ast.ASTReferenceType;
import de.monticore.types.types._ast.ASTTypeParameters;
import java.util.ArrayList;
import java.util.List;
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import de.monticore.lang.monticar.resolution._ast.ASTTypeArgument;
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;
......
......@@ -252,9 +252,6 @@ public class ComponentSymbol extends CommonScopeSpanningSymbol {
referencedComponent.orElse(this).isInnerComponent = isInnerComponent;
}
/**
* @param typeParameter generic type parameter to add
*/
public void addFormalTypeParameter(MCTypeSymbol formalTypeParameter) {
if (referencedComponent.isPresent()) {
referencedComponent.get().addFormalTypeParameter(formalTypeParameter);
......@@ -383,8 +380,6 @@ public class ComponentSymbol extends CommonScopeSpanningSymbol {
/**
* Returns a list of all incoming ports that also contains ports from a super component.
*
* @param loader used to load full version of super component (if needed)
* @param deserializers used to load full version of super component (if needed)
* @return list of all incoming ports.
*/
public List<PortSymbol> getAllIncomingPorts() {
......@@ -416,8 +411,6 @@ public class ComponentSymbol extends CommonScopeSpanningSymbol {
/**
* Returns a list of all outgoing ports that also contains ports from a super component.
*
* @param loader used to load full version of super component (if needed)
* @param deserializers used to load full version of super component (if needed)
* @return list of all outgoing ports.
*/
public List<PortSymbol> getAllOutgoingPorts() {
......@@ -622,7 +615,7 @@ public class ComponentSymbol extends CommonScopeSpanningSymbol {
referencedComponent.get().addParameter(astParameter);
else {
EMAVariable param = new EMAVariable();
param.setName(astParameter.getName());
param.setName(astParameter.getNameWithArray().getName());
param.setType(astParameter.getType());
parameters.add(param);
}
......
......@@ -26,7 +26,7 @@ package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import com.google.common.collect.ImmutableList;
import de.monticore.expressionsbasis._ast.ASTExpression;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.monticore.lang.monticar.types2._ast.ASTUnitNumberResolution;
import de.monticore.lang.monticar.resolution._ast.ASTUnitNumberResolution;
import de.monticore.symboltable.MutableScope;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.modifiers.AccessModifier;
......
......@@ -21,18 +21,20 @@
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.unit.constant.*;
//import de.monticore.literals.literals._ast.*;
import de.monticore.lang.monticar.literals2._ast.*;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.unit.constant.EMAConstantBoolean;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.unit.constant.EMAConstantSIUnit;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.unit.constant.EMAConstantValue;
import de.monticore.literals.literals._ast.ASTBooleanLiteral;
import de.monticore.numberunit._ast.ASTNumberWithUnit;
import de.se_rwth.commons.logging.Log;
import org.jscience.mathematics.number.Rational;
import javax.measure.unit.Unit;
import de.monticore.lang.numberunit._ast.ASTUnitNumber;
import static de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EMATypeHelper.initTypeRefGeneralType;
import static de.monticore.numberunit.Rationals.doubleToRational;
//import de.monticore.literals.literals._ast.*;
/**
* The ConstantPortSymbol is a port which has a constant value assigned and is used
......@@ -71,9 +73,9 @@ public class ConstantPortSymbol extends PortSymbol {
/**
* initializes ConstantPort from a UnitNumberLiteral
*/
public void initConstantPortSymbol(ASTUnitNumber si_unit) {
Unit unit = si_unit.getUnit().get();
Rational rational = si_unit.getNumber().get();
public void initConstantPortSymbol(ASTNumberWithUnit si_unit) {
Unit unit = si_unit.getUnit();
Rational rational = doubleToRational(si_unit.getNumber().get());
setConstantValue(new EMAConstantSIUnit(rational, unit));
}
......@@ -104,7 +106,7 @@ public class ConstantPortSymbol extends PortSymbol {
ConstantPortSymbol constantPortSymbol = new ConstantPortSymbol();
if (node.getUnitNumberResolutionOpt().isPresent()) {
constantPortSymbol.initConstantPortSymbol(node.getUnitNumberResolution().getUnitNumber());
constantPortSymbol.initConstantPortSymbol(node.getUnitNumberResolution().getNumberWithUnit());
String typeName;
typeName = "UnitNumberResolution";
constantPortSymbol.setTypeReference(initTypeRefGeneralType(typeName, symbolTableCreator));
......
......@@ -21,24 +21,15 @@
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.TypesPrinter;
import de.monticore.lang.monticar.resolution._ast.ASTTypeArgument;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.MontiCarSymbolFactory;
import de.monticore.lang.monticar.ts.MontiCarTypeSymbol;
import de.monticore.lang.monticar.ts.references.MontiCarTypeSymbolReference;
import de.monticore.lang.monticar.types2._ast.ASTComplexArrayType;
import de.monticore.lang.monticar.types2._ast.ASTComplexReferenceType;
import de.monticore.lang.monticar.types2._ast.ASTNamingResolution;
import de.monticore.lang.monticar.types2._ast.ASTSimpleReferenceType;
import de.monticore.lang.monticar.types2._ast.ASTType;
import de.monticore.lang.monticar.types2._ast.ASTTypeParameters;
import de.monticore.lang.monticar.types2._ast.ASTTypeVariableDeclaration;
import de.monticore.lang.monticar.types2._ast.ASTWildcardType;
import de.monticore.symboltable.GlobalScope;
import de.monticore.symboltable.ImportStatement;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.types.references.ActualTypeArgument;
import de.se_rwth.commons.logging.Log;
import de.monticore.types.types._ast.*;
import javax.annotation.Nullable;
import java.util.ArrayList;
......@@ -72,33 +63,10 @@ public class EMAJavaHelper {
ComponentSymbol typeSymbol,
ASTTypeParameters optionalTypeParameters, Scope currentScope) {
ASTTypeParameters astTypeParameters = optionalTypeParameters;
for (ASTTypeVariableDeclaration astTypeParameter : astTypeParameters
.getTypeVariableDeclarationsList()) {
if (astTypeParameter.getResolutionDeclarationOpt().isPresent()) {
//Not handled here
// new type parameter
// TypeParameters/TypeVariables are seen as type declarations.
// For each variable instantiate a MontiCarTypeSymbol.
//TODO FIX if not present
if (astTypeParameter.getResolutionDeclaration().getTypeName() != null) {
final String typeVariableName = astTypeParameter.getResolutionDeclaration().getTypeName();
addFormalTypeParameter(typeVariableName, astTypeParameter, currentScope, typeSymbol);
} else if (astTypeParameter.getResolutionDeclaration() instanceof ASTNamingResolution) {
final String typeVariableName = astTypeParameter.getResolutionDeclaration().getName();
addFormalTypeParameter(typeVariableName, astTypeParameter, currentScope, typeSymbol);
} else {
Log.debug(astTypeParameter.getResolutionDeclaration().toString(), "Resolution Declaration");
Log.debug("0xADTYPA Case not handled", "Implementation Missing");
}
} else {
final String typeVariableName = astTypeParameter.getNamingResolution().getName();
addFormalTypeParameter(typeVariableName, astTypeParameter, currentScope, typeSymbol);
}
ASTTypeParameters astTypeParameters = optionalTypeParameters;
for (ASTTypeVariableDeclaration astTypeParameter : astTypeParameters.getTypeVariableDeclarationList()) {
final String typeVariableName = astTypeParameter.getName();
addFormalTypeParameter(typeVariableName, astTypeParameter, currentScope, typeSymbol);
}
return typeSymbol.getFormalTypeParameters();
}
......@@ -115,7 +83,7 @@ public class EMAJavaHelper {
// }
// Treat type bounds are implemented interfaces, even though the
// first bound might be a class. See also JLS7.
List<ASTType> types = new ArrayList<ASTType>(astTypeParameter.getUpperBoundsList());
List<ASTType> types = new ArrayList<ASTType>(astTypeParameter.getUpperBoundList());
addInterfacesToTypeEMA(javaTypeVariableSymbol, types, currentScope);
......@@ -157,7 +125,7 @@ public class EMAJavaHelper {
// TODO javaInterfaceTypeSymbolReference.getEnclosingScope().resolve("Boolean", MCTypeSymbol.KIND).get()
// javaInterfaceTypeSymbolReference.getEnclosingScope().resolve("Boolean", MCTypeSymbol.KIND))
if (astSimpleReferenceType.getTypeArgumentsOpt().isPresent()) {
for (ASTTypeArgument argument : astSimpleReferenceType.getTypeArgumentsOpt().get().getTypeArgumentsList()) {
for (ASTTypeArgument argument : astSimpleReferenceType.getTypeArgumentsOpt().get().getTypeArgumentList()) {
if (!handleSimpleReferenceType(argument, 0, actualTypeArguments,
javaInterfaceTypeSymbolReference.getEnclosingScope(), false, false, null) &&
......@@ -198,7 +166,7 @@ public class EMAJavaHelper {
}
if (simpleArg.getTypeArgumentsOpt().isPresent()) {
List<ActualTypeArgument> actualTypeArguments2 = new ArrayList<>();
for (ASTTypeArgument astTypeArgument : simpleArg.getTypeArgumentsOpt().get().getTypeArgumentsList()) {
for (ASTTypeArgument astTypeArgument : simpleArg.getTypeArgumentsOpt().get().getTypeArgumentList()) {
handleSimpleReferenceType(astTypeArgument, 0, actualTypeArguments2, symbolTable, false, false, typeArgument);
}
typeArgument.getType().setActualTypeArguments(actualTypeArguments2);
......
......@@ -25,14 +25,14 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTPort;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTSubComponent;
import de.monticore.lang.monticar.common2._ast.ASTArrayAccess;
import de.monticore.lang.monticar.common2._ast.ASTQualifiedNameWithArray;
import de.monticore.lang.monticar.resolution._ast.ASTTypeArgument;
import de.monticore.types.types._ast.ASTTypeArgument;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.references.MCTypeReference;
import de.monticore.lang.monticar.types2._ast.ASTSimpleReferenceType;
import de.monticore.lang.monticar.types2._ast.ASTUnitNumberResolution;
import de.monticore.types.types._ast.ASTSimpleReferenceType;
import de.monticore.lang.monticar.resolution._ast.ASTUnitNumberResolution;
import de.monticore.lang.monticar.types2._ast.ASTUnitNumberTypeArgument;
import de.monticore.lang.numberunit._ast.ASTUnitNumber;
import de.monticore.numberunit._ast.ASTNumberWithUnit;
import de.monticore.symboltable.MutableScope;
import de.se_rwth.commons.logging.Log;
......@@ -53,7 +53,7 @@ public class EMAPortHelper {
Log.debug(node.toString(), "ASTPort");
int num = 0;
if (node.getUnitNumberResolutionOpt().isPresent()
&& node.getUnitNumberResolution().getUnitNumberOpt().isPresent()) {
&& node.getUnitNumberResolution().getNumberWithUnitOpt().isPresent()) {
num = node.getUnitNumberResolution().getNumber().get().intValue();
} else {
Log.debug("No UnitNumberResolution/UnitNumber present!", "ASTPort");
......@@ -110,8 +110,7 @@ public class EMAPortHelper {
String name = null;
if (node.getUnitNumberResolutionOpt().isPresent()) {
ASTUnitNumberResolution unitNumberResolution = node.getUnitNumberResolution();
name = unitNumberResolution
.doResolution(symbolTableCreator.componentStack.
name = unitNumberResolution.doResolution(symbolTableCreator.componentStack.
peek().getResolutionDeclarationSymbols());
}
......@@ -365,17 +364,17 @@ public class EMAPortHelper {
public static void doConnectorResolution(ASTConnector node, EmbeddedMontiArcSymbolTableCreator symbolTableCreator) {
if (node.getUnitNumberResolutionOpt().isPresent()) {
ASTUnitNumberResolution unitNumberResolution = node.getUnitNumberResolution();
ASTUnitNumber toSet = null;
if (unitNumberResolution.getUnitNumberOpt().isPresent()) {
toSet = unitNumberResolution.getUnitNumber();
ASTNumberWithUnit toSet = null;
if (unitNumberResolution.getNumberWithUnitOpt().isPresent()) {
toSet = unitNumberResolution.getNumberWithUnit();
} else if (unitNumberResolution.getNameOpt().isPresent()) {
ResolutionDeclarationSymbol resDeclSym = symbolTableCreator.componentStack.peek()
.getResolutionDeclarationSymbol(unitNumberResolution.getNameOpt().get()).get();
toSet = ((ASTUnitNumberResolution) resDeclSym.getASTResolution()).getUnitNumber();
toSet = ((ASTUnitNumberResolution) resDeclSym.getASTResolution()).getNumberWithUnit();
}
unitNumberResolution.setUnit(toSet.getUnit().get());
unitNumberResolution.setUnit(toSet.getUnit());
unitNumberResolution.setNumber(toSet.getNumber().get());
}
......@@ -387,12 +386,12 @@ public class EMAPortHelper {
if (node.getType() instanceof ASTSimpleReferenceType) {
if (((ASTSimpleReferenceType) node.getType()).getTypeArgumentsOpt().isPresent()) {
for (ASTTypeArgument typeArgument : ((ASTSimpleReferenceType) node.getType())
.getTypeArgumentsOpt().get().getTypeArgumentsList()) {
.getTypeArgumentsOpt().get().getTypeArgumentList()) {
if (typeArgument instanceof ASTUnitNumberTypeArgument) {
Log.debug("" + ((ASTUnitNumberTypeArgument) typeArgument).getUnitNumber().getNumber()
Log.debug("" + ((ASTUnitNumberTypeArgument) typeArgument).getNumberWithUnit().getNumber()
.get().intValue(), "New Resolution Value:");
if (counter == index)
return ((ASTUnitNumberTypeArgument) typeArgument).getUnitNumber().getNumber().get()
return ((ASTUnitNumberTypeArgument) typeArgument).getNumberWithUnit().getNumber().get()
.intValue();
++counter;
}
......
......@@ -25,16 +25,15 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.TypesHelper;
import de.monticore.lang.embeddedmontiarc.helper.ArcTypePrinter;
import de.monticore.lang.monticar.ranges._ast.ASTRange;
import de.monticore.lang.monticar.ranges._ast.ASTRanges;
import de.monticore.lang.monticar.resolution._ast.ASTTypeArgument;
import de.monticore.lang.monticar.si._symboltable.SIUnitRangesSymbolReference;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.references.CommonMCTypeReference;
import de.monticore.lang.monticar.ts.references.MCASTTypeSymbolReference;
import de.monticore.lang.monticar.ts.references.MCTypeReference;
import de.monticore.lang.monticar.ts.references.MontiCarTypeSymbolReference;
import de.monticore.lang.monticar.types2._ast.*;
import de.monticore.symboltable.MutableScope;
import de.monticore.symboltable.types.references.ActualTypeArgument;
import de.monticore.types.types._ast.*;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -136,7 +135,7 @@ public class EMATypeHelper {
}
List<ActualTypeArgument> actualTypeArguments = new ArrayList<>();
for (ASTTypeArgument astTypeArgument : astSimpleReferenceType.getTypeArgumentsOpt().get()
.getTypeArgumentsList()) {
.getTypeArgumentList()) {
if (astTypeArgument instanceof ASTWildcardType) {
ASTWildcardType astWildcardType = (ASTWildcardType) astTypeArgument;
......@@ -286,7 +285,7 @@ public class EMATypeHelper {
return;
}
setActualTypeArguments(typeReference,
astSimpleReferenceType.getTypeArgumentsOpt().get().getTypeArgumentsList(), symbolTableCreator);
astSimpleReferenceType.getTypeArgumentsOpt().get().getTypeArgumentList(), symbolTableCreator);
} else if (astType instanceof ASTComplexReferenceType) {
ASTComplexReferenceType astComplexReferenceType = (ASTComplexReferenceType) astType;
for (ASTSimpleReferenceType astSimpleReferenceType : astComplexReferenceType
......
......@@ -20,23 +20,23 @@
*/
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import de.monticore.expressionsbasis._ast.ASTExpression;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.*;
import de.monticore.lang.embeddedmontiarc.helper.ArcTypePrinter;
import de.monticore.lang.embeddedmontiarc.trafos.AutoConnection;
import de.monticore.lang.monticar.ValueSymbol;
import de.monticore.lang.monticar.common2._ast.ASTQualifiedNameWithArray;
import de.monticore.expressionsbasis._ast.ASTExpression;
import de.monticore.lang.monticar.ranges._ast.ASTUnitNumberExpression;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.MontiCarSymbolFactory;
import de.monticore.lang.monticar.ts.references.MCTypeReference;
import de.monticore.lang.monticar.types2._ast.ASTImportStatement;
import de.monticore.lang.monticar.types2._ast.ASTReferenceType;
import de.monticore.lang.monticar.types2._ast.ASTType;
import de.monticore.symboltable.*;
import de.monticore.symboltable.modifiers.BasicAccessModifier;
import de.monticore.symboltable.types.TypeSymbol;
import de.monticore.symboltable.types.references.TypeReference;
import de.monticore.types.types._ast.ASTImportStatement;
import de.monticore.types.types._ast.ASTReferenceType;
import de.monticore.types.types._ast.ASTType;
import de.se_rwth.commons.Names;
import de.se_rwth.commons.StringTransformations;
import de.se_rwth.commons.logging.Log;
......@@ -98,7 +98,7 @@ public class EmbeddedMontiArcSymbolTableCreator extends EmbeddedMontiArcSymbolTa
// imports
List<ImportStatement> imports = new ArrayList<>();
for (ASTImportStatement astImportStatement : compilationUnit.getImportStatementList()) {
String qualifiedImport = Names.getQualifiedName(astImportStatement.getImportListList());
String qualifiedImport = Names.getQualifiedName(astImportStatement.getImportList());
ImportStatement importStatement = new ImportStatement(qualifiedImport,
astImportStatement.isStar());
imports.add(importStatement);
......@@ -124,11 +124,11 @@ public class EmbeddedMontiArcSymbolTableCreator extends EmbeddedMontiArcSymbolTa
return;
}
// creates all instances which are created through the top level component
Log.debug("endVisit of " + node.getComponent().getSymbol().get().getFullName(),
Log.debug("endVisit of " + node.getComponent().getSymbolOpt().get().getFullName(),
"SymbolTableCreator:"); // ,"MontiArcSymbolTableCreator");
// new Error().printStackTrace();
instanceSymbolCreator.createInstances(
(ComponentSymbol) (Log.errorIfNull(node.getComponent().getSymbol().orElse(null))));
(ComponentSymbol) (Log.errorIfNull(node.getComponent().getSymbolOpt().orElse(null))));
}
......
......@@ -21,31 +21,36 @@
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import com.google.common.collect.Lists;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.*;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTSubComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTSubComponentInstance;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.TypesHelper;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.TypesPrinter;
import de.monticore.lang.monticar.ValueSymbol;
import de.monticore.lang.monticar.common2._ast.ASTAdaptableKeyword;
import de.monticore.lang.monticar.common2._ast.ASTParameter;
import de.monticore.lang.monticar.resolution._ast.ASTResolutionDeclaration;
import de.monticore.lang.monticar.resolution._parser.ResolutionParser;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbolReference;
import de.monticore.lang.monticar.ts.MCFieldSymbol;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.references.MCTypeReference;
import de.monticore.lang.monticar.ts.references.MontiCarTypeSymbolReference;
import de.monticore.lang.monticar.types2._ast.ASTTypeNameResolutionDeclaration;
import de.monticore.lang.monticar.types2._ast.ASTTypeParameters;
import de.monticore.lang.monticar.types2._ast.ASTTypeVariableDeclaration;
import de.monticore.lang.monticar.resolution._ast.ASTTypeNameResolutionDeclaration;
import de.monticore.lang.monticar.resolution._ast.ASTUnitNumberResolution;
import de.monticore.numberunit._ast.ASTNumberWithUnit;
import de.monticore.lang.monticar.types2._ast.ASTUnitNumberResolution;
import de.monticore.lang.numberunit._ast.ASTUnitNumber;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.types.TypeSymbol;
import de.monticore.symboltable.types.references.TypeReference;
import de.monticore.types.types._ast.ASTTypeParameters;
import de.monticore.types.types._ast.ASTTypeVariableDeclaration;
import de.se_rwth.commons.logging.Log;