Package eu.bandm.tools.umod
Class UMod2java.CompileConstructors
java.lang.Object
eu.bandm.tools.umod.UMod2java.CompileConstructors
- Enclosing class:
UMod2java
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<UMod.ClassDef, Set<String>> protected final List<UMod.FieldDef> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckDuplicateConstructor(UMod.ClassDef cd, String signature) protected voidexpandOrInherit(UMod.ClassDef cd, Integer key, SortedMap<Integer, UMod.FieldDef> superfields) protected booleanmakeconstructor(UMod.ClassDef cd, Integer key, Collection<UMod.FieldDef> inherited, Collection<UMod.FieldDef> newparams) Generates a constructor with signature "inherited+newparams".
Compiles a call to "super()" for the former and assignment statements for the latter().
ASSUME "Collection" is ordered, since it is "aTreeMap.values()"protected voidprocess(UMod.ClassDef cd) protected voidprocess(UMod.Forest model) protected booleanReturns true immediately if a 0ary constructor is defined by the user explictly (in verbatim Java code), or already implicitly generated by this routine.
Otherwise: if there are no obligate fields without initial value, a new 0ary constructor is generated, and "true" returned.
Otherwise returns false.
-
Field Details
-
EMPTYLIST
-
constructorSignatures
-
-
Constructor Details
-
CompileConstructors
protected CompileConstructors()
-
-
Method Details
-
test_0ary_constructor
Returns true immediately if a 0ary constructor is defined by the user explictly (in verbatim Java code), or already implicitly generated by this routine.
Otherwise: if there are no obligate fields without initial value, a new 0ary constructor is generated, and "true" returned.
Otherwise returns false. -
process
-
process
-
expandOrInherit
protected void expandOrInherit(UMod.ClassDef cd, Integer key, SortedMap<Integer, UMod.FieldDef> superfields) -
checkDuplicateConstructor
-
makeconstructor
protected boolean makeconstructor(UMod.ClassDef cd, Integer key, Collection<UMod.FieldDef> inherited, Collection<UMod.FieldDef> newparams) Generates a constructor with signature "inherited+newparams".
Compiles a call to "super()" for the former and assignment statements for the latter().
ASSUME "Collection" is ordered, since it is "aTreeMap.values()"
-