Module Simula

Class DeclarationList

All Implemented Interfaces:
Serializable, Cloneable, Iterable<Declaration>, Collection<Declaration>, List<Declaration>, RandomAccess, SequencedCollection<Declaration>

public final class DeclarationList extends Vector<Declaration>
Declaration List.

This is a utility class to hold local declaration lists in declaration scopes.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
See Also:
  • Field Details

    • identifier

      public final String identifier
      Identifier.
  • Constructor Details

    • DeclarationList

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

    • find

      public Declaration find(String identifier)
      Find a declaration in this DeclarationList
      Parameters:
      identifier - declaration identifier
      Returns:
      the resulting Declaration
    • add

      public boolean add(Declaration dcl)
      Add a declaration to this list.
      Specified by:
      add in interface Collection<Declaration>
      Specified by:
      add in interface List<Declaration>
      Overrides:
      add in class Vector<Declaration>
    • print

      public void print(String title)
      Utility print method.
      Parameters:
      title - the title