Package de.monticore.grammar
Class MCGrammarSymbolTableHelper
java.lang.Object
de.monticore.grammar.MCGrammarSymbolTableHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected static final Integerprotected static final com.google.common.cache.LoadingCache<ProdSymbol, List<ProdSymbol>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareSameTypes(ProdSymbol type1, ProdSymbol type2) static voidcleanUp()static Optional<ProdSymbol> findLeastType(Collection<ProdSymbol> types) Returns the type of the collectiontypesthat is the sub type of all other types in this collection.static Set<MCGrammarSymbol> getAllSuperGrammars(MCGrammarSymbol grammarSymbol) Returns a set of all super grammars of the given grammar (transitively)static Set<ProdSymbol> static Set<ProdSymbol> getAllSuperProds(ProdSymbol prod) static Stringstatic Optional<ProdSymbol> getEnclosingRule(ASTRuleComponent astNode) static Optional<ProdSymbol> static Optional<MCGrammarSymbol> getMCGrammarSymbol(IGrammarScope scope) getMin(AdditionalAttributeSymbol attrSymbol) static StringgetQualifiedName(ASTProd astNode, ProdSymbol symbol, String prefix, String suffix) static List<ProdSymbol> getSuperProds(ProdSymbol prod) static booleanisSubtype(ProdSymbol subType, ProdSymbol superType) protected static booleanisSubtype(ProdSymbol subType, ProdSymbol superType, Set<ProdSymbol> handledTypes) static Optional<ProdSymbol> resolveRule(ASTMCGrammar astNode, String name) static Optional<ProdSymbol> resolveRuleInSupersOnly(ASTClassProd astNode, String name)
-
Field Details
-
AST_DOT_PACKAGE_SUFFIX_DOT
- See Also:
-
STAR
-
superProdCache
protected static final com.google.common.cache.LoadingCache<ProdSymbol,List<ProdSymbol>> superProdCache
-
-
Constructor Details
-
MCGrammarSymbolTableHelper
public MCGrammarSymbolTableHelper()
-
-
Method Details
-
resolveRule
-
resolveRuleInSupersOnly
-
getMCGrammarSymbol
-
getEnclosingRule
-
getEnclosingRule
-
getAllSuperGrammars
Returns a set of all super grammars of the given grammar (transitively)- Returns:
-
getQualifiedName
public static String getQualifiedName(ASTProd astNode, ProdSymbol symbol, String prefix, String suffix) -
getConstantGroupName
-
getAllSuperProds
-
getAllSuperInterfaces
-
getSuperProds
- Parameters:
prod-- Returns:
-
isSubtype
-
isSubtype
protected static boolean isSubtype(ProdSymbol subType, ProdSymbol superType, Set<ProdSymbol> handledTypes) -
areSameTypes
-
findLeastType
Returns the type of the collectiontypesthat is the sub type of all other types in this collection. Else, null is returned.- Parameters:
types- Collection of types- Returns:
- type that is subtype of all other types or null.
-
getMin
-
getMin
-
cleanUp
public static void cleanUp()
-