Class ObjectGenerator
java.lang.Object
simula.compiler.syntaxClass.SyntaxClass
simula.compiler.syntaxClass.expression.Expression
simula.compiler.syntaxClass.expression.ObjectGenerator
ObjectGenerator i.e. new Object expression.
Simula Standard: 3.8 Object expressions object-generator = NEW class-identifier [ ( actual-parameter-part ) ] actual-parameter-part = "(" actual-parameter { , actual-parameter } ")" actual-parameter = expression | array-identifier-1 | switch-identifier | procedure-identifier-1
Link to GitHub: Source File.
- Author:
- SIMULA Standards Group, Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Vector
<Expression> The actual parameters after checkingprivate String
The class-identifier(package private) Meaning
The semantic meaningprivate Vector
<Expression> The actual parameters before checkingFields inherited from class simula.compiler.syntaxClass.expression.Expression
backLink, type
Fields inherited from class simula.compiler.syntaxClass.SyntaxClass
CHECKED, lineNumber, OBJECT_SEQU
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Default constructor used by Attribute File I/Oprivate
ObjectGenerator
(String ident, Vector<Expression> params) Create a new ObjectGenerator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildEvaluation
(Expression rightPart, CodeBuilder codeBuilder) ClassFile coding utility: Build Evaluation Code.void
Perform semantic checking.(package private) static Expression
Parse an object generator.boolean
Returns true if this expression may be used as a statement.static ObjectGenerator
Read and return an ObjectGenerator object.Generate Java code for this Syntax Class.toString()
void
Write a SyntaxClass object to a AttributeOutputStream.Methods inherited from class simula.compiler.syntaxClass.expression.Expression
acceptExpression, checkCompatibility, evaluate, expectExpression, get, getInt, getNumber, getQualification, getWriteableVariable, printTree, put
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
-
classIdentifier
The class-identifier -
meaning
Meaning meaningThe semantic meaning -
params
The actual parameters before checking -
checkedParams
The actual parameters after checking
-
-
Constructor Details
-
ObjectGenerator
Create a new ObjectGenerator.- Parameters:
ident
- class-identifierparams
- the actual parameters
-
ObjectGenerator
private ObjectGenerator()Default constructor used by Attribute File I/O
-
-
Method Details
-
expectNew
Parse an object generator.
object-generator = NEW class-identifier [ ( actual-parameter-part ) ] actual-parameter-part = "(" actual-parameter { , actual-parameter } ")"
- Returns:
- the newly created ObjectGenerator.
-
doChecking
public void doChecking()Description copied from class:SyntaxClass
Perform semantic checking.
This must be redefined in every subclass.
- Overrides:
doChecking
in classSyntaxClass
-
maybeStatement
public boolean maybeStatement()Description copied from class:Expression
Returns true if this expression may be used as a statement.- Specified by:
maybeStatement
in classExpression
- Returns:
- true if this expression may be used as a statement
-
toJavaCode
Description copied from class:SyntaxClass
Generate Java code for this Syntax Class.- Overrides:
toJavaCode
in classSyntaxClass
- Returns:
- Java code
-
buildEvaluation
Description copied from class:Expression
ClassFile coding utility: Build Evaluation Code.- Specified by:
buildEvaluation
in classExpression
- Parameters:
rightPart
- expressioncodeBuilder
- the codeBuilder used.
-
toString
- Overrides:
toString
in classExpression
-
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 ObjectGenerator object.- Parameters:
inpt
- the AttributeInputStream to read from- Returns:
- the ObjectGenerator object read from the stream.
- Throws:
IOException
- if something went wrong.
-