Commit 50b544ce authored by Alexander Ryndin's avatar Alexander Ryndin
Browse files

replaced J-classes with MC-classes

parent 9e1c9f6f
......@@ -39,14 +39,14 @@ import de.monticore.lang.monticar.struct.model.type.ScalarStructFieldType;
import de.monticore.lang.monticar.struct.model.type.StructFieldTypeInfo;
import de.monticore.lang.monticar.struct.model.type.StructReferenceFieldType;
import de.monticore.lang.monticar.struct.model.type.VectorStructFieldType;
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.types2._ast.ASTType;
import de.monticore.lang.monticar.types2._ast.ASTTypeArguments;
import de.monticore.lang.monticar.types2._ast.ASTUnitNumberResolution;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.Symbol;
import de.monticore.symboltable.types.JFieldSymbol;
import de.monticore.symboltable.types.JTypeSymbol;
import de.monticore.symboltable.types.references.JTypeReference;
import de.se_rwth.commons.logging.Log;
import javax.annotation.Nonnull;
......@@ -133,7 +133,7 @@ public final class ComponentParametersSubstitutionsBuilder extends EmbeddedMonti
.getReferencedSymbol()
.getFormalTypeParameters()
.stream()
.map(JTypeSymbol::getName)
.map(MCTypeSymbol::getName)
.collect(Collectors.toList())
);
childConfigurationParameters.clear();
......@@ -142,7 +142,7 @@ public final class ComponentParametersSubstitutionsBuilder extends EmbeddedMonti
.getReferencedSymbol()
.getConfigParameters()
.stream()
.map(JFieldSymbol::getName)
.map(MCFieldSymbol::getName)
.collect(Collectors.toList())
);
List<ASTExpression> astArguments = node.getArguments();
......@@ -296,7 +296,7 @@ public final class ComponentParametersSubstitutionsBuilder extends EmbeddedMonti
literalParams.add(p);
}
private StructFieldTypeInfo tryConvertToStructFieldTypeInfo(JTypeReference<?> type) {
private StructFieldTypeInfo tryConvertToStructFieldTypeInfo(MCTypeReference<?> type) {
if (type == null || type.getName() == null) {
return null;
}
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.embeddedmontiarc;
import de.monticore.java.symboltable.JavaTypeSymbol;
import de.monticore.lang.monticar.ts.MontiCarTypeSymbol;
import de.monticore.symboltable.MutableScope;
public final class Utils {
......@@ -42,7 +42,7 @@ public final class Utils {
"CommonMatrixType"
};
for (String typeName : builtInTypes) {
JavaTypeSymbol s = new JavaTypeSymbol(typeName);
MontiCarTypeSymbol s = new MontiCarTypeSymbol(typeName);
s.setPackageName("java.lang");
scope.add(s);
}
......
......@@ -29,16 +29,21 @@ import de.monticore.lang.montiarc.tagging._symboltable.TaggingScopeSpanningSymbo
import de.monticore.lang.monticar.common2._ast.ASTParameter;
import de.monticore.lang.monticar.mcexpressions._ast.ASTExpression;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.monticore.lang.monticar.ts.MCFieldSymbol;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.symboltable.ImportStatement;
import de.monticore.symboltable.SymbolKind;
import de.monticore.symboltable.modifiers.AccessModifier;
import de.monticore.symboltable.types.JFieldSymbol;
import de.monticore.symboltable.types.JTypeSymbol;
import de.monticore.symboltable.types.references.ActualTypeArgument;
import de.se_rwth.commons.logging.Log;
import javax.annotation.Nullable;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import static com.google.common.base.Preconditions.checkArgument;
......@@ -94,7 +99,7 @@ public class ComponentSymbol extends TaggingScopeSpanningSymbol {
/**
* @param parameterType configuration parameter to add
*/
public void addConfigParameter(JFieldSymbol parameterType) {
public void addConfigParameter(MCFieldSymbol parameterType) {
if (referencedComponent.isPresent())
referencedComponent.get().addConfigParameter(parameterType);
else {
......@@ -247,7 +252,7 @@ public class ComponentSymbol extends TaggingScopeSpanningSymbol {
/**
* @param typeParameter generic type parameter to add
*/
public void addFormalTypeParameter(JTypeSymbol formalTypeParameter) {
public void addFormalTypeParameter(MCTypeSymbol formalTypeParameter) {
if (referencedComponent.isPresent()) {
referencedComponent.get().addFormalTypeParameter(formalTypeParameter);
} else {
......@@ -256,10 +261,10 @@ public class ComponentSymbol extends TaggingScopeSpanningSymbol {
}
}
public List<JTypeSymbol> getFormalTypeParameters() {
final Collection<JTypeSymbol> resolvedTypes =
referencedComponent.orElse(this).getSpannedScope().resolveLocally(JTypeSymbol.KIND);
return resolvedTypes.stream().filter(JTypeSymbol::isFormalTypeParameter)
public List<MCTypeSymbol> getFormalTypeParameters() {
final Collection<MCTypeSymbol> resolvedTypes =
referencedComponent.orElse(this).getSpannedScope().resolveLocally(MCTypeSymbol.KIND);
return resolvedTypes.stream().filter(MCTypeSymbol::isFormalTypeParameter)
.collect(Collectors.toList());
}
......@@ -512,14 +517,14 @@ public class ComponentSymbol extends TaggingScopeSpanningSymbol {
/**
* @return configParameters
*/
public List<JFieldSymbol> getConfigParameters() {
public List<MCFieldSymbol> getConfigParameters() {
if (referencedComponent.isPresent()) {
return referencedComponent.get().getConfigParameters();
} else {
final Collection<JFieldSymbol> resolvedAttributes = getMutableSpannedScope()
.resolveLocally(JFieldSymbol.KIND);
final List<JFieldSymbol> parameters = sortSymbolsByPosition(resolvedAttributes.stream()
.filter(JFieldSymbol::isParameter).collect(Collectors.toList()));
final Collection<MCFieldSymbol> resolvedAttributes = getMutableSpannedScope()
.resolveLocally(MCFieldSymbol.KIND);
final List<MCFieldSymbol> parameters = sortSymbolsByPosition(resolvedAttributes.stream()
.filter(MCFieldSymbol::isParameter).collect(Collectors.toList()));
return parameters;
}
}
......@@ -528,7 +533,7 @@ public class ComponentSymbol extends TaggingScopeSpanningSymbol {
* @return List of configuration parameters that are to be set during instantiation with the given
* visibility
*/
public Collection<JFieldSymbol> getConfigParameters(AccessModifier visibility) {
public Collection<MCFieldSymbol> getConfigParameters(AccessModifier visibility) {
// no need to check for reference, as getParameres() does so.
return getConfigParameters().stream()
.filter(s -> s.getAccessModifier().includes(visibility))
......
......@@ -25,8 +25,8 @@ import de.monticore.symboltable.MutableScope;
import de.monticore.symboltable.Symbol;
import de.monticore.symboltable.resolving.CommonResolvingFilter;
import de.monticore.symboltable.resolving.ResolvingFilter;
import de.monticore.symboltable.types.JFieldSymbol;
import de.monticore.symboltable.types.JTypeSymbol;
import de.monticore.lang.monticar.ts.MCFieldSymbol;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.se_rwth.commons.logging.Log;
import java.util.Collection;
......@@ -63,11 +63,11 @@ public class EMAComponentBuilder extends de.monticore.lang.montiarc.montiarc._sy
private static final ResolvingFilter<ComponentSymbol> componentResolvingFilter =
CommonResolvingFilter.create(ComponentSymbol.KIND);
private static final ResolvingFilter<JTypeSymbol> jTypeSymbolResolvingGilter =
CommonResolvingFilter.create(JTypeSymbol.KIND);
private static final ResolvingFilter<MCTypeSymbol> jTypeSymbolResolvingGilter =
CommonResolvingFilter.create(MCTypeSymbol.KIND);
private static final ResolvingFilter<JFieldSymbol> jAttributeResolvingFilter =
CommonResolvingFilter.create(JFieldSymbol.KIND);
private static final ResolvingFilter<MCFieldSymbol> jAttributeResolvingFilter =
CommonResolvingFilter.create(MCFieldSymbol.KIND);
private static final ResolvingFilter<ComponentInstanceSymbol> componentInstanceResolvingFilter =
CommonResolvingFilter.create(ComponentInstanceSymbol.KIND);
......@@ -189,76 +189,76 @@ public class EMAComponentBuilder extends de.monticore.lang.montiarc.montiarc._sy
////////////////////////// formal type parameters //////////////////////////////////////////////
public static EMAComponentBuilder addFormalTypeParameter(ComponentSymbol cs, JTypeSymbol formalTypeParameter) {
public static EMAComponentBuilder addFormalTypeParameter(ComponentSymbol cs, MCTypeSymbol formalTypeParameter) {
if (!formalTypeParameter.isFormalTypeParameter()) {
Log.error(String.format("%s is not a formal type parameter. JTypeSymbol#isFormalTypeParameter() is false.",
Log.error(String.format("%s is not a formal type parameter. MCTypeSymbol#isFormalTypeParameter() is false.",
SymbolPrinter.printFormalTypeParameters(formalTypeParameter)));
}
addResolverIfMissing(cs, jTypeSymbolResolvingGilter, formalTypeParameter);
return getInstance();
}
public static EMAComponentBuilder addFormalTypeParameters(ComponentSymbol cs, JTypeSymbol... formalTypeParameter) {
for (JTypeSymbol f : formalTypeParameter) {
public static EMAComponentBuilder addFormalTypeParameters(ComponentSymbol cs, MCTypeSymbol... formalTypeParameter) {
for (MCTypeSymbol f : formalTypeParameter) {
addFormalTypeParameter(cs, f);
}
return getInstance();
}
public static EMAComponentBuilder addFormalTypeParameters(ComponentSymbol cs, Collection<JTypeSymbol> formalTypeParameter) {
public static EMAComponentBuilder addFormalTypeParameters(ComponentSymbol cs, Collection<MCTypeSymbol> formalTypeParameter) {
formalTypeParameter.stream().forEachOrdered(f -> addFormalTypeParameter(cs, f));
return getInstance();
}
public static EMAComponentBuilder removeFormalTypeParameter(ComponentSymbol cs, JTypeSymbol formalTypeParameter) {
public static EMAComponentBuilder removeFormalTypeParameter(ComponentSymbol cs, MCTypeSymbol formalTypeParameter) {
((MutableScope) cs.getSpannedScope()).remove(formalTypeParameter);
return getInstance();
}
public static EMAComponentBuilder removeFormalTypeParameters(ComponentSymbol cs, JTypeSymbol... formalTypeParameter) {
for (JTypeSymbol f : formalTypeParameter) {
public static EMAComponentBuilder removeFormalTypeParameters(ComponentSymbol cs, MCTypeSymbol... formalTypeParameter) {
for (MCTypeSymbol f : formalTypeParameter) {
removeFormalTypeParameter(cs, f);
}
return getInstance();
}
public static EMAComponentBuilder removeFormalTypeParameters(ComponentSymbol cs, Collection<JTypeSymbol> formalTypeParameter) {
public static EMAComponentBuilder removeFormalTypeParameters(ComponentSymbol cs, Collection<MCTypeSymbol> formalTypeParameter) {
formalTypeParameter.stream().forEachOrdered(f -> removeFormalTypeParameter(cs, f));
return getInstance();
}
////////////////////////// config parameters //////////////////////////////////////////////
public static EMAComponentBuilder addConfigParameter(ComponentSymbol cs, JFieldSymbol configParameter) {
public static EMAComponentBuilder addConfigParameter(ComponentSymbol cs, MCFieldSymbol configParameter) {
addResolverIfMissing(cs, jAttributeResolvingFilter, configParameter);
return getInstance();
}
public static EMAComponentBuilder addConfigParameters(ComponentSymbol cs, JFieldSymbol... configParameter) {
for (JFieldSymbol c : configParameter) {
public static EMAComponentBuilder addConfigParameters(ComponentSymbol cs, MCFieldSymbol... configParameter) {
for (MCFieldSymbol c : configParameter) {
addConfigParameter(cs, c);
}
return getInstance();
}
public static EMAComponentBuilder addConfigParameters(ComponentSymbol cs, Collection<JFieldSymbol> configParameter) {
public static EMAComponentBuilder addConfigParameters(ComponentSymbol cs, Collection<MCFieldSymbol> configParameter) {
configParameter.stream().forEachOrdered(c -> addConfigParameter(cs, c));
return getInstance();
}
public static EMAComponentBuilder removeConfigParameter(ComponentSymbol cs, JFieldSymbol configParameter) {
public static EMAComponentBuilder removeConfigParameter(ComponentSymbol cs, MCFieldSymbol configParameter) {
((MutableScope) cs.getSpannedScope()).remove(configParameter);
return getInstance();
}
public static EMAComponentBuilder removeConfigParameters(ComponentSymbol cs, JFieldSymbol... configParameter) {
for (JFieldSymbol c : configParameter) {
public static EMAComponentBuilder removeConfigParameters(ComponentSymbol cs, MCFieldSymbol... configParameter) {
for (MCFieldSymbol c : configParameter) {
removeConfigParameter(cs, c);
}
return getInstance();
}
public static EMAComponentBuilder removeConfigParameters(ComponentSymbol cs, Collection<JFieldSymbol> configParameter) {
public static EMAComponentBuilder removeConfigParameters(ComponentSymbol cs, Collection<MCFieldSymbol> configParameter) {
configParameter.stream().forEachOrdered(c -> removeConfigParameter(cs, c));
return getInstance();
}
......
......@@ -20,20 +20,24 @@
*/
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import de.monticore.java.symboltable.JavaSymbolFactory;
import de.monticore.java.symboltable.JavaTypeSymbol;
import de.monticore.java.symboltable.JavaTypeSymbolReference;
import de.monticore.lang.monticar.resolution._ast.ASTResolutionDeclaration;
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.JTypeSymbol;
import de.monticore.symboltable.types.references.ActualTypeArgument;
//import de.monticore.types.TypesPrinter;
//import de.monticore.types.types._ast.*;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.TypesPrinter;
import de.monticore.lang.monticar.types2._ast.*;
import de.se_rwth.commons.logging.Log;
import javax.annotation.Nullable;
......@@ -48,10 +52,10 @@ import java.util.stream.Collectors;
* @author Robert Heim
*/
public class EMAJavaHelper extends de.monticore.lang.montiarc.montiarc._symboltable.JavaHelper {
private final static JavaSymbolFactory jSymbolFactory = new JavaSymbolFactory();
private final static MontiCarSymbolFactory jSymbolFactory = new MontiCarSymbolFactory();
/**
* Adds the TypeParameters to the JavaTypeSymbol if the class or interface declares TypeVariables.
* Adds the TypeParameters to the MontiCarTypeSymbol if the class or interface declares TypeVariables.
* Example:
* <p>
* class Bla<T, S extends SomeClass<T> & SomeInterface>
......@@ -60,11 +64,11 @@ public class EMAJavaHelper extends de.monticore.lang.montiarc.montiarc._symbolta
*
* @param typeSymbol
* @param optionalTypeParameters
* @return JavaTypeSymbol list to be added to the scope
* @return MontiCarTypeSymbol list to be added to the scope
*/
// TODO see JavaSymbolTableCreator.addTypeParameters(...),
// see ComponentSymbol addFormalTypeParameters etc.
protected static List<JTypeSymbol> addTypeParametersToType(
protected static List<MCTypeSymbol> addTypeParametersToType(
ComponentSymbol typeSymbol,
Optional<ASTTypeParameters> optionalTypeParameters, Scope currentScope) {
if (optionalTypeParameters.isPresent()) {
......@@ -76,7 +80,7 @@ public class EMAJavaHelper extends de.monticore.lang.montiarc.montiarc._symbolta
// new type parameter
// TypeParameters/TypeVariables are seen as type declarations.
// For each variable instantiate a JavaTypeSymbol.
// For each variable instantiate a MontiCarTypeSymbol.
//TODO FIX if not present
if (astTypeParameter.getResolutionDeclaration().get().getTypeName() != null) {
final String typeVariableName = astTypeParameter.getResolutionDeclaration().get().getTypeName();
......@@ -100,7 +104,7 @@ public class EMAJavaHelper extends de.monticore.lang.montiarc.montiarc._symbolta
}
private static void addFormalTypeParameter(String typeVariableName, ASTTypeVariableDeclaration astTypeParameter, Scope currentScope, ComponentSymbol typeSymbol) {
JavaTypeSymbol javaTypeVariableSymbol = jSymbolFactory.createTypeVariable(typeVariableName);
MontiCarTypeSymbol javaTypeVariableSymbol = jSymbolFactory.createTypeVariable(typeVariableName);
// TODO implement
// // init type parameter
// if (astTypeParameter.getTypeBound().isPresent()) {
......@@ -120,7 +124,7 @@ public class EMAJavaHelper extends de.monticore.lang.montiarc.montiarc._symbolta
}
/**
* Adds the given ASTTypes as interfaces to the JavaTypeSymbol. The JavaTypeSymbol can be a type
* Adds the given ASTTypes as interfaces to the MontiCarTypeSymbol. The MontiCarTypeSymbol can be a type
* variable. Interfaces may follow after the first extended Type. We treat the first Type also as
* interface even though it may be a class.
* <p>
......@@ -133,10 +137,10 @@ public class EMAJavaHelper extends de.monticore.lang.montiarc.montiarc._symbolta
*/
// TODO this is implemented in JavaDSL, but reimplemented because of ArcTypeSymbol. This should
// somehow be extracted and implemented only once
protected static void addInterfacesToTypeEMA(JavaTypeSymbol arcTypeSymbol,
protected static void addInterfacesToTypeEMA(MontiCarTypeSymbol arcTypeSymbol,
List<ASTType> astInterfaceTypeList, Scope currentScope) {
for (ASTType astInterfaceType : astInterfaceTypeList) {
JavaTypeSymbolReference javaInterfaceTypeSymbolReference = new JavaTypeSymbolReference(
MontiCarTypeSymbolReference javaInterfaceTypeSymbolReference = new MontiCarTypeSymbolReference(
TypesPrinter.printTypeWithoutTypeArgumentsAndDimension(astInterfaceType), currentScope,
0);
List<ActualTypeArgument> actualTypeArguments = new ArrayList<>();
......@@ -150,8 +154,8 @@ public class EMAJavaHelper extends de.monticore.lang.montiarc.montiarc._symbolta
ASTComplexReferenceType astComplexReferenceType = (ASTComplexReferenceType) astInterfaceType;
for (ASTSimpleReferenceType astSimpleReferenceType : astComplexReferenceType
.getSimpleReferenceTypes()) {
// TODO javaInterfaceTypeSymbolReference.getEnclosingScope().resolve("Boolean", JTypeSymbol.KIND).get()
// javaInterfaceTypeSymbolReference.getEnclosingScope().resolve("Boolean", JTypeSymbol.KIND))
// TODO javaInterfaceTypeSymbolReference.getEnclosingScope().resolve("Boolean", MCTypeSymbol.KIND).get()
// javaInterfaceTypeSymbolReference.getEnclosingScope().resolve("Boolean", MCTypeSymbol.KIND))
if (astSimpleReferenceType.getTypeArguments().isPresent()) {
for (ASTTypeArgument argument : astSimpleReferenceType.getTypeArguments().get().getTypeArguments()) {
......@@ -183,10 +187,10 @@ public class EMAJavaHelper extends de.monticore.lang.montiarc.montiarc._symbolta
if (argument instanceof ASTSimpleReferenceType) {
ASTSimpleReferenceType simpleArg = (ASTSimpleReferenceType) argument;
String name = simpleArg.getNames().stream().collect(Collectors.joining("."));
Optional<JTypeSymbol> symbol = symbolTable.resolve(name, JTypeSymbol.KIND);
Optional<MCTypeSymbol> symbol = symbolTable.resolve(name, MCTypeSymbol.KIND);
if (symbol.isPresent() && symbol.get().getEnclosingScope() != null) {
if (typeArgument == null) {
typeArgument = new ActualTypeArgumentASTElement(isLowerBound, isUpperBound, new JavaTypeSymbolReference(
typeArgument = new ActualTypeArgumentASTElement(isLowerBound, isUpperBound, new MontiCarTypeSymbolReference(
symbol.get().getName(),
symbol.get().getEnclosingScope(), dim)).setAstTypeArguments(argument);
......
......@@ -20,18 +20,18 @@
*/
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import java.util.Optional;
import de.monticore.ast.ASTNode;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.unit.constant.EMAConstantValue;
import de.monticore.symboltable.types.references.JTypeReference;
import de.monticore.lang.monticar.ts.references.MCTypeReference;
import de.se_rwth.commons.logging.Log;
import java.util.Optional;
public class EMAPortBuilder {
protected Optional<Boolean> incoming = Optional.empty();
protected Optional<String> name = Optional.empty();
protected Optional<JTypeReference> typeReference = Optional.empty();
protected Optional<MCTypeReference> typeReference = Optional.empty();
protected Optional<EMAConstantValue> constantValue = Optional.empty();
protected Optional<ASTNode> astNode = Optional.empty();
......@@ -65,7 +65,7 @@ public class EMAPortBuilder {
return this;
}
public EMAPortBuilder setTypeReference(JTypeReference typeReference) {
public EMAPortBuilder setTypeReference(MCTypeReference typeReference) {
this.typeReference = Optional.of(typeReference);
return this;
}
......
......@@ -22,7 +22,7 @@ package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import com.google.common.collect.ImmutableSet;
import de.monticore.ast.ASTNode;
import de.monticore.java.symboltable.JavaTypeSymbol;
import de.monticore.lang.monticar.ts.MontiCarTypeSymbol;
import de.monticore.lang.montiarc.tagging._symboltable.TagSymbol;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.monticore.lang.monticar.types2._symboltable.UnitNumberResolutionSymbol;
......@@ -32,9 +32,9 @@ import de.monticore.lang.montiarc.tagging._symboltable.TagSymbolCreator;
import de.monticore.lang.montiarc.tagging._symboltable.TagableModelingLanguage;
import de.monticore.modelloader.ModelingLanguageModelLoader;
import de.monticore.symboltable.resolving.CommonResolvingFilter;
import de.monticore.symboltable.types.JFieldSymbol;
import de.monticore.lang.monticar.ts.MCFieldSymbol;
import de.monticore.symboltable.types.JMethodSymbol;
import de.monticore.symboltable.types.JTypeSymbol;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import java.util.LinkedHashSet;
......@@ -65,14 +65,14 @@ public class EmbeddedMontiArcLanguage extends EmbeddedMontiArcLanguageTOP implem
addResolver(new CommonResolvingFilter<>(ExpandedComponentInstanceSymbol.KIND));
addResolver(new CommonResolvingFilter<>(SIUnitSymbol.KIND));
addResolver(new CommonResolvingFilter<>(SIUnitRangesSymbol.KIND));
addResolver(new CommonResolvingFilter<>(JTypeSymbol.KIND));
addResolver(new CommonResolvingFilter<>(JFieldSymbol.KIND));
addResolver(new CommonResolvingFilter<>(MCTypeSymbol.KIND));
addResolver(new CommonResolvingFilter<>(MCFieldSymbol.KIND));
addResolver(new CommonResolvingFilter<>(JMethodSymbol.KIND));
addResolvingFilter(CommonResolvingFilter.create(ResolutionDeclarationSymbol.KIND));
addResolvingFilter(CommonResolvingFilter.create(UnitNumberResolutionSymbol.KIND));
//addResolvingFilter(CommonResolvingFilter.create(ComponentKind.KIND));
//addResolvingFilter(CommonResolvingFilter.create(TagSymbol.KIND));
addResolvingFilter(new CommonResolvingFilter<>(JavaTypeSymbol.KIND));
addResolvingFilter(new CommonResolvingFilter<>(MontiCarTypeSymbol.KIND));
setModelNameCalculator(new EmbeddedMontiArcModelNameCalculator());
}
......
......@@ -20,11 +20,16 @@
*/
package de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable;
import de.monticore.ast.ASTNode;
//import de.monticore.common.common._ast.ASTStereoValue;
import de.monticore.java.symboltable.JavaSymbolFactory;
import de.monticore.java.symboltable.JavaTypeSymbolReference;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.*;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTComponentHead;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTConnector;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTEMACompilationUnit;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTMontiArcAutoConnect;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTMontiArcAutoInstantiate;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTPort;
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.embeddedmontiarc.helper.ArcTypePrinter;
import de.monticore.lang.embeddedmontiarc.helper.Timing;
......@@ -43,30 +48,54 @@ import de.monticore.lang.monticar.resolution._ast.ASTTypeArgument;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbolReference;
import de.monticore.lang.monticar.si._symboltable.SIUnitRangesSymbolReference;
import de.monticore.symboltable.*;
import de.monticore.lang.monticar.ts.MCFieldSymbol;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.MontiCarSymbolFactory;
import de.monticore.lang.monticar.ts.references.CommonMCTypeReference;
import de.monticore.lang.monticar.ts.references.MCTypeReference;
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.ASTImportStatement;
import de.monticore.lang.monticar.types2._ast.ASTReferenceType;
import de.monticore.lang.monticar.types2._ast.ASTSimpleReferenceType;
import de.monticore.lang.monticar.types2._ast.ASTType;
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.types2._ast.ASTUnitNumberResolution;
import de.monticore.lang.monticar.types2._ast.ASTUnitNumberTypeArgument;
import de.monticore.lang.monticar.types2._ast.ASTWildcardType;
import de.monticore.symboltable.ArtifactScope;
import de.monticore.symboltable.ImportStatement;
import de.monticore.symboltable.MutableScope;
import de.monticore.symboltable.ResolvingConfiguration;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.Symbol;
import de.monticore.symboltable.modifiers.BasicAccessModifier;
import de.monticore.symboltable.types.JFieldSymbol;
import de.monticore.symboltable.types.JTypeSymbol;
import de.monticore.symboltable.types.TypeSymbol;
import de.monticore.symboltable.types.references.ActualTypeArgument;
import de.monticore.symboltable.types.references.CommonJTypeReference;
import de.monticore.symboltable.types.references.JTypeReference;
import de.monticore.symboltable.types.references.TypeReference;
//import de.monticore.types.TypesHelper;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.TypesHelper;
//import de.monticore.types.types._ast.*;
import de.monticore.lang.monticar.types2._ast.*;
import de.se_rwth.commons.Names;
import de.se_rwth.commons.StringTransformations;
import de.se_rwth.commons.logging.Log;
import org.jscience.mathematics.number.Rational;
import java.util.*;
import siunit.monticoresiunit.si._ast.ASTUnitNumber;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Deque;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Stack;
import static de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.EmbeddedMontiArcExpandedComponentInstanceSymbolCreator.getGlobalScope;
//import de.monticore.common.common._ast.ASTStereoValue;
//import de.monticore.types.TypesHelper;
//import de.monticore.types.types._ast.*;
/**
* Visitor that creats the symboltable of an EmbeddedMontiArc AST.