java.lang.Object
de.grogra.xl.compiler.scope.Members
This class is used to collect a set of
Members,
and to determine the applicable, accessible, and most specific, member
thereof. In the context of this class, members are local variables, fields,
named predicates, methods, constructors, types, and packages.
The usage is as follows:
- The name of the members to collect is set by one of the
resetNamemethods. - The context in which members of the given name are to be searched
is defined by one of the
setContextmethods. This also includes a set of flags (a union of constants defined in this class) which restrict the possible set of members. - The method
is invoked in order to collect the members which can be found in the context, have the given name, and match the restrictions imposed by the flags. This method either returns a member or throws an exception.
invalid reference
#find(Resolution)
MAX_MEMBER are chosen to reflect the obscuring relations
of the XL programming language. Do not change the values!- Author:
- Ole Kniemeyer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis class stores information about the quality of applicability of a member in a context.static interfaceResolutiondefines a strategy how applicable members for explicitly given arguments are determined and how the most specific member of these is chosen. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBit mask forsetContextmethods indicating that constructors are to be included in the search.static final intBit mask forsetContextmethods indicating that only declared members are to be included in the search.static final intThis bit mask has to be set byScope.findMembers(String, int, Members)beforesuper.findMembersis invoked if the scope is related to another package than the package of the context.static final intBit mask forsetContextmethods indicating that instance scopes have to be excluded from the search.static final intBit mask forsetContextmethods indicating that interface are to be excluded from the search.static final intBit mask forsetContextmethods indicating that types as members of packages are to be excluded from the search.static final intBit mask forsetContextmethods indicating that fields are to be included in the search.static final intstatic final intstatic final intBit mask forsetContextmethods indicating that only non-static members are to be included in the search.static final intBit mask forsetContextmethods indicating that local variables are to be included in the search.static final intLargest bit mask of the bit masks which select the type of members in question.static final intThis constant can be used as mask to filter the bit masks which represent member types.static final intBit mask forsetContextmethods indicating that methods are to be included in the search.static final intThis is the minimal bit mask which is not defined by this class.static final intstatic final intBit mask forsetContextmethods indicating that named predicates are to be included in the search.static final intstatic final intBit mask forsetContextmethods indicating that only static members are to be included in the search.static final intBit mask forsetContextmethods indicating that sub-packages of packages are to be included in the search.static final intBit mask forsetContextmethods indicating that only members of the supertype of the context type are to be included in the search.static final intBit mask forsetContextmethods indicating that top-level packages are to be included in the search.static final intBit mask forsetContextmethods indicating that types are to be included in the search.static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddMatches(Scope scope, int flags) voidaddMatches(Scope scope, Type qualifier, int flags) static StringgetMembersDescription(int types, boolean plural) static intgetMemberType(Member member) static Stringantlr.collections.ASTbooleanvoidreset()voidresetName(antlr.collections.AST id) voidintsize()toString()
-
Field Details
-
LOCAL
public static final int LOCALBit mask forsetContextmethods indicating that local variables are to be included in the search.- See Also:
-
FIELD
public static final int FIELDBit mask forsetContextmethods indicating that fields are to be included in the search.- See Also:
-
PREDICATE
public static final int PREDICATEBit mask forsetContextmethods indicating that named predicates are to be included in the search.- See Also:
-
METHOD
public static final int METHODBit mask forsetContextmethods indicating that methods are to be included in the search.- See Also:
-
CONSTRUCTOR
public static final int CONSTRUCTORBit mask forsetContextmethods indicating that constructors are to be included in the search.- See Also:
-
TYPE
public static final int TYPEBit mask forsetContextmethods indicating that types are to be included in the search.- See Also:
-
SUB_PACKAGE
public static final int SUB_PACKAGEBit mask forsetContextmethods indicating that sub-packages of packages are to be included in the search.- See Also:
-
MAX_MEMBER
public static final int MAX_MEMBERLargest bit mask of the bit masks which select the type of members in question.- See Also:
-
MEMBER_MASK
public static final int MEMBER_MASKThis constant can be used as mask to filter the bit masks which represent member types.- See Also:
-
EXCLUDE_INTERFACES
public static final int EXCLUDE_INTERFACESBit mask forsetContextmethods indicating that interface are to be excluded from the search.- See Also:
-
EXCLUDE_TYPES_IN_PACKAGES
public static final int EXCLUDE_TYPES_IN_PACKAGESBit mask forsetContextmethods indicating that types as members of packages are to be excluded from the search.- See Also:
-
STATIC_ONLY
public static final int STATIC_ONLYBit mask forsetContextmethods indicating that only static members are to be included in the search.- See Also:
-
INSTANCE_ONLY
public static final int INSTANCE_ONLYBit mask forsetContextmethods indicating that only non-static members are to be included in the search.- See Also:
-
DECLARED_ONLY
public static final int DECLARED_ONLYBit mask forsetContextmethods indicating that only declared members are to be included in the search. This excludes members declared in supertypes and members imported by import-on-demand statements.- See Also:
-
TOP_LEVEL_PACKAGE
public static final int TOP_LEVEL_PACKAGEBit mask forsetContextmethods indicating that top-level packages are to be included in the search.- See Also:
-
SUPER
public static final int SUPERBit mask forsetContextmethods indicating that only members of the supertype of the context type are to be included in the search.- See Also:
-
FULLY_QUALIFIED
public static final int FULLY_QUALIFIED- See Also:
-
EXCLUDE_INSTANCE_SCOPES
public static final int EXCLUDE_INSTANCE_SCOPESBit mask forsetContextmethods indicating that instance scopes have to be excluded from the search.- See Also:
-
INCLUDE_FIRST_INSTANCE_SCOPE
public static final int INCLUDE_FIRST_INSTANCE_SCOPE- See Also:
-
OPERATOR_METHODS
public static final int OPERATOR_METHODS- See Also:
-
SHIFT_METHODS
public static final int SHIFT_METHODS- See Also:
-
DIFFERENT_PACKAGE
public static final int DIFFERENT_PACKAGEThis bit mask has to be set byScope.findMembers(String, int, Members)beforesuper.findMembersis invoked if the scope is related to another package than the package of the context.- See Also:
-
MIN_UNUSED
public static final int MIN_UNUSEDThis is the minimal bit mask which is not defined by this class.- See Also:
-
VARIABLE
public static final int VARIABLE- See Also:
-
-
Constructor Details
-
Members
-
-
Method Details
-
resetName
-
resetName
public void resetName(antlr.collections.AST id) -
reset
public void reset() -
addMatches
-
addMatches
-
getPosition
public antlr.collections.AST getPosition() -
add
-
getMemberName
-
getPackage
-
getQualifier
-
getContextScope
-
toString
-
size
public int size() -
getApplicability
-
resolve
- Throws:
RecognitionException
-
haveApplicable
public boolean haveApplicable() -
getScopeForResult
-
getMemberType
-
getMemberTypeDescription
-
getMembersDescription
-