Package de.monticore.types3.util
Class TypeContextCalculator
- java.lang.Object
-
- de.monticore.types3.util.TypeContextCalculator
-
public class TypeContextCalculator extends java.lang.Objectprovides context information for an expression. first and foremost, whether the expression is within the context of a type (e.g., in a method)
-
-
Field Summary
Fields Modifier and Type Field Description protected static TypeContextCalculatordelegate
-
Constructor Summary
Constructors Constructor Description TypeContextCalculator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected de.monticore.symboltable.modifiers.AccessModifier_getAccessModifier(TypeSymbol type, de.monticore.symboltable.IScope enclosingScope, boolean forceStatic)protected java.util.Optional<TypeSymbol>_getEnclosingType(de.monticore.symboltable.IScope enclosingScope)static de.monticore.symboltable.modifiers.AccessModifiergetAccessModifier(TypeSymbol type, de.monticore.symboltable.IScope enclosingScope)static de.monticore.symboltable.modifiers.AccessModifiergetAccessModifier(TypeSymbol type, de.monticore.symboltable.IScope enclosingScope, boolean forceStatic)given an expression's scope that accesses the type, return the appropriate AccessModifier e.g., an expression in a method can access private members, if the method is static, only static members can be accessed supported: visibility (private and protected), staticness, missing: package_local this function does NOT handle supertypes (WithinTypeBasicSymbolsResolverhandles supertypes) for access via typeID, static access can be forced on (e.g., C.v)protected static TypeContextCalculatorgetDelegate()static java.util.Optional<TypeSymbol>getEnclosingType(de.monticore.symboltable.IScope enclosingScope)given an expression's enclosing scope, returns the enclosing type symbolprotected IBasicSymbolsTypeDispatchergetTypeDispatcher()static voidinit()static voidreset()protected static voidsetDelegate(TypeContextCalculator newDelegate)
-
-
-
Field Detail
-
delegate
protected static TypeContextCalculator delegate
-
-
Method Detail
-
getEnclosingType
public static java.util.Optional<TypeSymbol> getEnclosingType(de.monticore.symboltable.IScope enclosingScope)
given an expression's enclosing scope, returns the enclosing type symbol
-
_getEnclosingType
protected java.util.Optional<TypeSymbol> _getEnclosingType(de.monticore.symboltable.IScope enclosingScope)
-
getAccessModifier
public static de.monticore.symboltable.modifiers.AccessModifier getAccessModifier(TypeSymbol type, de.monticore.symboltable.IScope enclosingScope, boolean forceStatic)
given an expression's scope that accesses the type, return the appropriate AccessModifier e.g., an expression in a method can access private members, if the method is static, only static members can be accessed supported: visibility (private and protected), staticness, missing: package_local this function does NOT handle supertypes (WithinTypeBasicSymbolsResolverhandles supertypes) for access via typeID, static access can be forced on (e.g., C.v)
-
getAccessModifier
public static de.monticore.symboltable.modifiers.AccessModifier getAccessModifier(TypeSymbol type, de.monticore.symboltable.IScope enclosingScope)
-
_getAccessModifier
protected de.monticore.symboltable.modifiers.AccessModifier _getAccessModifier(TypeSymbol type, de.monticore.symboltable.IScope enclosingScope, boolean forceStatic)
-
getTypeDispatcher
protected IBasicSymbolsTypeDispatcher getTypeDispatcher()
-
init
public static void init()
-
reset
public static void reset()
-
setDelegate
protected static void setDelegate(TypeContextCalculator newDelegate)
-
getDelegate
protected static TypeContextCalculator getDelegate()
-
-