Class ProtectedSpecification

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

public final class ProtectedSpecification extends SyntaxClass

Protected 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

  • Constructor Details

    • ProtectedSpecification

      public ProtectedSpecification(ClassDeclaration definedIn, String identifier)
      Create a new ProtectedSpecification.
      Parameters:
      definedIn - the class it is defined in
      identifier - the protected identifier
    • ProtectedSpecification

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

    • getAttribute

      private Declaration getAttribute()
      Returns the Attribute being Protected.
      Returns:
      the Attribute being Protected
    • getVirtualSpecification

      private VirtualSpecification getVirtualSpecification()

      Returns the virtual specification or null.

      The Attribute being Protected may be Virtual.

      Returns:
      the virtual specification or null
    • doChecking

      public void doChecking()
      Perform semantic checking.
      Overrides:
      doChecking in class SyntaxClass
    • 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 ProtectedSpecification readObject(AttributeInputStream inpt) throws IOException
      Read and return a ProtectedSpecification object.
      Parameters:
      inpt - the AttributeInputStream to read from
      Returns:
      the object read from the stream.
      Throws:
      IOException - if something went wrong.