Class UMod2format.Compiler

    • Field Detail

      • topleveldef

        protected UMod.ClassDef topleveldef
        Needed ONLY for error message generateion.
      • curmodel

        protected Format curmodel
        Keeps track of the data object which is currently rendered to a Format.
      • curtype

        protected UMod.Type curtype
        The aggregate type, if current "modelname" 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 of #modelname the value of this field is ...
        java type of current modelvalue of curtype
        MapEntry<D,R> T_map/T_multimap
        anObjectT T_reference / .javaDecl=anObjectT
      • subtypefound

        protected UMod.Type subtypefound
        set by visit(Element_ref) and read only by {@link #Subformat.visit(Elemetn_child} and visit(Element_switch)
      • submodelfound

        protected Format submodelfound
        set by visit(Element_ref) and read only by {@link #Subformat.visit(Elemetn_child} and visit(Element_switch)
      • modeSelected

        protected final Format modeSelected
      • fieldfound

        protected UMod.FieldDef fieldfound
        set by visit(Element_ref) and read only for error diagnosisonly by {@link #Subformat.visit(Elemetn_child} and visit(Element_switch)
      • nextSubformatIndex

        protected int nextSubformatIndex
    • Method Detail

      • getCurrentModel

        protected Format getCurrentModel()
        Description copied from class: GenericCompiler
        Currently only needed to compile escapeToJava() in the variant operating directly on the model element. Introduced 20170428.
        Specified by:
        getCurrentModel in class GenericCompiler
      • initTransformerClass

        public void initTransformerClass​(GeneratedClass gc)
        A specialization of {@link eu.bandm.tools.formatfrontends.GenericCompiler.initTransformerClass(GeneratedClass) GenericCompiler.initTransformerClass()}, because a local field must be accesssed.
        Overrides:
        initTransformerClass in class GenericCompiler
      • compileOnePattern

        public void compileOnePattern​(UMod.ClassDef cd,
                                      GeneratedMethod gm0,
                                      java.lang.String code,
                                      java.lang.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.
      • tdomonly

        protected void tdomonly​(eu.bandm.tools.formatfrontends.absy.Element el,
                                java.lang.String token)
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_t_seq el)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_t_alt el)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_t_choice el)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_instanceTest el)
        <!ELEMENT instanceTest (ref, ref?) >
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_clss element)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_clssUPCASE element)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_thiz element)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_mode element)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_from element)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_too element)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_numberedref element)
        Overrides:
        visit in class eu.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:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_text element)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_swtch element)
        Overrides:
        visit in class eu.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:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor
      • visit

        public void visit​(eu.bandm.tools.formatfrontends.absy.Element_child element)
        Overrides:
        visit in class eu.bandm.tools.formatfrontends.absy.Visitor