Module Simula

Class DeclarationScope

Direct Known Subclasses:
BlockDeclaration, ConnectionBlock

public abstract sealed class DeclarationScope extends Declaration permits BlockDeclaration, ConnectionBlock
Declaration Scope.

This class is prefix to BlockDeclaration and ConnectionBlock, and superclass of ClassDeclaration, ProcedureDeclaration and MaybeBlockDeclaration.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • currentRTBlockLevel

      protected static int currentRTBlockLevel
      Current Runtime Block level - Used during doChecking
    • sourceBlockLevel

      public int sourceBlockLevel
      The source block level. Set during Parsing.
    • ctBlockLevel

      public int ctBlockLevel
      The Compile time block level. Set during doChecking.
    • rtBlockLevel

      public int rtBlockLevel
      The Runtime block level. Set during doChecking.
    • hasLocalClasses

      public boolean hasLocalClasses
      Indicate if this scope has local classes.
    • declarationList

      public DeclarationList declarationList
      The declaration list.
    • labelList

      public Vector<LabelDeclaration> labelList
      The label list.
  • Constructor Details

    • DeclarationScope

      protected DeclarationScope(String ident)
      Create a new DeclarationScope.
      Parameters:
      ident - scope identifier
  • Method Details

    • scopeID

      public String scopeID()
      Returns a printable scope ID.
      Returns:
      a printable scope ID
    • findVisibleAttributeMeaning

      public Meaning findVisibleAttributeMeaning(String ident)
      Find visible attribute's Meaning
      Parameters:
      ident - attribute identifier
      Returns:
      the resulting Meaning
    • findMeaning

      public Meaning findMeaning(String identifier)
      Find Meaning
      Parameters:
      identifier - declared identifier
      Returns:
      the resulting Meaning
    • findLabelMeaning

      public Meaning findLabelMeaning(String identifier)
      Find Label's Meaning
      Parameters:
      identifier - declared label identifier
      Returns:
      the resulting Meaning
    • findProcedure

      public ProcedureDeclaration findProcedure(String identifier)
      Follow Static Chain Looking for a Procedure named 'identifier'
      Parameters:
      identifier - the procedure identifier
      Returns:
      the resulting ProcedureDeclaration
    • edCTX

      public String edCTX()
      Coding utility: Edit current context chain.
      Returns:
      edited context chain
    • edCTX

      public static String edCTX(int ctxDiff)
      Coding utility: Edit context chain.
      Parameters:
      ctxDiff - block level difference.
      Returns:
      edited context chain
    • edScopeChain

      public String edScopeChain()
      Edit scope chain.
      Returns:
      edited scope chain
    • edJavaClassName

      protected String edJavaClassName()
      Utility to edit JavaClass'Name
      Returns:
      the edited JavaClass'Name
    • printDeclarationList

      protected void printDeclarationList(int indent)