Class ForListElement
java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.statement.ForListElement
- Direct Known Subclasses:
ForWhileElement
,StepUntilElement
Utility class ForListElement implementing a single value element.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Expression
The first expression(package private) ForStatement
The For-statement.Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
CHECKED, lineNumber, OBJECT_SEQU
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Default constructor used by Attribute File I/OForListElement
(ForStatement forStatement, Expression expr1) Create a new ForListElement. -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildByteCode
(CodeBuilder codeBuilder, VariableExpression controlVariable) Build byte code.void
Perform semantic checking.void
Perform simplified JavaCoding.void
doSingleElementByteCoding
(CodeBuilder codeBuilder) Build SingleElement ByteCodingEdit Java source code for this ForListElement.Checks if this ForListElement can be optimized.static ForListElement
Read and return an object.toString()
void
Write a SyntaxClass object to a AttributeOutputStream.Methods inherited from class simula.compiler.syntaxClass.SyntaxClass
ASSERT_SEMANTICS_CHECKED, buildByteCode, doDeclarationCoding, doJavaCoding, edIndent, edTreeIndent, IS_SEMANTICS_CHECKED, print, printTree, SET_SEMANTICS_CHECKED, setLineNumber, toJavaCode
-
Field Details
-
forStatement
ForStatement forStatementThe For-statement. -
expr1
Expression expr1The first expression
-
-
Constructor Details
-
ForListElement
Create a new ForListElement.- Parameters:
forStatement
- the ForStatementexpr1
- The first expression
-
ForListElement
protected ForListElement()Default constructor used by Attribute File I/O
-
-
Method Details
-
doChecking
-
edCode
-
isOptimisable
Checks if this ForListElement can be optimized.- Returns:
- this ForListElement if it can be optimized
-
doSimplifiedJavaCoding
public void doSimplifiedJavaCoding()Perform simplified JavaCoding. -
doSingleElementByteCoding
Build SingleElement ByteCoding- Parameters:
codeBuilder
- the codeBuilder to use.
-
buildByteCode
Build byte code.- Parameters:
codeBuilder
- the codeBuilder to use.controlVariable
- the ForStatement's controlVariable.
-
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 object.- Parameters:
inpt
- the AttributeInputStream to read from- Returns:
- the object read from the stream.
- Throws:
IOException
- if something went wrong.
-