Module xl.compiler

Class Package

java.lang.Object
de.grogra.xl.compiler.scope.Scope
de.grogra.xl.compiler.scope.Package
All Implemented Interfaces:
Member

public class Package extends Scope implements Member
  • Constructor Details

  • Method Details

    • getDeclaredEntity

      public Member getDeclaredEntity()
      Overrides:
      getDeclaredEntity in class Scope
    • getPackage

      public final Package getPackage()
      Description copied from class: Scope
      Returns the innermost enclosing scope of class Package, or null. May be this.
      Overrides:
      getPackage in class Scope
      Returns:
      innermost Package scope
    • findMembers

      public void findMembers(String name, int flags, Members list)
      Description copied from class: Scope
      Finds all members which are declared in this scope or enclosing scopes. This method should be overwritten by subclasses; an invocation of super.findMembers has to be included in order to look for members in enclosing scopes. The flags are a combination of the bit masks defined in Members, they are used to restrict the range of possible members.
      Overrides:
      findMembers in class Scope
      Parameters:
      name - simple name of the members to find
      flags - combination of masks defined in Members
      list - found members are added to this list
    • declareType

      public void declareType(Type type)
    • findDeclaredType

      public Type findDeclaredType(String name)
    • findType

      public Type findType(String name)
    • loadType

      protected Type loadType(String name)
    • getCanonicalName

      public final String getCanonicalName(String member)
    • contains

      public final boolean contains(Member m)
    • getDeclaringType

      public final Type getDeclaringType()
      Description copied from interface: Member
      Returns the declaring type of which this is a member. May be null if such a type does not exist.
      Specified by:
      getDeclaringType in interface Member
      Returns:
      this member's declaring type
    • getModifiers

      public final int getModifiers()
      Description copied from interface: Member
      Returns the modifiers of this member as a combination of the bit masks which are defined in this interface.
      Specified by:
      getModifiers in interface Member
      Returns:
      modifiers of this member
    • getName

      public final String getName()
      Description copied from interface: Member
      Returns the name of this member. For types, this is the canonical name of the type, e.g, java.lang.Object, java.util.Map.Entry. Otherwise, it equals Member.getSimpleName().
      Specified by:
      getName in interface Member
      Returns:
      name of the member
    • getSimpleName

      public final String getSimpleName()
      Description copied from interface: Member
      Returns the simple name of this member. This is the single identifier with which the member is declared in source code, e.g., Object, out, println.
      Specified by:
      getSimpleName in interface Member
      Returns:
      simple name of the member
    • getDescriptor

      public final String getDescriptor()
      Description copied from interface: Member
      Returns a descriptor for this member. Descriptors are constructed as follows:
      • For types, descriptors are defined as for the Java Virtual Machine. For primitive types these are the single characters 'Z', 'B', 'S', 'C', 'I', 'J', 'F', 'D', 'V' for boolean, byte, short, char, int, long, float, double, void. For array types, the descriptor is the character '[' plus the descriptor of its component type, e.g., [[I for int[][]. For non-array reference types, the descriptor is the character 'L', followed by the binary name (see Type.getBinaryName()) of the type, where '.' has to be replaced by '/', followed by ';', e.g., Ljava/lang/Object;.
      • For fields, the descriptor is the character 'f', followed by the simple name of the field, followed by the character ';', followed by the descriptor of the field's type. E.g., fout;Ljava/io/PrintStream; for the field System.out.
      • For methods and constructors, the descriptor is the character 'm', followed by the simple name of the method (which is <init> for constructors), followed by the characters ';' and '(', followed by the descriptors of the method's parameter types, followed by ')', followed by the descriptor of the return type. E.g. mprintln;(Ljava/lang/String;)V for the method PrintStream.println(String).
      Specified by:
      getDescriptor in interface Member
      Returns:
      the member's descriptor
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • getDeclaredAnnotationCount

      public int getDeclaredAnnotationCount()
      Specified by:
      getDeclaredAnnotationCount in interface Member
    • getDeclaredAnnotation

      public Annotation getDeclaredAnnotation(int index)
      Specified by:
      getDeclaredAnnotation in interface Member