public class CreateObjectBuilder extends RecoderModelTransformer
new Class(...)
occurs, a new object
has to be created, in KeY this is quite similar to take it out of a list of
objects and setting the implicit flag <created>
to
true
as well as setting all fields of the object to their
default values. For the complete procedure, the method creates the
implicit method <createObject$gt;
which on its part calls
another implicit method lt;prepare>
for setting the fields
default values.RecoderModelTransformer.FinalOuterVarsCollector, RecoderModelTransformer.TransformerCache
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap<ClassDeclaration,Identifier> |
class2identifier |
static java.lang.String |
IMPLICIT_OBJECT_CREATE |
static java.lang.String |
NEW_OBJECT_VAR_NAME |
cache, services
EQUIVALENCE, IDENTITY, NO_PROBLEM
Constructor and Description |
---|
CreateObjectBuilder(CrossReferenceServiceConfiguration services,
RecoderModelTransformer.TransformerCache cache) |
Modifier and Type | Method and Description |
---|---|
ProblemReport |
analyze() |
private StatementBlock |
createBody(ClassDeclaration recoderClass)
Creates the body of the static
<createObject>
method. |
MethodDeclaration |
createMethod(ClassDeclaration type)
creates the implicit static
<createObject>
method that takes the object to be created out of the pool |
protected void |
makeExplicit(TypeDeclaration td)
entry method for the constructor normalform builder
|
private TypeReference |
makeTyRef(ClassDeclaration recoderClass) |
assign, attach, attribute, classDeclarations, containingClass, containingMethod, declare, declare, getAllSupertypes, getDefaultValue, getId, getLocalClass2FinalVar, getUnits, isVisible, makeExplicit, transform
execute
attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attach, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsArgument, attachAsBody, attachAsCondition, attachAsGuard, attachAsInitializer, attachAsLabel, attachAsMessage, attachAsPrefix, attachAsPrefix, attachAsPrefix, attachAsPrefix, attachAsUpdate, detach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttach, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsArgument, doAttachAsBody, doAttachAsCondition, doAttachAsGuard, doAttachAsInitializer, doAttachAsLabel, doAttachAsMessage, doAttachAsPrefix, doAttachAsPrefix, doAttachAsPrefix, doAttachAsPrefix, doAttachAsUpdate, doDetach, doReplace, getChangeHistory, getCrossReferenceSourceInfo, getNameInfo, getProblemReport, getProgramFactory, getServiceConfiguration, getSourceFileRepository, getSourceInfo, replace, rollback, setProblemReport, setServiceConfiguration, toString
public static final java.lang.String IMPLICIT_OBJECT_CREATE
public static final java.lang.String NEW_OBJECT_VAR_NAME
private java.util.HashMap<ClassDeclaration,Identifier> class2identifier
public CreateObjectBuilder(CrossReferenceServiceConfiguration services, RecoderModelTransformer.TransformerCache cache)
private StatementBlock createBody(ClassDeclaration recoderClass)
<createObject>
method.private TypeReference makeTyRef(ClassDeclaration recoderClass)
public MethodDeclaration createMethod(ClassDeclaration type)
<createObject>
method that takes the object to be created out of the pooltype
- the TypeDeclaration for which the
<prepare>
is created<prepare>
methodpublic ProblemReport analyze()
analyze
in class TwoPassTransformation
protected void makeExplicit(TypeDeclaration td)
makeExplicit
in class RecoderModelTransformer
td
- the TypeDeclaration