Module Simula

Class Declaration

java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.declaration.Declaration
Direct Known Subclasses:
ArrayDeclaration, DeclarationScope, ExternalDeclaration, Parameter, SimpleVariableDeclaration, VirtualMatch, VirtualSpecification

Declaration.
 
 Simula Standard: Chapter 5. Declarations
 
   declaration
      = simple-variable-declaration
      | array-declaration
      | switch-declaration
      | procedure-declaration
      | class-declaration
      | external-declaration
 
This class is prefix to DeclarationScope, ExternalDeclaration, Parameter, SimpleVariableDeclaration, VirtualSpecification, VirtualMatch, ArrayDeclaration

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • type

      public Type type
      The type
    • isProtected

      public ProtectedSpecification isProtected
      Indicates that this declaration is protected.
    • identifier

      public String identifier
      Simula Identifier from Source Text
    • externalIdent

      public String externalIdent
      External Identifier set by doChecking
    • declaredIn

      public DeclarationScope declaredIn
      The DeclarationScope in which this Declaration is defined.
    • declarationKind

      public Declaration.Kind declarationKind
      The declarationKind.
  • Constructor Details

    • Declaration

      protected Declaration(String identifier)
      Create a new Declaration.
      Parameters:
      identifier - the given identifier
  • Method Details

    • getJavaIdentifier

      public final String getJavaIdentifier()
      Returns the Java identifier for this declaration.
      Returns:
      the Java identifier for this declaration
    • modifyIdentifier

      protected void modifyIdentifier(String newIdentifier)
      Modify the identifier of this class.
      Parameters:
      newIdentifier - the new identifier
    • checkAlreadyDefined

      private void checkAlreadyDefined()
      Check if a declaration with this identifier is already defined.
    • parseDeclaration

      protected static boolean parseDeclaration(DeclarationList declarationList)
      Parse a declaration and add it to the given declaration list.
      Parameters:
      declarationList - the given declaration list
      Returns:
      true if a declaration was found, false otherwise
    • isCompatibleClasses

      public boolean isCompatibleClasses(Declaration other)
      Check if these classes are compatible.
      Parameters:
      other - the other ClassDeclaration
      Returns:
      the resulting boolean value