Module Simula

Class Directive

java.lang.Object
simula.compiler.parsing.Directive

public class Directive extends Object
Utility class Directive.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Constructor Details

    • Directive

      Directive()
      Default constructor.
  • Method Details

    • treatDirectiveLine

      static void treatDirectiveLine(SimulaScanner scanner, String id, String arg)
      Treat a directive line.
      Parameters:
      scanner - the scanner
      id - the directive identifier
      arg - the directive argument
    • insert

      private static void insert(SimulaScanner scanner, String fileName)
      %INSERT file-name

      Will cause the compiler to include the indicated file at this place in the source input stream. INSERT may occur in the included file. In contrast to COPY, the included lines are not counted (they will all be numbered with the line number of the line containing the outermost INSERT). Furthermore, if the source is being listed, listing is turned off during the inclusion and turned on again when reading continues after this directive.

      Parameters:
      scanner - the SimulaScanner
      fileName - the file to insert
    • page

      private static void page()
      %PAGE

      Will cause the compiler to change to a new page in the listing file. If the page heading (as defined by %TITLE, see below) is non-empty, it will be printed on top of the new page.

    • setOption

      private static void setOption()
      %OPTION name value

      Will set compiler switch 'name' to the value 'value'. The facility is intended for compiler maitenance, and is not explained further.

    • setSport

      private static void setSport(String onoff)
      %SPORT ON / OFF

      Enables/disables special S-Port Simula features, such as inclusion of the S-Port Library.

      The initial value is ON.

      Parameters:
      onoff - the on/off string
    • eof

      private static void eof(SimulaScanner scanner)
      %EOF
      Parameters:
      scanner - the SimulaScanner
    • setTitle

      private static void setTitle(String title)
      %TITLE title-string
      Parameters:
      title - title string
    • setKeepJava

      private static void setKeepJava(String dir)
      %KEEP_JAVA directory-string
      Parameters:
      dir - directory-string