Class InspectVariableDeclaration
java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.declaration.Declaration
simula.compiler.syntaxClass.declaration.InspectVariableDeclaration
InspectVariable Declaration.
Link to GitHub: Source File.
- Author:
- Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) DeclarationScope
The owner.(package private) ConnectionStatement
The associated ConnectionStatementFields inherited from class simula.compiler.syntaxClass.declaration.Declaration
declarationKind, declaredIn, externalIdent, identifier, isProtected, type
Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
CHECKED, lineNumber, OBJECT_SEQU
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor used by Attribute File I/OInspectVariableDeclaration
(Type type, String identifier, DeclarationScope connectionScope, ConnectionStatement connectionStatement) Create a new InspectVariableDeclaration. -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildDeclaration
(ClassBuilder classBuilder, BlockDeclaration encloser) Output Java ByteCode.void
buildInitAttribute
(CodeBuilder codeBuilder) Output Java ByteCode.void
Perform semantic checking.ClassFile coding utility: get getFieldIdentifier.ClassFile coding utility: get FieldRefEntry of this InspectVariable.void
Utility print syntax tree method.static InspectVariableDeclaration
Read and return an InspectVariableDeclaration object.Generate Java code for this Syntax Class.toString()
void
Write a SyntaxClass object to a AttributeOutputStream.Methods inherited from class simula.compiler.syntaxClass.declaration.Declaration
acceptDeclaration, buildDeclarationCode, checkAlreadyDefined, getJavaIdentifier, isCompatibleClasses, verifyTree
Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, buildByteCode, doDeclarationCoding, doJavaCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, print, SET_SEMANTICS_CHECKED, setLineNumber
-
Field Details
-
connectionStatement
ConnectionStatement connectionStatementThe associated ConnectionStatement -
connectionScope
DeclarationScope connectionScopeThe owner.
-
-
Constructor Details
-
InspectVariableDeclaration
public InspectVariableDeclaration(Type type, String identifier, DeclarationScope connectionScope, ConnectionStatement connectionStatement) Create a new InspectVariableDeclaration.- Parameters:
type
- the variable typeidentifier
- the variable identifierconnectionScope
- the connectionScopeconnectionStatement
- the connectionStatement
-
InspectVariableDeclaration
public InspectVariableDeclaration()Default constructor used by Attribute File I/O
-
-
Method Details
-
doChecking
public void doChecking()Description copied from class:SyntaxClass
Perform semantic checking.
This must be redefined in every subclass.
- Overrides:
doChecking
in classSyntaxClass
-
toJavaCode
Description copied from class:SyntaxClass
Generate Java code for this Syntax Class.- Overrides:
toJavaCode
in classSyntaxClass
- Returns:
- Java code
-
getFieldRefEntry
ClassFile coding utility: get FieldRefEntry of this InspectVariable.- Parameters:
pool
- the ConstantPoolBuilder to use.- Returns:
- the FieldRefEntry of this InspectVariable.
-
getFieldIdentifier
Description copied from class:Declaration
ClassFile coding utility: get getFieldIdentifier.- Overrides:
getFieldIdentifier
in classDeclaration
- Returns:
- the resulting String.
-
buildDeclaration
Description copied from class:Declaration
Output Java ByteCode. Treat Declaration.- Overrides:
buildDeclaration
in classDeclaration
- Parameters:
classBuilder
- the classBuilder to use.encloser
- the owning block.
-
buildInitAttribute
Description copied from class:Declaration
Output Java ByteCode. Build init code for an Attribute.- Overrides:
buildInitAttribute
in classDeclaration
- Parameters:
codeBuilder
- the codeBuilder to use.
-
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
-
writeObject
Description copied from class:SyntaxClass
Write a SyntaxClass object to a AttributeOutputStream.- Overrides:
writeObject
in classSyntaxClass
- Parameters:
oupt
- the AttributeOutputStream to write to.- Throws:
IOException
- if something went wrong.
-
readObject
Read and return an InspectVariableDeclaration object.- Parameters:
inpt
- the AttributeInputStream to read from- Returns:
- the object read from the stream.
- Throws:
IOException
- if something went wrong.
-