Class SysEdit

java.lang.Object
svm.env.SysEdit

public abstract class SysEdit extends Object

Editing Routines

Link to GitHub: Source File.

Author:
Simula Standard, S-Port: The Environment Interface, Øystein Myhre Andersen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final char
    Unicode minus sign.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    private static String
    Utility method addPlussExponent.
    static void
    Put general address
    static void
    Put object address
    static void
    Put program address
    static void
    Put routine address
    static void
    Put relative attribute address
    static void
    Put fix point reak
    private static String
    putfix(double r, int n)
    Utility method putfix.
    private static String
    putfix(float r, int n)
    Utility method putfix.
    static void
    Put fix point real
    static void
    Put grouped item
    private static String
    putfrac(int val, int n)
    Utility method putfrac.
    static void
    Put hexadecimal integer item
    static void
    Put integer item
    static void
    Put integer item
    static void
    Put fix point long real
    static void
    Put fix point long real
    static void
    Put long real item
    static void
    Put long real item
    static void
    Put real item
    private static String
    putreal(double r, int n)
    Utility method putreal.
    private static String
    putreal(float r, int n)
    Utility method putreal.
    static void
    Put real item
    static void
    Put size item
    static void
    Put string

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UNICODE_MINUS_SIGN

      private static final char UNICODE_MINUS_SIGN
      Unicode minus sign. See: https://en.wikipedia.org/wiki/Plus_and_minus_signs
      See Also:
  • Constructor Details

    • SysEdit

      public SysEdit()
      Default Constructor
  • Method Details

    • putint

      public static void putint()

      Put integer item

      Visible sysroutine("PUTINT") PUTINT;
      import infix (string) item; integer val: end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ...
      

      The value of the parameter 'val' is converted to an INTEGER ITEM which designates an integer equal to that value and moved into the given String 'item'.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

    • putint2

      public static void putint2()

      Put integer item

      Visible sysroutine("PUTINT2") PUTINT2;
      import infix (string) item; integer val
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ..., lng
      

      The value of the parameter 'val' is converted to an INTEGER ITEM which designates an integer equal to that value and moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the INTEGER ITEM is pushed onto the Runtime stack.

    • putfrac

      public static void putfrac()

      Put grouped item

      Visible sysroutine("PTFRAC") PTFRAC;
      import infix (string) item; integer val, n; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, n →
         ...
      

      The value of the parameter 'val' is converted to a GROUPED ITEM which is moved into the given String 'item'.

      The resulting numeric item is a GROUPED ITEM with no DECIMAL MARK if n<=0, and with a DECIMAL MARK followed by total of n digits if n>0.

      Each digit group consists of 3 digits, except possibly the first one, and possibly the last one following a DECIMAL MARK.

      The resulting GROUPED ITEM is moved into the given String 'item'.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

    • putreal

      public static void putreal()

      Put real item

      Visible sysroutine("PTREAL") PTREAL;
      import infix (string) item; real val; integer frac; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, frac →
         ...
      

      The resulting numeric item is a REAL ITEM containing an EXPONENT with a fixed implementation-defined number of characters. The EXPONENT is preceded by a SIGN PART if n=0, or by an INTEGER ITEM with one digit if n=1, or if n>1, by a DECIMAL ITEM with an INTEGER ITEM of 1 digit only, and a fraction of n-1 digits.

      If n<0 a runtime error is caused.

      The resulting REAL ITEM is moved into the given String 'item'.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

    • putreal2

      public static void putreal2()

      Put real item

      Visible sysroutine("PTREAL2") PTREAL2;
      import infix (string) item; integer val; integer frac;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, frac →
         ..., lng
      

      The resulting numeric item is a REAL ITEM containing an EXPONENT with a fixed implementation-defined number of characters. The EXPONENT is preceded by a SIGN PART if n=0, or by an INTEGER ITEM with one digit if n=1, or if n>1, by a DECIMAL ITEM with an INTEGER ITEM of 1 digit only, and a fraction of n-1 digits.

      If n<0 a runtime error is caused.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

      The length of the REAL ITEM is pushed onto the Runtime stack.

    • putlreal

      public static void putlreal()

      Put long real item

      Visible sysroutine("PLREAL") PLREAL;
      import infix (string) item; real val; integer frac; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, frac →
         ...
      

      The resulting numeric item is a REAL ITEM containing an EXPONENT with a fixed implementation-defined number of characters. The EXPONENT is preceded by a SIGN PART if n=0, or by an INTEGER ITEM with one digit if n=1, or if n>1, by a DECIMAL ITEM with an INTEGER ITEM of 1 digit only, and a fraction of n-1 digits.

      If n<0 a runtime error is caused.

      The resulting REAL ITEM is moved into the given String 'item'.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

    • putlreal2

      public static void putlreal2()

      Put long real item

      Visible sysroutine("PLREAL2") PLREAL2;
      import infix (string) item; integer val; integer frac;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, frac →
         ..., lng
      

      The resulting numeric item is a REAL ITEM containing an EXPONENT with a fixed implementation-defined number of characters. The EXPONENT is preceded by a SIGN PART if n=0, or by an INTEGER ITEM with one digit if n=1, or if n>1, by a DECIMAL ITEM with an INTEGER ITEM of 1 digit only, and a fraction of n-1 digits.

      If n<0 a runtime error is caused.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

      The length of the REAL ITEM is pushed onto the Runtime stack.

    • putfix

      public static void putfix()

      Put fix point reak

      Visible sysroutine("PUTFIX") PUTFIX;
      import infix (string) item; real val; integer frac; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, frac →
         ...
      

      The resulting numeric item is an INTEGER ITEM if n=0 or a DECIMAL ITEM with a FRACTION of n digits if n>0. It designates a number equal to the value of r or an approximation to the value of r, correctly rounded to n decimal places.

      If n<0 a runtime error is caused.

      The resulting ITEM is moved into the given String 'item'.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

    • putfix2

      public static void putfix2()

      Put fix point real

      Visible sysroutine("PUTFIX2") PUTFIX2;
      import infix (string) item; real val; integer frac;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, frac →
         ..., lng
      

      The resulting numeric item is an INTEGER ITEM if n=0 or a DECIMAL ITEM with a FRACTION of n digits if n>0. It designates a number equal to the value of r or an approximation to the value of r, correctly rounded to n decimal places.

      If n<0 a runtime error is caused.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

      The length of the ITEM is pushed onto the Runtime stack.

    • putlfix

      public static void putlfix()

      Put fix point long real

      Visible sysroutine("PTLFIX") PTLFIX;
      import infix (string) item; real val; integer frac; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, frac →
         ...
      

      The resulting numeric item is an INTEGER ITEM if n=0 or a DECIMAL ITEM with a FRACTION of n digits if n>0. It designates a number equal to the value of r or an approximation to the value of r, correctly rounded to n decimal places.

      If n<0 a runtime error is caused.

      The resulting ITEM is moved into the given String 'item'.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

    • putlfix2

      public static void putlfix2()

      Put fix point long real

      Visible sysroutine("PTLFIX2") PTLFIX2;
      import infix (string) item; real val; integer frac;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val, frac →
         ..., lng
      

      The resulting numeric item is an INTEGER ITEM if n=0 or a DECIMAL ITEM with a FRACTION of n digits if n>0. It designates a number equal to the value of r or an approximation to the value of r, correctly rounded to n decimal places.

      If n<0 a runtime error is caused.

      If the string is too short to contain the numeric item then this will be signaled through the global variable 'status'.

      The length of the ITEM is pushed onto the Runtime stack.

    • puthex

      public static void puthex()

      Put hexadecimal integer item

      Visible sysroutine("PUTHEX") PUTHEX;
      import infix (string) item; int val;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ..., lng
      

      The value of the parameter 'val' is converted to an HEX ITEM and moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the ITEM is pushed onto the Runtime stack.

    • putsize

      public static void putsize()

      Put size item

      Visible sysroutine("PUTSIZE") PUTSIZE;
      import infix (string) item; size val;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ..., lng
      

      The value of the parameter 'val' is converted to an SIZE ITEM and moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the ITEM is pushed onto the Runtime stack.

    • putstr

      public static void putstr()

      Put string

      Visible sysroutine("PUTSTR") PUTSTR;
      import infix (string) item; size val;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ..., lng
      

      The value of the parameter 'val' is moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the String 'val' is pushed onto the Runtime stack.

    • ptoadr2

      public static void ptoadr2()

      Put object address

      Visible sysroutine("PTOADR2") PTOADR2;
      import infix (string) item; ref() val;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ..., lng
      

      The value of the parameter 'val' is converted to an OADDR ITEM and moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the ITEM is pushed onto the Runtime stack.

    • ptpadr2

      public static void ptpadr2()

      Put program address

      Visible sysroutine("PTPADR2") PTPADR2;
      import infix (string) item; label val;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ..., lng
      

      The value of the parameter 'val' is converted to an PADDR ITEM and moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the ITEM is pushed onto the Runtime stack.

    • ptradr2

      public static void ptradr2()

      Put routine address

      Visible sysroutine("PTRADR2") PTRADR2;
      import infix (string) item; entry() val;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ..., lng
      

      The value of the parameter 'val' is converted to an RADDR ITEM and moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the ITEM is pushed onto the Runtime stack.

    • ptaadr2

      public static void ptaadr2()

      Put relative attribute address

      Visible sysroutine("PTAADR2") PTAADR2;
      import infix (string) item; entry() val;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val →
         ..., lng
      

      The value of the parameter 'val' is converted to an AADDR ITEM and moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the ITEM is pushed onto the Runtime stack.

    • ptgadr2

      public static void ptgadr2()

      Put general address

      Visible sysroutine("PTGADR2") PTGADR2;
      import infix (string) item; name() val;
      export integer lng; end;
      
      Runtime Stack
         ..., item'addr, item'nchr, val'addr, val'ofst →
         ..., lng
      

      The value of the parameter 'val' is converted to an GADDR ITEM and moved into the given String 'item'.

      If the string is too short to contain the numeric item then error.

      The length of the ITEM is pushed onto the Runtime stack.

    • putfix

      private static String putfix(double r, int n)

      Utility method putfix.

      The resulting numeric item is an INTEGER ITEM if n=0 or a DECIMAL ITEM with a FRACTION of n digits if n>0. It designates a number equal to the value of r or an approximation to the value of r, correctly rounded to n decimal places. If n<0, a run-time error is caused.

      Parameters:
      r - the long real value to be edited
      n - the number of digits after decimal sign
      Returns:
      the edited value
    • putfix

      private static String putfix(float r, int n)

      Utility method putfix.

      The resulting numeric item is an INTEGER ITEM if n=0 or a DECIMAL ITEM with a FRACTION of n digits if n>0. It designates a number equal to the value of r or an approximation to the value of r, correctly rounded to n decimal places. If n<0, a run-time error is caused.

      Parameters:
      r - the real value to be edited
      n - the number of digits after decimal sign
      Returns:
      the edited value
    • putreal

      private static String putreal(double r, int n)

      Utility method putreal.

      The resulting numeric item is a REAL ITEM containing an EXPONENT with a fixed implementation-defined number of characters. The EXPONENT is preceded by a SIGN PART if n=0, or by an INTEGER ITEM with one digit if n=1, or if n>1, by a DECIMAL ITEM with an INTEGER ITEM of 1 digit only, and a fraction of n-1 digits. If n<0 a runtime error is caused.

      Parameters:
      r - the long real value to be edited
      n - the number of digits after decimal sign
      Returns:
      the edited value
    • putreal

      private static String putreal(float r, int n)

      Utility method putreal.

      The resulting numeric item is a REAL ITEM containing an EXPONENT with a fixed implementation-defined number of characters. The EXPONENT is preceded by a SIGN PART if n=0, or by an INTEGER ITEM with one digit if n=1, or if n>1, by a DECIMAL ITEM with an INTEGER ITEM of 1 digit only, and a fraction of n-1 digits. If n<0 a runtime error is caused.

      Parameters:
      r - the real value to be edited
      n - the number of digits after decimal sign
      Returns:
      the edited value
    • putfrac

      private static String putfrac(int val, int n)

      Utility method putfrac.

      The resulting numeric item is a GROUPED ITEM with no DECIMAL MARK if n<=0, and with a DECIMAL MARK followed by total of n digits if n>0.

      Each digit group consists of 3 digits, except possibly the first one, and possibly the last one following a DECIMAL MARK.

      Parameters:
      val - an integer value
      n - number of digits after a decimal mark
      Returns:
      the edited value
    • addPlussExponent

      private static String addPlussExponent(String s)
      Utility method addPlussExponent. Add plus exponent to the given string
      Parameters:
      s - the given string
      Returns:
      the resulting string