Package eu.bandm.tools.umod
Class UMod2format.Compiler
java.lang.Object
eu.bandm.tools.tdom.runtime.BaseVisitor
eu.bandm.tools.formatfrontends.absy.Visitor
eu.bandm.tools.formatfrontends.GenericCompiler
eu.bandm.tools.umod.UMod2format.Compiler
- All Implemented Interfaces:
PCDataVisitor
- Enclosing class:
UMod2format
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FormatKeeps track of the data object which is currently rendered to a Format.protected UMod.ForestNeeded for find the class definitions (/types) of fields referred to.protected UMod.TypeThe aggregate type, if current mode is a Mapoid, else the type of the current model (even if it is an item of a Listoid).protected UMod.FieldDefset byvisit(Element_ref)and read only for error diagnosisonly byUMod2format.Compiler.Subformat.visit(Element_child)andvisit(Element_switch)protected final Formatprotected intprotected Formatset byvisit(Element_ref)and read only byUMod2format.Compiler.Subformat.visit(Element_child)andvisit(Element_switch)protected UMod.Typeset byvisit(Element_ref)and read only byUMod2format.Compiler.Subformat.visit(Element_child)andvisit(Element_switch)protected UMod.ClassDefNeeded ONLY for error message generateion.Fields inherited from class eu.bandm.tools.formatfrontends.GenericCompiler
callFunctionForRaisingException, checkedmode, constcache, exprCache, fresult, isdynamic, MODIF_CONST, NAME_CONST_FORMAT_EMPTY, NAME_METHOD_THROW_TAKE_ALTERNATIVE, NAME_VAR_DEFAULT_INDENT, NAME_VAR_FORMAT_RESULT, NAME_VAR_MODE, rec, REF_FORMAT_Format, REF_FORMAT_Formats, targetclass, WRAPPEDCLASS_CompoundConstructor, WRAPPEDCLASS_Format, WRAPPEDCLASS_Function, WRAPPEDCLASS_ListoidFormatter, WRAPPEDCLASS_Lists, WRAPPEDCLASS_MapEntry, WRAPPEDCLASS_MapoidFormatter, WRAPPEDCLASS_Object, WRAPPEDCLASS_TakeAlternativeException, WRAPPEDCLASS_TryerCatcherFields inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor
validating -
Constructor Summary
ConstructorsConstructorDescriptionCompiler(UMod.Forest umod0, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) Derived consructor which additionally only sets the current umod model. -
Method Summary
Modifier and TypeMethodDescriptionvoidcompileOnePattern(UMod.ClassDef cd, GeneratedMethod gm0, String code, String initialModel) Derived method which parses the format code of one class definition into a tdom, then sets the current model and its type, and finally calls the base method.protected voiderror(Locatable<XMLDocumentIdentifier> loc, String text) protected UMod.ClassDefprotected FormatCurrently only needed to compileescapeToJava()in the variant operating directly on the model element.voidA specialization ofGenericCompiler.initTransformerClass(), because a local field must be accessed.voidmakeclassstring(Locatable<XMLDocumentIdentifier> loc, boolean upcase) protected eu.bandm.tools.formatfrontends.absy.Document_patternparseHint(String hint, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) protected voidvoidvisit(eu.bandm.tools.formatfrontends.absy.Element_child element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_clss element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_clssUPCASE element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_from element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_instanceTest el) <!ELEMENT instanceTest (ref, ref?) >voidvisit(eu.bandm.tools.formatfrontends.absy.Element_mode element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_numberedref element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_ref element) Only sets "subtypefound" to the type of the field and "submodelfound" to the Format of the field getter function.voidvisit(eu.bandm.tools.formatfrontends.absy.Element_supr element) Creates a call to the format converting routine defined for the superclass.
Attention currently: must assume that format of some superclass (if any) has already been translated.voidvisit(eu.bandm.tools.formatfrontends.absy.Element_swtch element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_t_alt el) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_t_choice el) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_t_seq el) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_text element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_thiz element) voidvisit(eu.bandm.tools.formatfrontends.absy.Element_too element) protected voidwarning(Locatable<XMLDocumentIdentifier> loc, String text) Methods inherited from class eu.bandm.tools.formatfrontends.GenericCompiler
checkconst, compileCallToFormatText, compileModeSwitch, compileOnePattern, create_resultfield, error, expr, getMsgReceiver, process_compound, refer, setMsgReceiver, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, warningMethods inherited from class eu.bandm.tools.formatfrontends.absy.Visitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitMethods inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor
visit
-
Field Details
-
topleveldef
Needed ONLY for error message generateion. -
currentumod
Needed for find the class definitions (/types) of fields referred to. Used only ingetclassdef(UMod.T_reference). -
curmodel
Keeps track of the data object which is currently rendered to a Format. -
curtype
The aggregate type, if current mode is a Mapoid, else the type of the current model (even if it is an item of a Listoid). The relation of the java type of the current value ofcurmodelthe value of this field is ...java type of current model value of curtype MapEntry<D,R> T_map/T_multimap anObjectT T_reference / .javaDecl=anObjectT $nbsp; -
subtypefound
set byvisit(Element_ref)and read only byUMod2format.Compiler.Subformat.visit(Element_child)andvisit(Element_switch) -
submodelfound
set byvisit(Element_ref)and read only byUMod2format.Compiler.Subformat.visit(Element_child)andvisit(Element_switch) -
modeSelected
-
fieldfound
set byvisit(Element_ref)and read only for error diagnosisonly byUMod2format.Compiler.Subformat.visit(Element_child)andvisit(Element_switch) -
nextSubformatIndex
protected int nextSubformatIndex
-
-
Constructor Details
-
Compiler
Derived consructor which additionally only sets the current umod model. This is needed by the specific oode generation routines.
-
-
Method Details
-
getCurrentModel
Description copied from class:GenericCompilerCurrently only needed to compileescapeToJava()in the variant operating directly on the model element.- Specified by:
getCurrentModelin classGenericCompiler
-
error
-
warning
-
initTransformerClass
A specialization ofGenericCompiler.initTransformerClass(), because a local field must be accessed.- Overrides:
initTransformerClassin classGenericCompiler
-
compileOnePattern
public void compileOnePattern(UMod.ClassDef cd, GeneratedMethod gm0, String code, String initialModel) Derived method which parses the format code of one class definition into a tdom, then sets the current model and its type, and finally calls the base method. The variables containing the current model and its type are required by the umod-specific oode generation routines. -
parseHint
protected eu.bandm.tools.formatfrontends.absy.Document_pattern parseHint(String hint, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg) -
tdomonly
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_t_seq el) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_t_alt el) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_t_choice el) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_instanceTest el) <!ELEMENT instanceTest (ref, ref?) >- Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
makeclassstring
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_clss element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_clssUPCASE element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
getclassdef
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_thiz element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_mode element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_from element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_too element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_numberedref element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_ref element) Only sets "subtypefound" to the type of the field and "submodelfound" to the Format of the field getter function. Is called from a sub-visitor or from a "$switch" context. Therefore it does not generate any code on its own. If we are in a code context for a Listoid, then "curtype" is set to the type of the listoids elements.- Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_text element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_swtch element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_supr element) Creates a call to the format converting routine defined for the superclass.
Attention currently: must assume that format of some superclass (if any) has already been translated.- Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-
visit
public void visit(eu.bandm.tools.formatfrontends.absy.Element_child element) - Overrides:
visitin classeu.bandm.tools.formatfrontends.absy.Visitor
-