Module Simula

Class SourceFileReader

java.lang.Object
simula.compiler.parsing.SourceFileReader

public final class SourceFileReader extends Object
Utility class SourceFileReader.

Input Utilities for the Simula Scanner.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • stack

      private final Stack<Reader> stack
      The stack of readers
    • current

      private Reader current
      The current Reader
    • nameStack

      private final Stack<String> nameStack
      The stack of file names
    • lineStack

      private final Stack<Integer> lineStack
      The stack of line numbers
  • Constructor Details

    • SourceFileReader

      SourceFileReader(Reader reader)
      Create a new SourceFileReader.
      Parameters:
      reader - the initial underlying Reader
  • Method Details

    • read

      int read()
      Read next character.
      Returns:
      next character
    • insert

      void insert(File file)
      Insert a file.
      Parameters:
      file - the file to be inserted
    • forceEOF

      void forceEOF()
      Force EOF on the current underlying reader.
    • close

      void close()
      Close this source file reader