Class UMod2visitors.V_makeRewriterCoRewriter

java.lang.Object
eu.bandm.tools.umod.UMod.Visitor
eu.bandm.tools.umod.UMod2visitors.Lr_decoder
eu.bandm.tools.umod.UMod2visitors.V_makeRewriterCoRewriter
Enclosing class:
UMod2visitors

protected class UMod2visitors.V_makeRewriterCoRewriter extends UMod2visitors.Lr_decoder
Is created and called for toplevel classes, and then created anew for all sub-classes!
  • Field Details

    • modelnum

      protected int modelnum
      The cursor variables in "for (i0:...)" are built with an ever increasing number, instead of shadowing previous model names.
    • visitor

      protected GeneratedClass visitor
    • iscorewriter

      protected boolean iscorewriter
    • multiSupport

      protected boolean multiSupport
    • keynum

      protected int keynum
    • dorwmeth

      protected GeneratedMethod dorwmeth
    • superclass

      protected UMod.ClassDef superclass
    • curfield

      protected UMod.FieldDef curfield
    • model

      protected Format model
    • result

      protected Format result
    • userResponsible

      protected boolean userResponsible
    • suppress_addAll_warning_annotated

      final Set<GeneratedMethod> suppress_addAll_warning_annotated
    • convertOneSide_CORW

      final Format convertOneSide_CORW
  • Constructor Details

    • V_makeRewriterCoRewriter

      public V_makeRewriterCoRewriter(int k, GeneratedClass v, UMod.ClassDef s, boolean iscorew, boolean ms)
  • Method Details

    • action

      protected void action(UMod.ClassDef cd)
      Overrides:
      action in class UMod.Visitor
    • wrapOptimizingCut

      protected Format wrapOptimizingCut(Format code)
    • action

      protected void action(UMod.FieldDef fd)
      Overrides:
      action in class UMod.Visitor
    • action

      protected void action(UMod.T_reference t)
      Overrides:
      action in class UMod.Visitor
    • action

      protected void action(UMod.TypeBasic t)
      Overrides:
      action in class UMod.Visitor
    • put_suppress_addAll_warning_annotation

      protected void put_suppress_addAll_warning_annotation(GeneratedMethod meth)
    • visitSetList

      protected void visitSetList(UMod.TypeConstructed t, boolean isseq)
    • action

      protected void action(UMod.T_seq t)
      Overrides:
      action in class UMod.Visitor
    • action

      protected void action(UMod.T_power t)
      Overrides:
      action in class UMod.Visitor
    • convertOneSide_REW

      protected Format convertOneSide_REW(boolean cast)
    • visitMap_or_Multimap

      protected void visitMap_or_Multimap(UMod.T_2 t, boolean ismultimap)
      Diagram of semantics:
      M = original, L/R = maps representing rewriting, M' = result
                         M
                  ------------------>
                 |                   |
               L |                   | R
                 V                   V
                  ------------------>
                         M'
          
             M' := Linv o M o R 
      
             potential optimizations:
             a)
             if L or M or R is empty  ==> return empty M' immediately
             b)
             if M is map (not multimap) and rewriter does not support "substitute_multi()"
             then 1) L and R can be simple maps (not multi-maps!)
             and  2) only "injectiveness" of L needs to be tested, 
                     to ensure M' being a map!
             
    • action

      protected void action(UMod.T_map t)
      Overrides:
      action in class UMod.Visitor
    • action

      protected void action(UMod.T_rel t)
      Overrides:
      action in class UMod.Visitor
    • action

      protected void action(UMod.T_opt t)
      Overrides:
      action in class UMod.Visitor
    • action

      protected void action(UMod.T_copair t)
      Overrides:
      action in class UMod.Visitor
    • action

      protected void action(UMod.T_pair t)
      Potential optimizations:
      a) multiple not supported -> abfrage kann raus, single case only!
      b) any side is empty -> return empty
      Overrides:
      action in class UMod.Visitor