Class AttributeInputStream

java.lang.Object
simula.compiler.AttributeInputStream

public class AttributeInputStream extends Object

Attribute input stream.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • moduleID

      String moduleID
      The module ident.
    • inpt

      The underlying DataInputStream.
    • jarFileName

      public String jarFileName
      The jarFile being read.
    • objectReference

      public ObjectReferenceMap objectReference
      The Object Reference Table. Used during Attribute File Input to fixup Object References.
    • TRACE

      private boolean TRACE
      Debug utility.
  • Constructor Details

    • AttributeInputStream

      public AttributeInputStream(InputStream inpt, String jarFileName) throws IOException
      Creates a new AttributeInputStream to read data from the specified InputStream.
      Parameters:
      inpt - the underlying InputStream.
      jarFileName - the name of the jarFile containing this Attribute file.
      Throws:
      IOException - if an I/O error occurs.
  • Method Details

    • close

      public void close() throws IOException
      Closes this AttributeInputStream.
      Throws:
      IOException - if an I/O error occurs.
    • readKind

      public int readKind() throws IOException
      Reads and returns a kind code from the underlying DataInputStream.
      Returns:
      the kind code read.
      Throws:
      IOException - if an I/O error occurs.
    • readType

      public Type readType() throws IOException
      Reads and returns a type from the underlying DataInputStream.
      Returns:
      the type read.
      Throws:
      IOException - if an I/O error occurs.
    • readBoolean

      public boolean readBoolean() throws IOException
      Reads and returns a boolean from the underlying DataInputStream.
      Returns:
      the boolean read.
      Throws:
      IOException - if an I/O error occurs.
    • readShort

      public int readShort() throws IOException
      Reads and returns a short from the underlying DataInputStream.
      Returns:
      the short read.
      Throws:
      IOException - if an I/O error occurs.
    • readConstant

      public Object readConstant() throws IOException
      Reads and returns a typed constant from the underlying DataInputStream.
      Returns:
      the typed constant read.
      Throws:
      IOException - if an I/O error occurs.
    • readString

      public String readString() throws IOException
      Reads and returns a String from the underlying DataInputStream.
      Returns:
      the String read.
      Throws:
      IOException - if an I/O error occurs.
    • readObjectList

      public ObjectList<?> readObjectList() throws IOException
      Reads and returns an Object list from the underlying DataInputStream.
      Returns:
      the Object list read.
      Throws:
      IOException - if an I/O error occurs.
    • readSEQU

      public int readSEQU(SyntaxClass obj) throws IOException
      Reads and returns an Object sequence number from the underlying DataInputStream.
      Parameters:
      obj - the corresponding SyntaxClass object.
      Returns:
      the Object sequence number read.
      Throws:
      IOException - if an I/O error occurs.
    • readObj

      public SyntaxClass readObj() throws IOException
      Reads and returns an Object from the underlying DataInputStream.
      Returns:
      the Object read.
      Throws:
      IOException - if an I/O error occurs.
    • readObj

      private SyntaxClass readObj(int kind, AttributeInputStream inpt) throws IOException
      Read and return an object.
      Parameters:
      kind - the object kind code.
      inpt - the AttributeInputStream to read from.
      Returns:
      the object read from the stream.
      Throws:
      IOException - if something went wrong.