java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.statement.Statement
simula.compiler.syntaxClass.statement.BlockStatement
BlockStatement.
Simula Standard: 4.10 Blocks block = subblock | prefixed-block subblock = BEGIN declaration { ; declaration } ; statement { ; statement } END prefixed-block = block-prefix main-block block-prefix = class-identifier [ actual-parameter-part ] main-block = block | BEGIN statement { ; statement } ENDLink to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BlockDeclaration
The associated block declaration.Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
lineNumber
-
Constructor Summary
ConstructorDescriptionBlockStatement
(BlockDeclaration blockDeclaration) Create a new BlockStatement. -
Method Summary
Modifier and TypeMethodDescription(package private) void
addLeadingLabel
(String labelcode) Add a leading label to this BlockStatement.void
Perform semantic checking.void
Output Java code.(package private) boolean
Check if this BlockStatement is a CompoundStatement.void
print
(int indent) Utility print method.void
printTree
(int indent) Utility print syntax tree method.toString()
Methods inherited from class simula.compiler.syntaxClass.statement.Statement
expectStatement
Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, doDeclarationCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, SET_SEMANTICS_CHECKED, toJavaCode
-
Field Details
-
blockDeclaration
The associated block declaration.
-
-
Constructor Details
-
BlockStatement
Create a new BlockStatement.- Parameters:
blockDeclaration
- the BlockDeclaration
-
-
Method Details
-
isCompoundStatement
boolean isCompoundStatement()Check if this BlockStatement is a CompoundStatement.- Returns:
- true if this BlockStatement is a CompoundStatement
-
doChecking
public void doChecking()Description copied from class:SyntaxClass
Perform semantic checking.This must be redefined in every subclass.
- Overrides:
doChecking
in classSyntaxClass
-
addLeadingLabel
Add a leading label to this BlockStatement.- Parameters:
labelcode
- the label code
-
doJavaCoding
public void doJavaCoding()Description copied from class:SyntaxClass
Output Java code.- Overrides:
doJavaCoding
in classStatement
-
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
public void printTree(int indent) Description copied from class:SyntaxClass
Utility print syntax tree method.- Overrides:
printTree
in classSyntaxClass
- Parameters:
indent
- number of spaces leading the lines
-
toString
-