Class ProgramModule
java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.statement.Statement
simula.compiler.syntaxClass.statement.ProgramModule
Simula Program Module.
Link to GitHub: Source File.
Simula Standard: Chapter 6 Program Modules SIMULA-source-module = [ external-head ] ( program | procedure-declaration | class-declaration ) external-head = external-declaration ; { external-declaration ; } external-declaration = external-procedure-declaration | external-class-declaration program = [ block-prefix ] block | [ block-prefix ] compound-statement block-prefix = class-identifier [ ( actual-parameter-part ) ] procedure-declaration = [ type ] PROCEDURE procedure-identifier procedure-head procedure-body
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe external headfinal DeclarationScope
The mainModule declaration.private final VariableExpression
The Variable SYSIN.private final VariableExpression
The Variable SYSOUT.Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
CHECKED, lineNumber, OBJECT_SEQU
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Create Java ClassFile.void
Perform semantic checking.void
Output Java code.Returns the mainModule identifier.Returns the relative file name.boolean
Returns true if this program mainModule is executable.void
print
(int indent) Utility print method.void
Utility print syntax tree method.toString()
Methods inherited from class simula.compiler.syntaxClass.statement.Statement
buildByteCode, expectStatement
Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, doDeclarationCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, readObject, SET_SEMANTICS_CHECKED, setLineNumber, toJavaCode, writeObject
-
Field Details
-
sysin
The Variable SYSIN. -
sysout
The Variable SYSOUT. -
mainModule
The mainModule declaration. -
externalHead
The external head
-
-
Constructor Details
-
ProgramModule
public ProgramModule()Create a new ProgramModule.
-
-
Method Details
-
getIdentifier
-
getRelativeAttributeFileName
Returns the relative file name.- Returns:
- the relative file name
-
isExecutable
public boolean isExecutable()Returns true if this program mainModule is executable.- Returns:
- true if this program mainModule is executable
-
doChecking
public void doChecking()Description copied from class:SyntaxClass
Perform semantic checking.
This must be redefined in every subclass.
- Overrides:
doChecking
in classSyntaxClass
-
doJavaCoding
public void doJavaCoding()Description copied from class:SyntaxClass
Output Java code.- Overrides:
doJavaCoding
in classStatement
-
createJavaClassFile
Create Java ClassFile.- Throws:
IOException
- if something went wrong
-
print
public void print(int indent) Description copied from class:SyntaxClass
Utility print method.- Overrides:
print
in classSyntaxClass
- Parameters:
indent
- number of spaces leading the line
-
printTree
Description copied from class:SyntaxClass
Utility print syntax tree method.- Overrides:
printTree
in classSyntaxClass
- Parameters:
indent
- number of spaces leading the lineshead
- the head of the tree.
-
toString
-