java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.declaration.Declaration
simula.compiler.syntaxClass.declaration.DeclarationScope
simula.compiler.syntaxClass.declaration.ConnectionBlock
- All Implemented Interfaces:
Externalizable
,Serializable
Connection Block.
A Connection Block is a Statement within a Connection Statement. It acts as a block, whether it takes the form of a block or not. It further acts as if enclosed by a second fictitious block, called a "connection block". During the execution of a connection block the object X is said to be "connected".
See Simula Standard 4.8 Connection statement.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class simula.compiler.syntaxClass.declaration.Declaration
Declaration.Kind
-
Field Summary
Modifier and TypeFieldDescriptionThe when class identifierfinal VariableExpression
The inspected variable.private Statement
The Connection Statement.private Declaration
When clause class Declaration.private final String
When clause class identifier.Fields inherited from class simula.compiler.syntaxClass.declaration.DeclarationScope
ctBlockLevel, currentRTBlockLevel, declarationList, hasLocalClasses, labelList, rtBlockLevel, sourceBlockLevel
Fields inherited from class simula.compiler.syntaxClass.declaration.Declaration
declarationKind, declaredIn, externalIdent, identifier, isProtected, type
Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
lineNumber
-
Constructor Summary
ConstructorDescriptionCreate a new ConnectionBlock.ConnectionBlock
(VariableExpression inspectedVariable, String whenClassIdentifier) Create a new ConnectionBlock. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Perform semantic checking.void
Output Java code.void
end()
Connection block end.findMeaning
(String identifier) Find MeaningGet inspected expression.void
print
(int indent) Utility print method.void
printTree
(int indent) Utility print syntax tree method.void
void
setClassDeclaration
(ClassDeclaration classDeclaration) Set the Connected ClassDecleration.void
setStatement
(Statement statement) Set the Connection Statement.Generate Java code for this Syntax Class.toString()
void
Methods inherited from class simula.compiler.syntaxClass.declaration.DeclarationScope
edCTX, edCTX, edJavaClassName, edScopeChain, findLabelMeaning, findProcedure, findVisibleAttributeMeaning, printDeclarationList, scopeID
Methods inherited from class simula.compiler.syntaxClass.declaration.Declaration
getJavaIdentifier, isCompatibleClasses, modifyIdentifier, parseDeclaration
Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, doDeclarationCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, SET_SEMANTICS_CHECKED
-
Field Details
-
statement
The Connection Statement. -
whenClassIdentifier
When clause class identifier. -
whenClassDeclaration
When clause class Declaration. Set during checking. -
inspectedVariable
The inspected variable. -
classDeclaration
The when class identifier
-
-
Constructor Details
-
ConnectionBlock
Create a new ConnectionBlock.- Parameters:
inspectedVariable
- the inspected variablewhenClassIdentifier
- the when class identifier
-
ConnectionBlock
public ConnectionBlock()Create a new ConnectionBlock.
-
-
Method Details
-
getInspectedExpression
Get inspected expression.- Returns:
- inspected expression.
-
end
public void end()Connection block end. -
setClassDeclaration
Set the Connected ClassDecleration.- Parameters:
classDeclaration
- the Connected ClassDecleration.
-
setStatement
Set the Connection Statement.- Parameters:
statement
- the Connection Statement
-
findMeaning
Description copied from class:DeclarationScope
Find Meaning- Overrides:
findMeaning
in classDeclarationScope
- Parameters:
identifier
- declared identifier- Returns:
- the resulting Meaning
-
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 classSyntaxClass
-
toJavaCode
Description copied from class:SyntaxClass
Generate Java code for this Syntax Class.- Overrides:
toJavaCode
in classSyntaxClass
- Returns:
- Java code
-
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
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-