Class HiddenSpecification

java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.HiddenSpecification

public final class HiddenSpecification extends SyntaxClass

Hidden Specification.

Syntax: 
    protection-specification
        = hidden identifier-list
        | protected identifier-list
        | hidden protected identifier-list
        | protected hidden identifier-list

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • identifier

      public String identifier
      The hidden identifier.
    • definedIn

      ClassDeclaration definedIn
      The class in which this HiddenSpecification occur.
    • protectedBy

      private ProtectedSpecification protectedBy
      The ProtectedSpecification set during doChecking
  • Constructor Details

    • HiddenSpecification

      public HiddenSpecification(ClassDeclaration definedIn, String identifier)
      Create a new HiddenSpecification.
      Parameters:
      definedIn - the class where Hidden is specified
      identifier - the hidden identifier
    • HiddenSpecification

      private HiddenSpecification()
      Default constructor used by Attribute File I/O
  • Method Details

    • getProtectedBy

      private ProtectedSpecification getProtectedBy()
      Returns the ProtectedSpecification which protect this hidden.
      Returns:
      the ProtectedSpecification which protect this hidden.
    • doChecking

      public void doChecking()
      Utility: Perform semantic checking. Called from ClassDeclaration.checkHiddenList.
      Overrides:
      doChecking in class SyntaxClass
    • getMatchingProtected

      private ProtectedSpecification getMatchingProtected()
      Utility: Find protected attribute and update pointers.
      Returns:
      the resulting ProtectedSpecification
    • getScopeBehindHidden

      public ClassDeclaration getScopeBehindHidden()
      Utility: getScopeBehindHidden -- Search backwards from 'hidden' ...
      Returns:
      the ClassDeclaration found
    • findHidden

      private static HiddenSpecification findHidden(ClassDeclaration scope, String ident)
      Utility: findHidden -- Search scope's hidden-list for 'ident'
      Parameters:
      scope - the given scope
      ident - the given ident
      Returns:
      the resulting HiddenSpecification
    • printTree

      public void printTree(int indent, Object head)
      Description copied from class: SyntaxClass
      Utility print syntax tree method.
      Overrides:
      printTree in class SyntaxClass
      Parameters:
      indent - number of spaces leading the lines
      head - the head of the tree.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • writeObject

      public void writeObject(AttributeOutputStream oupt) throws IOException
      Description copied from class: SyntaxClass
      Write a SyntaxClass object to a AttributeOutputStream.
      Overrides:
      writeObject in class SyntaxClass
      Parameters:
      oupt - the AttributeOutputStream to write to.
      Throws:
      IOException - if something went wrong.
    • readObject

      public static HiddenSpecification readObject(AttributeInputStream inpt) throws IOException
      Read and return a HiddenSpecification object.
      Parameters:
      inpt - the AttributeInputStream to read from
      Returns:
      the object read from the stream.
      Throws:
      IOException - if something went wrong.