Module Simula

Class Global

java.lang.Object
simula.compiler.utilities.Global

public final class Global extends Object
Global Variables.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • simulaReleaseID

      public static final String simulaReleaseID
      The Simula release identification.

      NOTE: When updating release id, change version in SimulaExtractor and RuntimeSystem

      See Also:
    • simIcon

      public static ImageIcon simIcon
      A Simula icon
    • sIcon

      static ImageIcon sIcon
      A Simula icon
    • MAX_WORKSPACE

      private static final int MAX_WORKSPACE
      Max number of work spaces.
      See Also:
    • simulaHome

      public static File simulaHome
      The Simula Home directory.
    • simulaVersion

      public static String simulaVersion
      The Simula Version
    • externalJarFiles

      public static Vector<File> externalJarFiles
      The set of external .jar files.
    • _CHARSET

      public static Charset _CHARSET
      The current Charset.
    • sourceLineNumber

      public static int sourceLineNumber
      The current source line number.
    • sourceFileDir

      public static File sourceFileDir
      The source file's directory.
    • sourceFileName

      public static String sourceFileName
      The source file name.
    • sourceName

      public static String sourceName
      The source file name without .sim
    • insertName

      public static String insertName
      The insert name.
    • simulaRtsLib

      public static File simulaRtsLib
      Where to find the Simula Runtime System.
    • simulaPropertiesFile

      public static File simulaPropertiesFile
      The Simula properties file
    • simulaProperties

      private static Properties simulaProperties
      The Simula properties
    • sampleSourceDir

      public static File sampleSourceDir
      The sample source directory. Where to find sample Simula files
    • currentWorkspace

      public static File currentWorkspace
      Current workspace. Where to find .sim source files
    • workspaces

      public static ArrayDeque<File> workspaces
      The set of workspaces
    • outputDir

      public static File outputDir
      The output directory. Used by Java-Coding to save the generated .jar files.
    • extLib

      public static File extLib
      The external library. Used by ExternalDeclaration.readAttributeFile
    • duringParsing

      public static boolean duringParsing
      Compiler state: True while Parsing
    • duringChecking

      public static boolean duringChecking
      Compiler state: True while Checking
    • duringSTM_Coding

      public static boolean duringSTM_Coding
      Compiler state: True while generating STM code
    • simulaTempDir

      public static File simulaTempDir
      The Simula temp directory
    • tempJavaFileDir

      public static File tempJavaFileDir
      Temp directory for generated .java files
    • tempClassFileDir

      public static File tempClassFileDir
      Temp directory for generated .class files
    • packetName

      public static String packetName
      Packet name used in generated .java files. NOTE: Must be a single identifier.
    • currentJavaModule

      public static GeneratedJavaClass currentJavaModule
      Current Java output Module. Maintained by JavaModule during Java Coding
    • generatedJavaClass

      public static Vector<GeneratedJavaClass> generatedJavaClass
      The set of generated Java files
    • console

      public static ConsolePanel console
      The console
    • scopeStack

      private static Stack<DeclarationScope> scopeStack
      The declaration scope stack.
    • currentScope

      private static DeclarationScope currentScope
      Current declaration scope. Maintained during Checking and Coding
    • currentCTBlockLevel

      private static int currentCTBlockLevel
      Current CompileTime Block level.
    • simulaWorkspacesFile

      private static File simulaWorkspacesFile
      The Simula workspace .xml file.
    • simulaWorkspaces

      private static Properties simulaWorkspaces
      The Simula workspace properties.
  • Constructor Details

    • Global

      Global()
      Default constructor.
  • Method Details

    • initiate

      public static void initiate()
      Initiate Global variables.
    • getCurrentScope

      public static DeclarationScope getCurrentScope()
      Returns the current scope.
      Returns:
      the current scope
    • setScope

      public static void setScope(DeclarationScope scope)
      During Parsing: Set current scope.
      Parameters:
      scope - the new scope
    • enterScope

      public static void enterScope(DeclarationScope scope)
      During Checking and Coding: Enter declaration scope.
      Parameters:
      scope - the new current scope
    • exitScope

      public static void exitScope()
      During Checking and Coding: Exit declaration scope.
    • getTempFileDir

      public static File getTempFileDir(String subDir)
      Returns a temp file directory.
      Parameters:
      subDir - the wanted sub-directory name
      Returns:
      a temp file directory
    • setAccessRWX

      private static void setAccessRWX(File dir)
      Utility: Set read-write-execute access on a directory
      Parameters:
      dir - the directory
    • trySetOutputDir

      public static void trySetOutputDir(File dir)
      Try set Global.outputDir
      Parameters:
      dir - a directory
    • initSimulaProperties

      public static void initSimulaProperties()
      Initiate Simula properties.
    • getSimulaProperty

      public static String getSimulaProperty(String key, String defaultValue)
      Returns a Simula property.
      Parameters:
      key - property key
      defaultValue - default value
      Returns:
      a Simula property
    • getSimulaPropertiesFile

      private static File getSimulaPropertiesFile()
      Returns the simula properties .xml file
      Returns:
      the simula properties .xml file
    • loadProperties

      private static void loadProperties()
      Load Simula properties.
    • loadWorkspaceProperties

      public static void loadWorkspaceProperties()
      Load Workspace properties.
    • loadWorkspacesFromOldPropertyFile

      private static void loadWorkspacesFromOldPropertyFile()
      Load workspaces from old propertyFile.
    • setCurrentWorkspace

      public static void setCurrentWorkspace(File workspace)
      Set current Workspace.
      Parameters:
      workspace - the workspace
    • storeWorkspaceProperties

      public static void storeWorkspaceProperties()
      Store Workspace properties.