| java.lang.Object xtc.lang.JavaEntities
JavaEntities | final public class JavaEntities (Code) | | Common functionality for handling Java entities outside the AST.
Composite types
ExpressionT | > | GeneralLValueT, GeneralRValueT
| GeneralLValueT | > | LValueT, FieldT, LocalT, ParameterT
| LValueT | = | RValueT
| FieldT | > | VariableT:(FIELD Name WrappedRValueT)
| LocalT | > | VariableT:(LOCAL Name WrappedRValueT)
| ParameterT | > | VariableT:(PARAMETER Name RValueT)
| GeneralRValueT | > | NullT, WrappedRValueT
| RValueT | > | PrimitiveT, ArrayT, WrappedClassT, WrappedInterfaceT
| ArrayT | = | LValueT
| ClassT | = | Name WrappedClassT WrappedInterfaceT* Members
| InterfaceT | = | Name WrappedInterfaceT* Members
| Members | = | FieldT* MethodT* WrappedClassT* WrappedInterfaceT*
| MethodT | = | ReturnT Name ParameterT* WrappedClassT*
| NotAValueT | > | PackageT, AnnotatedT:ReturnT --- annotated with Constants.ATT_NOT_A_VALUE
| ReturnT | > | VoidT, RValueT
|
Wrapped types
WrappedRValueT | > | ConstantT:RValueT / RValueT
| WrappedClassT | > | AliasT:Name / AliasT:ClassT / ClassT
| WrappedInterfaceT | > | AliasT:Name / AliasT:InterfaceT / InterfaceT
|
Basetypes
PrimitiveT | > | BooleanT, NumberT
| NumberT | > | IntegerT, FloatT
| NullT | = | ConstantT:VoidT
|
|
Explanation
Bold font entities | are represented explicitly in xtc.type
| Super > Sub1, ..., SubN | any of the SubI can appear where a Super is expected
| Whole = Part1, ..., PartN | the Whole consists of all the parts PartI
| Whole = Part1 / ... / PartN | the Whole consists of one of the parts PartI
| Wrapper:Contents | the Wrapper must wrap an instance of Contents
| Repetee* | zero or more occurences
|
author: Martin Hirzel |
Inner Class :final public static class JavaTypePrinter extends TypePrinter | |
Inner Class :static class MiniVisitor_allUsedIdentifiers extends Visitor | |
Inner Class :static class MiniVisitor_scrubLocations extends Visitor | |
Inner Class :final static class SuperTypesIter implements Iterator<Type> | |
Inner Class :final public static class UnicodeUnescaper extends Reader | |
Method Summary | |
public static void | addBaseTypes(SymbolTable tab) | public static List<MethodT> | allAbstractMethods(SymbolTable tab, List<File> paths, ClassT clazz) | public static List<MethodT> | allMethods(SymbolTable tab, List<File> paths, ClassT base) | public static Set<String> | allUsedIdentifiers(GNode ast) | public static Type | arrayElementType(ArrayT arrayT) | public static VariableT | arrayLengthField() | public static String | baseTypeToName(Type baseType) | public static ClassOrInterfaceT | canonicalAliasToType(SymbolTable tab, List<File> paths, AliasT alias, boolean mayBeInUnnamedPackage) | public static String | canonicalName(SymbolTable tab, String simpleName) | public static PackageT | canonicalNameToPackage(SymbolTable tab, String name) | public static Type | canonicalNameToPackageOrType(SymbolTable tab, List<File> paths, String name, boolean mayBeInUnnamedPackage) | public static ClassOrInterfaceT | canonicalNameToType(SymbolTable tab, List<File> paths, String name, boolean mayBeInUnnamedPackage) | public static List<File> | classpath(Runtime runtime) | public static boolean | constructorsReturnVoid() | public static boolean | couldCreateConcreteSubclass(SymbolTable tab, List<File> paths, ClassT clazz) Can only create concrete subclass that implements all abstract methods if there
is no pair of abstract methods with the same signature, but different return types. | public static List<Type> | currentImports(SymbolTable tab) | public static MethodT | currentMethod(SymbolTable tab) | public static PackageT | currentPackage(SymbolTable tab) | public static ClassOrInterfaceT | currentType(SymbolTable tab) | public static PackageT | declaringPackage(SymbolTable tab, Type type) | public static String | declaringScopeName(Type type) | public static ClassOrInterfaceT | declaringType(SymbolTable tab, Type member) | public static Type | dereference(Type generalLValue) | public static List<ClassOrInterfaceT> | directSuperTypes(SymbolTable tab, List<File> paths, Type sub) | public static String | enterScopeByQualifiedName(SymbolTable tab, String name) | public static List<VariableT> | fieldsApplicableAndAccessible(SymbolTable tab, List<File> paths, Type base, boolean parents, String name) | public static List<VariableT> | fieldsInherited(SymbolTable tab, List<File> paths, Type base) | public static List<VariableT> | fieldsOwn(Type base) | public static List<VariableT> | fieldsOwnAndInherited(SymbolTable tab, List<File> paths, Type base) | public static String | fileNameToScopeName(String absolutePath) | public static boolean | hasAbstractMethods(SymbolTable tab, List<File> paths, ClassT clazz) Does the class or one of its superclasses declare any abstract methods
that have not been implemented here or in a superclass? (gosling_et_al_2000 §8.1.1). | public static boolean | hasCircularDependency(SymbolTable tab, List<File> paths, ClassOrInterfaceT type) Does the class depend on itself by inheritance or by nesting? (gosling_et_al_2000 §8.1.3). | public static boolean | hasModifier(Type t, String m) | static List<Type> | imports(SymbolTable tab, PackageT packageT, String fileName) | public static boolean | isAccessible(SymbolTable tab, List<File> paths, Type entity) | public static boolean | isAccessibleFromIn(SymbolTable tab, List<File> paths, String scope, Type entity, Type inType) | public static boolean | isAccessibleIn(SymbolTable tab, List<File> paths, Type entity, Type inType) | public static boolean | isApplicableField(SymbolTable tab, List<File> paths, VariableT field, String name) | public static boolean | isApplicableMemberType(Type memberType, String name) | public static boolean | isApplicableMethod(SymbolTable tab, List<File> paths, MethodT callee, String name, List<Type> actuals) | public static boolean | isCheckedException(SymbolTable tab, List<File> paths, Type exc) | public static boolean | isConstantT(Type t) | public static boolean | isConstructor(Type declaringType, MethodT maybeConstructor) | public static boolean | isExpressionT(Type t) ExpressionT > GeneralLValueT, GeneralRValueT. | public static boolean | isFieldT(Type t) FieldT = Name WrappedRValueT. | public static boolean | isGeneralLValueT(Type t) GeneralLValueT > LValueT, VariableT, FieldT, ParameterT. | public static boolean | isGeneralRValueT(Type t) GeneralRValueT > NullT, WrappedRValueT. | public static boolean | isInLocalNameSpace(String name) | public static boolean | isInt(Type t) | public static boolean | isLValueT(Type t) LValueT = RValueT. | public static boolean | isLocalT(Type t) LocalT = Name WrappedRValueT. | public static boolean | isNotAValueT(Type t) | public static boolean | isNullT(Type t) NullT = ConstantT:VoidT. | public static boolean | isParameterT(Type t) ParameterT = Name RValueT. | public static boolean | isPrimitiveT(Type t) PrimitiveT > BooleanT, NumberT. | public static boolean | isRValueT(Type t) RValueT > PrimitiveT, ArrayT, WrappedClassT, WrappedInterfaceT. | public static boolean | isReferenceT(Type t) | public static boolean | isReturnT(Type t) ReturnT > VoidT, RValueT. | public static boolean | isScopeForMember(String scopeName) | public static boolean | isScopeLocal(String scopeName) | public static boolean | isScopeNested(String scopeName) | public static boolean | isScopeTopLevel(String scopeName) | public static boolean | isSuperClass(SymbolTable tab, List<File> paths, Type sup, Type sub) | public static boolean | isSuperMethod(SymbolTable tab, List<File> paths, MethodT sup, MethodT sub) | public static boolean | isTypeAnonymous(ClassOrInterfaceT t) | public static boolean | isTypeInner(ClassOrInterfaceT t) | public static boolean | isTypeLocal(ClassOrInterfaceT t) | public static boolean | isTypeMember(Type t) | public static boolean | isTypeNamed(ClassOrInterfaceT t) | public static boolean | isTypeNested(ClassOrInterfaceT t) | public static boolean | isTypeTopLevel(ClassOrInterfaceT t) | public static boolean | isWrappedClassT(Type t) WrappedClassT = AliasT:Name / AliasT:ResolvedClassT / ResolvedClassT. | public static boolean | isWrappedInterfaceT(Type t) WrappedInterfaceT = AliasT:Name / AliasT:ResolvedInterfaceT / ResolvedInterfaceT. | public static boolean | isWrappedRValueT(Type t) WrappedRValueT = ConstantT:RValueT / RValueT. | public static String | javaAstToString(Node ast) | public static GNode | javaStringToAst(String production, String escaped, boolean simple) | public static Type | javaStringToType(String code) | public static GNode | javaTypeToAst(SymbolTable tab, Type type) | public static String | javaTypeToString(SymbolTable tab, Type type) | static ClassOrInterfaceT | lookupImport(SymbolTable tab, List<File> paths, AliasT alias) Resolve single-type import. | public static List<Type> | memberTypesApplicableAndAccessible(SymbolTable tab, List<File> paths, ClassOrInterfaceT base, boolean parents, String name) | public static List<Type> | memberTypesInherited(SymbolTable tab, List<File> paths, ClassOrInterfaceT base) | public static List<Type> | memberTypesOwn(SymbolTable tab, List<File> paths, ClassOrInterfaceT base) | public static List<Type> | memberTypesOwnAndInherited(SymbolTable tab, List<File> paths, ClassOrInterfaceT base) | public static String | methodSymbolFromAst(GNode ast) | public static String | methodSymbolFromConstructor(Constructor method) | public static String | methodSymbolFromMethod(Method method) | public static List<MethodT> | methodsApplicableAndAccessible(SymbolTable tab, List<File> paths, Type base, boolean parents, String name, List<Type> actuals) All methods in the base type that are accessible, and whose formals accept the actuals
after method invocation conversion (gosling_et_al_2000 §15.12.2.1). | public static List<MethodT> | methodsInherited(SymbolTable tab, List<File> paths, Type base, boolean includeOverridden) | public static List<MethodT> | methodsOwn(Type base) | public static List<MethodT> | methodsOwnAndInherited(SymbolTable tab, List<File> paths, Type base) | public static String | modifierToName(Attribute modifier) | public static String | modifiersToString(Type type) | public static Type | nameToBaseType(String name) | public static Attribute | nameToModifier(String name) | public static MethodT | newRawConstructor(Type base, List<Type> formals, List<Type> exceptions) | public static Type | notAValueIfClassOrInterface(Type t) | public static PackageT | packageDotPackage(SymbolTable tab, PackageT base, String selector) | public static Type | packageDotPackageOrType(SymbolTable tab, List<File> paths, PackageT base, String selector) | static ClassOrInterfaceT | packageDotType(SymbolTable tab, List<File> paths, PackageT base, String selector) | static ClassOrInterfaceT | packageDotType_noSource(SymbolTable tab, PackageT base, String selector) | public static String | packageNameToScopeName(String canonicalName) | public static String | qNameWithDollars(SymbolTable tab, ClassOrInterfaceT t) | public static ClassOrInterfaceT | qualifiedAliasToType(SymbolTable tab, List<File> paths, String scope, AliasT alias) | public static List<ClassOrInterfaceT> | qualifiedAliasesToTypes(SymbolTable tab, List<File> paths, String scope, List<AliasT> aliases) | public static Type | qualifiedNameToPackageOrType(SymbolTable tab, List<File> paths, String scope, String name) | public static ClassOrInterfaceT | qualifiedNameToType(SymbolTable tab, List<File> paths, String scope, String name) | public static Type | resolveIfAlias(SymbolTable tab, List<File> paths, String scope, Type typeThatMayBeAlias) | public static MethodT | resolveIfAliasMethod(SymbolTable tab, List<File> paths, MethodT method) | public static Type | resolveToRValue(Type t0) | static ClassOrInterfaceT | resolveToRawClassOrInterfaceT(Type t) | public static WrappedT | resolveToRawLValue(Type t) | public static Type | resolveToRawRValue(Type t) | public static Type | resolveToValue(AnnotatedT notAValue) | public static boolean | runtimeAssrt(Runtime runtime, Node n, boolean cond, String msgFormat, Object... msgArgs) | public static boolean | sameMethodReturnType(MethodT m1, MethodT m2) | public static boolean | sameMethodSignature(MethodT m1, MethodT m2) | static String | scopeName(PackageT packageT, String fileName) | public static GNode | scrubLocations(GNode result) | public static Type | simpleNameToExpression(SymbolTable tab, List<File> paths, String scope, String name) | public static PackageT | simpleNameToPackage(SymbolTable tab, String name) | public static Type | simpleNameToPackageOrType(SymbolTable tab, List<File> paths, String scope, String name) | public static Type | simpleNameToPackageOrTypeOrExpression(SymbolTable tab, List<File> paths, String scope, String name) | public static ClassOrInterfaceT | simpleNameToType(SymbolTable tab, List<File> paths, String scope, String name) | public static Set<String> | stringSet(Object s) | public static ClassT | tClass(SymbolTable tab) | public static InterfaceT | tCloneable(SymbolTable tab) | public static ClassT | tError(SymbolTable tab) | public static ClassT | tObject(SymbolTable tab) | public static AliasT | tObjectAlias(SymbolTable tab) | public static ClassT | tRuntimeException(SymbolTable tab) | public static InterfaceT | tSerializable(SymbolTable tab) | public static ClassT | tString(SymbolTable tab) | public static ClassT | tThrowable(SymbolTable tab) | public static String | typeDeclString(SymbolTable tab, Object obj) | public static VariableT | typeDotField(SymbolTable tab, List<File> paths, Type base, boolean parents, String name) | public static MethodT | typeDotMethod(SymbolTable tab, List<File> paths, Type baseT, boolean parents, String selector, List<Type> actuals) | public static ClassOrInterfaceT | typeDotType(SymbolTable tab, List<File> paths, ClassOrInterfaceT base, boolean parents, String selector) | public static Type | typeDotTypeOrField(SymbolTable tab, List<File> paths, Type base, boolean parents, String selector) | public static List<Type> | typeList(List list) | public static String | typeToDescriptor(SymbolTable tab, Type type) A descriptor is a JVM-internal string representation of a type of a field or method, see JVM
specification §4.3. | static String | typeToScopeName(Type type) | public static String | typeToSimpleName(Type type) | public static String | typeToString(SymbolTable tab, boolean showDetails, Type type) | public static Type | typeWithDimensions(Type componentT, int dim) | public static String | unicodeUnescape(String in) | public static boolean | zeroLiteral(String s) |
constructorsReturnVoid | public static boolean constructorsReturnVoid()(Code) | | |
couldCreateConcreteSubclass | public static boolean couldCreateConcreteSubclass(SymbolTable tab, List<File> paths, ClassT clazz)(Code) | | Can only create concrete subclass that implements all abstract methods if there
is no pair of abstract methods with the same signature, but different return types.
|
hasAbstractMethods | public static boolean hasAbstractMethods(SymbolTable tab, List<File> paths, ClassT clazz)(Code) | | Does the class or one of its superclasses declare any abstract methods
that have not been implemented here or in a superclass? (gosling_et_al_2000 §8.1.1).
|
isAccessible | public static boolean isAccessible(SymbolTable tab, List<File> paths, Type entity)(Code) | | Is it allowed to use the entity from the current scope of the symbol table (gosling_et_al_2000 §6.6)?
|
isApplicableMemberType | public static boolean isApplicableMemberType(Type memberType, String name)(Code) | | |
isConstantT | public static boolean isConstantT(Type t)(Code) | | |
isConstructor | public static boolean isConstructor(Type declaringType, MethodT maybeConstructor)(Code) | | |
isExpressionT | public static boolean isExpressionT(Type t)(Code) | | ExpressionT > GeneralLValueT, GeneralRValueT.
|
isFieldT | public static boolean isFieldT(Type t)(Code) | | FieldT = Name WrappedRValueT.
|
isGeneralLValueT | public static boolean isGeneralLValueT(Type t)(Code) | | GeneralLValueT > LValueT, VariableT, FieldT, ParameterT.
|
isGeneralRValueT | public static boolean isGeneralRValueT(Type t)(Code) | | GeneralRValueT > NullT, WrappedRValueT.
|
isInLocalNameSpace | public static boolean isInLocalNameSpace(String name)(Code) | | |
isLValueT | public static boolean isLValueT(Type t)(Code) | | LValueT = RValueT.
|
isLocalT | public static boolean isLocalT(Type t)(Code) | | LocalT = Name WrappedRValueT.
|
isNotAValueT | public static boolean isNotAValueT(Type t)(Code) | | NotAValueT > PackageT, AnnotatedT:ReturnT --- annotated with Constants.ATT_NOT_A_VALUE
|
isNullT | public static boolean isNullT(Type t)(Code) | | NullT = ConstantT:VoidT.
|
isParameterT | public static boolean isParameterT(Type t)(Code) | | ParameterT = Name RValueT.
|
isPrimitiveT | public static boolean isPrimitiveT(Type t)(Code) | | PrimitiveT > BooleanT, NumberT.
|
isRValueT | public static boolean isRValueT(Type t)(Code) | | RValueT > PrimitiveT, ArrayT, WrappedClassT, WrappedInterfaceT.
|
isReferenceT | public static boolean isReferenceT(Type t)(Code) | | Is t a class, interface, or array type (gosling_et_al_2000 §4.3)?
|
isReturnT | public static boolean isReturnT(Type t)(Code) | | ReturnT > VoidT, RValueT.
|
isScopeForMember | public static boolean isScopeForMember(String scopeName)(Code) | | |
isScopeLocal | public static boolean isScopeLocal(String scopeName)(Code) | | |
isScopeNested | public static boolean isScopeNested(String scopeName)(Code) | | |
isScopeTopLevel | public static boolean isScopeTopLevel(String scopeName)(Code) | | |
isTypeMember | public static boolean isTypeMember(Type t)(Code) | | |
isWrappedClassT | public static boolean isWrappedClassT(Type t)(Code) | | WrappedClassT = AliasT:Name / AliasT:ResolvedClassT / ResolvedClassT.
|
isWrappedInterfaceT | public static boolean isWrappedInterfaceT(Type t)(Code) | | WrappedInterfaceT = AliasT:Name / AliasT:ResolvedInterfaceT / ResolvedInterfaceT.
|
isWrappedRValueT | public static boolean isWrappedRValueT(Type t)(Code) | | WrappedRValueT = ConstantT:RValueT / RValueT.
|
lookupImport | static ClassOrInterfaceT lookupImport(SymbolTable tab, List<File> paths, AliasT alias)(Code) | | Resolve single-type import. The name is canonical (gosling_et_al_2000
Section 7.5.1) and denotes a class or interface. The only thing that is
uncertain is where the package ends and where the nested types start. For
example, in a.b.c, it could be that the package is a.b and the class is c,
or that the package is a, the outer class is b, and the inner class is c.
There can be no ambiguity (gosling_et_al_2000 Section 6.4), because a
package must not have a top-level type and a subpackage of the same name.
|
methodsApplicableAndAccessible | public static List<MethodT> methodsApplicableAndAccessible(SymbolTable tab, List<File> paths, Type base, boolean parents, String name, List<Type> actuals)(Code) | | All methods in the base type that are accessible, and whose formals accept the actuals
after method invocation conversion (gosling_et_al_2000 §15.12.2.1).
|
notAValueIfClassOrInterface | public static Type notAValueIfClassOrInterface(Type t)(Code) | | |
packageNameToScopeName | public static String packageNameToScopeName(String canonicalName)(Code) | | |
typeToDescriptor | public static String typeToDescriptor(SymbolTable tab, Type type)(Code) | | A descriptor is a JVM-internal string representation of a type of a field or method, see JVM
specification §4.3.
|
typeWithDimensions | public static Type typeWithDimensions(Type componentT, int dim)(Code) | | |
zeroLiteral | public static boolean zeroLiteral(String s)(Code) | | |
|