Class StandardClass


public final class StandardClass extends ClassDeclaration

Standard Class.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • typeText

      public static StandardClass typeText
      The type text.
    • ENVIRONMENT

      public static StandardClass ENVIRONMENT
      The Standard Class ENVIRONMENT.
    • BASICIO

      public static StandardClass BASICIO
      The Standard Class BASICIO.
    • CLASS

      static StandardClass CLASS
      The Standard Class CLASS.
    • Infile

      public static StandardClass Infile
      The Standard Class Infile.
    • Printfile

      public static StandardClass Printfile
      The Standard Class Printfile.
    • CatchingErrors

      public static StandardClass CatchingErrors
      The Standard Class CatchingErrors.
    • UNIVERSE

      private static StandardClass UNIVERSE
      The Standard Class UNIVERSE.
    • File

      private static StandardClass File
      The Standard Class File.
    • Imagefile

      private static StandardClass Imagefile
      The Standard Class Imagefile.
    • Bytefile

      private static StandardClass Bytefile
      The Standard Class Bytefile.
    • Simset

      private static StandardClass Simset
      The Standard Class Simset.
    • Linkage

      private static StandardClass Linkage
      The Standard Class Linkage.
    • Simulation

      private static StandardClass Simulation
      The Standard Class Simulation.
    • Process

      private static StandardClass Process
      The Standard Class Process.
    • Drawing

      private static StandardClass Drawing
      The Standard Class Drawing.
  • Constructor Details

    • StandardClass

      private StandardClass(String className)
      Create a new StandardClass.
      Parameters:
      className - the class's name
    • StandardClass

      private StandardClass(String prefix, String className)
      Create a new StandardClass.
      Parameters:
      prefix - prefix class-identifier
      className - the class's name
    • StandardClass

      private StandardClass(String prefix, String className, Parameter... param)
      Create a new StandardClass.
      Parameters:
      prefix - prefix class-identifier
      className - the class's name
      param - the parameters
    • StandardClass

      public StandardClass()
      Default constructor used by Attribute File I/O
  • Method Details

    • edJavaClassName

      public String edJavaClassName()
      Description copied from class: DeclarationScope
      Utility to edit JavaClass'Name
      Overrides:
      edJavaClassName in class DeclarationScope
      Returns:
      the edited JavaClass'Name
    • INITIATE

      public static void INITIATE()
      Method to initiate all standard classes.
    • initTypeText

      private static void initTypeText()
      Initiate the The Type Text.
    • initUNIVERSE

      private static void initUNIVERSE()
      Initiate the Standard Class UNIVERSE
    • initRTObject

      private static void initRTObject()
      Initiate the Standard Class RTObject.
    • initENVIRONMENT

      private static void initENVIRONMENT()
      Initiate the Standard Class ENVIRONMENT.
    • initBASICIO

      private static void initBASICIO()

      Initiate the Standard Class BASICIO.

       ENVIRONMENT class BASICIO (INPUT_LINELENGTH, OUTPUT_LINELENGTH);
       integer INPUT_LINELENGTH, OUTPUT_LINELENGTH;
       begin ref (Infile) SYSIN; ref (Printfile) SYSOUT;
             ref (Infile)    procedure sysin;   sysin  :- SYSIN;
             ref (Printfile) procedure sysout;  sysout :- SYSOUT;
      
             procedure terminate_program;
             begin ... ;  goto STOP  end terminate_program;
      
                 class File 
            File class Imagefile
            File class Bytefile
       Imagefile class Infile
       Imagefile class Outfile
       Imagefile class Directfile
         Outfile class Printfile
        Bytefile class Inbytefile
        Bytefile class Outbytefile 
        Bytefile class Directbytefile
      
             SYSIN  :- new Infile("...");    ! Implementation-defined
             SYSOUT :- new Printfile("..."); ! files names;
             SYSIN.open(blanks(INPUT_LINELENGTH));
             SYSOUT.open(blanks(OUTPUT_LINELENGTH));
             inner;
       STOP: SYSIN.close;
             SYSOUT.close
       end BASICIO;
      
    • initCLASS

      private static void initCLASS()

      Initiate the Standard Class CLASS.

      Simula Stadard States: Fictituous outermost prefix Any class that has no (textually given) prefix is by definition prefixed by a fictitious class whose only attribute is:

      	          procedure detach; ... ;  (see 7.3.1)
      

      Thus every class object or instance of a prefixed block has this attribute.

    • initFile

      private static void initFile()

      Initiate the Standard Class File.

       class File(FILENAME); value FILENAME; text FILENAME;
       begin
          Boolean OPEN_;
          text procedure filename; filename:=copy(FILENAME);
          Boolean procedure isopen; isopen:=OPEN_;
          Boolean procedure setaccess(mode);  text mode; ... ;
       
          if FILENAME = notext then error("Illegal File Name");
       end File;      
      
    • initImagefile

      private static void initImagefile()

      Initiate the Standard Class Imagefile.

       File class Imagefile;
       begin text image;
          procedure setpos(i);  integer i;  image.setpos(i);
          integer procedure pos;     pos    := image.pos;
          Boolean procedure more;    more   := image.more;
          integer procedure length;  length := image.length;
       end Imagefile;
      
    • initInfile

      private static void initInfile()

      Initiate the Standard Class Infile.

       Imagefile class Infile;
       begin Boolean ENDFILE;
          Boolean procedure endfile;  endfile:= ENDFILE;
          Boolean procedure open(fileimage); text fileimage;
          Boolean procedure close;
          procedure inimage;
          Boolean procedure inrecord;
          character procedure inchar;
          Boolean procedure lastitem;
          text procedure intext(w); integer w;
          integer procedure inint;
          long real procedure inreal;
          integer procedure infrac;
      
          ENDFILE:= true
          ...
       end Infile;
      
    • initOutfile

      private static void initOutfile()

      Initiate the Standard Class Outfile.

       Imagefile class Outfile;
       begin
          Boolean procedure open(fileimage);  text fileimage;
          Boolean procedure close;
          procedure outimage;
          procedure outrecord;
          procedure breakoutimage;
          Boolean procedure checkpoint;
          procedure outchar(c); character c;
          procedure outtext(t); text t;
          text procedure FIELD(w); integer w;
          procedure outint(i,w); integer i,w;
          procedure outfix(r,n,w); long real r; integer n,w;
          procedure outreal(r,n,w); long real r; integer n,w;
          procedure outfrac(i,n,w); integer i,n,w;
      
         ... ;
      end Outfile;
      
    • initDirectfile

      private static void initDirectfile()

      Initiate the Standard Class Directfile.

       Imagefile class Directfile;
       begin   integer LOC, MAXLOC;  Boolean ENDFILE, LOCKED;
          integer procedure location;  location:= LOC;
          Boolean procedure endfile;   endfile := ENDFILE;
          Boolean procedure locked;    locked  := LOCKED;
          Boolean procedure open(fileimage); text fileimage; 
          Boolean procedure close;
          integer procedure lastloc;
          integer procedure maxloc;
          procedure locate(i); integer i;
          procedure inimage;
          procedure outimage;
          Boolean procedure deleteimage;
          character procedure inchar;
          integer procedure lock(t,i,j); real t; integer i,j;
          Boolean procedure unlock; 
          Boolean procedure checkpoint;
          Boolean procedure lastitem;
          text procedure intext;
          integer procedure inint;
          long real procedure inreal;
          integer procedure infrac;
          procedure outchar(c); character c;
          procedure outtext(t); text t;
          text procedure FIELD(w); integer w;
          procedure outint(i,w); integer i,w;
          procedure outfix(r,n,w);  long real r; integer n,w;
          procedure outreal(r,n,w); long real r; integer n,w;
          procedure outfrac(i,n,w); integer i,n,w;
      
          ENDFILE:= true
          ...
       end Directfile;
      
    • initPrintfile

      private static void initPrintfile()

      Initiate the Standard Class Printfile.

       Outfile class Printfile;
       begin integer LINE, LINES_PER_PAGE, SPACING, PAGE;
         integer procedure line; line := LINE;
         integer procedure page; page := PAGE;
         Boolean procedure open(fileimage); text fileimage; 
         Boolean procedure close; 
         integer procedure linesperpage(n); integer n; 
         procedure spacing(n); integer n; 
         procedure eject(n);  integer n; 
         procedure outimage;
         procedure outrecord;
      
         SPACING := 1;
         LINES_PER_PAGE := ... ;
         ...
       end Printfile;
      
    • initBytefile

      private static void initBytefile()

      Initiate the Standard Class Bytefile.

       file class Bytefile;
       begin short integer BYTESIZE;
          short integer procedure bytesize; bytesize := BYTESIZE;
      
       end Bytefile;
      
    • initInbytefile

      private static void initInbytefile()

      Initiate the Standard Class Inbytefile.

       Bytefile class Inbytefile;
       begin Boolean ENDFILE;
         Boolean procedure endfile; endfile:= ENDFILE;
         Boolean procedure open; 
         Boolean procedure close;
         short integer procedure inbyte;
         text procedure intext(t); text t; 
      
         ENDFILE:= true;
         ...
       end Inbytefile;
      
    • initOutbytefile

      private static void initOutbytefile()

      Initiate the Standard Class Outbytefile.

       Bytefile class Outbytefile;
       begin
         Boolean procedure open; 
         Boolean procedure close; 
         procedure outbyte(x); short integer x; 
         procedure outtext(t); text t; 
         Boolean procedure checkpoint; 
      
       end Outbytefile;
      
    • initDirectbytefile

      private static void initDirectbytefile()

      Initiate the Standard Class Directbytefile.

       Bytefile class Directbytefile;
       begin integer LOC, MAXLOC;  Boolean LOCKED;
         Boolean procedure endfile; endfile:=OPEN and then LOC>lastloc;
         integer procedure location; location := LOC;
         integer procedure maxloc; maxloc := MAXLOC;
         Boolean procedure locked; locked := LOCKED;
         Boolean procedure open; 
         Boolean procedure close; 
         integer procedure lastloc; 
         procedure locate(i); integer i; 
         short integer procedure inbyte; 
         procedure outbyte(x); short integer x; 
         Boolean procedure checkpoint; 
         integer procedure lock(t,i,j); real t; integer i,j; 
         Boolean procedure unlock; 
         procedure intext(t); text t; 
         procedure outtext(t); text t;
          ...
       end Directbytefile;
      
    • initSimset

      private static void initSimset()
      Initiate the Standard Class Simset.
    • initLinkage

      private static void initLinkage()
      Initiate the Standard Class Linkage.
    • initHead

      private static void initHead()
      Initiate the Standard Class Head.
    • initLink

      private static void initLink()
      Initiate the Standard Class Link.
    • initSimulation

      private static void initSimulation()
      Initiate the Standard Class Simulation.
    • initEVENT_NOTICE

      private static void initEVENT_NOTICE()
      Initiate the Standard Class EVENT_NOTICE.
    • initProcess

      private static void initProcess()
      Initiate the Standard Class Process.
    • initMAIN_PROGRAM

      private static void initMAIN_PROGRAM()
      Initiate the Standard Class MAIN_PROGRAM.
    • initCatchingErrors

      private static void initCatchingErrors()
      Initiate the Standard Class CatchingErrors.
    • initDEC_Lib

      private static void initDEC_Lib()
      Initiate the Standard Class DEC_Lib.
    • initDrawing

      private static void initDrawing()
      Initiate the Standard Class Drawing.
    • initShapeElement

      private static void initShapeElement()
      Initiate the Standard Class ShapeElement.
    • initTextElement

      private static void initTextElement()
      Initiate the Standard Class TextElement.
    • getRTBlockLevel

      public int getRTBlockLevel()
      Description copied from class: DeclarationScope
      Utility: Get Runtime BlockLevel.
      Overrides:
      getRTBlockLevel in class DeclarationScope
      Returns:
      true: the Runtime BlockLevel.
    • findVisibleAttributeMeaning

      public Meaning findVisibleAttributeMeaning(String ident)
      Description copied from class: DeclarationScope
      Find visible attribute's Meaning
      Overrides:
      findVisibleAttributeMeaning in class ClassDeclaration
      Parameters:
      ident - attribute identifier
      Returns:
      the resulting Meaning
    • findRemoteAttributeMeaning

      public Meaning findRemoteAttributeMeaning(String ident)
      Description copied from class: ClassDeclaration
      Find Remote Attribute's Meaning.
      Overrides:
      findRemoteAttributeMeaning in class ClassDeclaration
      Parameters:
      ident - attribute identifier
      Returns:
      the resulting Meaning
    • parameter

      private static Parameter parameter(String ident, Type type)
      Create a new Parameter.
      Parameters:
      ident - the identifier
      type - the type
      Returns:
      the newly created Parameter
    • parameter

      private static Parameter parameter(String ident, Type type, int kind)
      Create a new Parameter.
      Parameters:
      ident - the identifier
      type - the type
      kind - the parameter kind
      Returns:
      the newly created Parameter
    • parameter

      private static Parameter parameter(String ident, Type type, int kind, int nDim)
      Create a new Parameter.
      Parameters:
      ident - the identifier
      type - the type
      kind - the parameter kind
      nDim - number of dimensions for arrays
      Returns:
      the newly created Parameter
    • parameter

      private static Parameter parameter(String ident, int mode, Type type)
      Create a new Parameter.
      Parameters:
      ident - the identifier
      mode - the mode
      type - the type
      Returns:
      the newly created Parameter
    • parameter

      private static Parameter parameter(String ident, int kind, int mode, Type type)
      Create a new Parameter.
      Parameters:
      ident - the identifier
      kind - the parameter kind
      mode - the mode
      type - the type
      Returns:
      the newly created Parameter
    • addStandardClass

      private void addStandardClass(StandardClass standardClass)
      Add a StandardClass.
      Parameters:
      standardClass - the StandardClass
    • addStandardAttribute

      private void addStandardAttribute(Type type, String ident)
      Create and add a new standard attribute.
      Parameters:
      type - the attribute type
      ident - the attribute identifier
    • addStandardAttribute

      private void addStandardAttribute(Type type, String ident, Number value)
      Create and add a new constant standard attribute.
      Parameters:
      type - the attribute type
      ident - the attribute identifier
      value - the constant integer value
    • addStandardProcedure

      private void addStandardProcedure(int kind, Type type, String ident)
      Create and add a new StandardProcedure.
      Parameters:
      kind - the declaration kind
      type - the procedure's type
      ident - the procedure identifier
    • addStandardProcedure

      private void addStandardProcedure(int kind, Type type, String ident, Parameter... param)
      Create and add a new StandardProcedure.
      Parameters:
      kind - the declaration kind
      type - the procedure's type
      ident - the procedure identifier
      param - the parameters
    • addStandardProcedure

      private void addStandardProcedure(int kind, String[] mtdSet, Type type, String ident, Parameter... param)
      Create and add a new StandardProcedure.
      Parameters:
      kind - the declaration kind
      mtdSet - the set of Method Type Descriptors
      type - the procedure's type
      ident - the procedure identifier
      param - the parameters
    • getClassDesc

      public ClassDesc getClassDesc()
      Description copied from class: DeclarationScope
      Return the ClassDesc
      Overrides:
      getClassDesc in class DeclarationScope
      Returns:
      the ClassDesc