java.lang.Object
simula.compiler.utilities.Global
Global Variables.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Field Summary
Modifier and TypeFieldDescriptionstatic Charset
The current Charset.static ConsolePanel
The consoleprivate static int
Current CompileTime Block level.static GeneratedJavaClass
Current Java output Module.private static DeclarationScope
Current declaration scope.static File
Current workspace.static boolean
Compiler state: True while Checkingstatic boolean
Compiler state: True while Parsingstatic boolean
Compiler state: True while generating STM codeThe set of external .jar files.static File
The external library.static Vector
<GeneratedJavaClass> The set of generated Java filesstatic String
The insert name.private static final int
Max number of work spaces.static File
The output directory.static String
Packet name used in generated .java files.static File
The sample source directory.private static Stack
<DeclarationScope> The declaration scope stack.(package private) static ImageIcon
A Simula iconstatic ImageIcon
A Simula iconstatic File
The Simula Home directory.private static Properties
The Simula propertiesstatic File
The Simula properties filestatic final String
The Simula release identification.static File
Where to find the Simula Runtime System.static File
The Simula temp directorystatic String
The Simula Versionprivate static Properties
The Simula workspace properties.private static File
The Simula workspace .xml file.static File
The source file's directory.static String
The source file name.static int
The current source line number.static String
The source file name without .simstatic File
Temp directory for generated .class filesstatic File
Temp directory for generated .java filesstatic ArrayDeque
<File> The set of workspaces -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
enterScope
(DeclarationScope scope) During Checking and Coding: Enter declaration scope.static void
During Checking and Coding: Exit declaration scope.static DeclarationScope
Returns the current scope.private static File
Returns the simula properties .xml filestatic String
getSimulaProperty
(String key, String defaultValue) Returns a Simula property.static File
getTempFileDir
(String subDir) Returns a temp file directory.static void
initiate()
Initiate Global variables.static void
Initiate Simula properties.private static void
Load Simula properties.static void
Load Workspace properties.private static void
Load workspaces from old propertyFile.private static void
setAccessRWX
(File dir) Utility: Set read-write-execute access on a directorystatic void
setCurrentWorkspace
(File workspace) Set current Workspace.static void
setScope
(DeclarationScope scope) During Parsing: Set current scope.static void
Store Workspace properties.static void
trySetOutputDir
(File dir) Try set Global.outputDir
-
Field Details
-
simulaReleaseID
The Simula release identification.NOTE: When updating release id, change version in SimulaExtractor and RuntimeSystem
- See Also:
-
simIcon
A Simula icon -
sIcon
A Simula icon -
MAX_WORKSPACE
private static final int MAX_WORKSPACEMax number of work spaces.- See Also:
-
simulaHome
The Simula Home directory. -
simulaVersion
The Simula Version -
externalJarFiles
The set of external .jar files. -
_CHARSET
The current Charset. -
sourceLineNumber
public static int sourceLineNumberThe current source line number. -
sourceFileDir
The source file's directory. -
sourceFileName
The source file name. -
sourceName
The source file name without .sim -
insertName
The insert name. -
simulaRtsLib
Where to find the Simula Runtime System. -
simulaPropertiesFile
The Simula properties file -
simulaProperties
The Simula properties -
sampleSourceDir
The sample source directory. Where to find sample Simula files -
currentWorkspace
Current workspace. Where to find .sim source files -
workspaces
The set of workspaces -
outputDir
The output directory. Used by Java-Coding to save the generated .jar files. -
extLib
The external library. Used by ExternalDeclaration.readAttributeFile -
duringParsing
public static boolean duringParsingCompiler state: True while Parsing -
duringChecking
public static boolean duringCheckingCompiler state: True while Checking -
duringSTM_Coding
public static boolean duringSTM_CodingCompiler state: True while generating STM code -
simulaTempDir
The Simula temp directory -
tempJavaFileDir
Temp directory for generated .java files -
tempClassFileDir
Temp directory for generated .class files -
packetName
Packet name used in generated .java files. NOTE: Must be a single identifier. -
currentJavaModule
Current Java output Module. Maintained by JavaModule during Java Coding -
generatedJavaClass
The set of generated Java files -
console
The console -
scopeStack
The declaration scope stack. -
currentScope
Current declaration scope. Maintained during Checking and Coding -
currentCTBlockLevel
private static int currentCTBlockLevelCurrent CompileTime Block level. -
simulaWorkspacesFile
The Simula workspace .xml file. -
simulaWorkspaces
The Simula workspace properties.
-
-
Constructor Details
-
Global
Global()Default constructor.
-
-
Method Details
-
initiate
public static void initiate()Initiate Global variables. -
getCurrentScope
Returns the current scope.- Returns:
- the current scope
-
setScope
During Parsing: Set current scope.- Parameters:
scope
- the new scope
-
enterScope
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
Returns a temp file directory.- Parameters:
subDir
- the wanted sub-directory name- Returns:
- a temp file directory
-
setAccessRWX
Utility: Set read-write-execute access on a directory- Parameters:
dir
- the directory
-
trySetOutputDir
Try set Global.outputDir- Parameters:
dir
- a directory
-
initSimulaProperties
public static void initSimulaProperties()Initiate Simula properties. -
getSimulaProperty
Returns a Simula property.- Parameters:
key
- property keydefaultValue
- default value- Returns:
- a Simula property
-
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
Set current Workspace.- Parameters:
workspace
- the workspace
-
storeWorkspaceProperties
public static void storeWorkspaceProperties()Store Workspace properties.
-