Class Reducer

java.lang.Object
eu.bandm.tools.tdom.runtime.BaseVisitor
eu.bandm.tools.umod.absy.Visitor
eu.bandm.tools.umod.Reducer
All Implemented Interfaces:
PCDataVisitor

public final class Reducer extends eu.bandm.tools.umod.absy.Visitor
ATTENTION:
umod.g reserved words (like "TOPLEVEL") are excluded from being used as class identifiers ONLY by the umod.g lexer (via IDENT_UPPER options { testLiterals = true ; }. Therefore one will get rather obscure syntax errors when trying to use them as (class definition) identifier.
In conntrast: java reservered words (like "class") are excluded explicitly and lead to an explicit error message.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
    Reduces pragma codes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected UMod.FieldDef
     
    (package private) List<UMod.ClassDef>
     
    protected UMod.Forest
     
    (package private) String
     
     
    (package private) List<UMod.IfaceDef>
     
    protected boolean
    <!ELEMENT toplevelclass (classdecl)> <!ELEMENT classextension (classdecl)>
    protected eu.bandm.tools.umod.absy.Element_singletype
     
     
    protected final Integer
     
    static final Pattern
     
    static final Map<String,UMod.Type>
     
    static final String
     
    protected UMod.Type
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) String
     
    (package private) int
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     

    Fields inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor

    validating
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected UMod.ClassDef
     
    protected UMod.FieldDef
     
    protected String
    ident_PCData(eu.bandm.tools.umod.absy.Element_ident el)
    <!ELEMENT extdecl (sourceonly?, ident, extinstantiation) > <!ELEMENT extinstantiation (absoluteref, extinstantiation*) > // A < B, C<D> > <!ELEMENT ident (ident_lower | ident_upper)
    intoString(int start, int length)
     
    protected UMod.ClassDef
     
    protected void
     
    protected void
    putDef(UMod.Item it, String name)
     
    reduce(UMod.Forest in_forest, eu.bandm.tools.umod.absy.Document_modeltree el, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg0)
     
    protected void
    storeDocumentation(UMod.Item target, eu.bandm.tools.umod.absy.Element_doctext doc)
     
    protected void
     
    void
    visit(eu.bandm.tools.umod.absy.Element_algebraic e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_classdecl e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_classextension e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_classleveljava e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_cross e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_enumdef e0)
    <!ELEMENT enumdef (ident_upper, doctext?, enumitems) >
    <!ELEMENT enumitem (ident, doctext?) >
    void
    visit(eu.bandm.tools.umod.absy.Element_extdecl el)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_extendexternal e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_fielddef e0)
    <!ELEMENT fielddef (ident_lower, abstractfield?, type, initvalue?, pragmas?, doctext?) >
    void
    visit(eu.bandm.tools.umod.absy.Element_fielddocu e0)
    <!ELEMENT fielddocu (ident_lower, doctext) >
    void
    visit(eu.bandm.tools.umod.absy.Element_fieldref e0)
    <!ELEMENT fieldref (ident_lower, pragmas)>
    void
    visit(eu.bandm.tools.umod.absy.Element_formatdef e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_ident_upper e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_iface e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_impllist e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_indent e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_interfaces e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_j_abstract e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_mapto e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_modeltree e0)
    Toplevel reducer.
    void
    visit(eu.bandm.tools.umod.absy.Element_ordered e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_plus e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_relto e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_singletype e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_toplevelclass e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_topleveljava e0)
    <!ELEMENT tostring (javablock)> <!ELEMENT classleveljava (javablock)> <!ELEMENT topleveljava (javablock)> <!ELEMENT javablock (#PCDATA)>
    void
    visit(eu.bandm.tools.umod.absy.Element_tostring e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_type el)
    <!ELEMENT type (type_opt, ((cross, type_opt) | (mapto, type_opt))*) >
    void
    visit(eu.bandm.tools.umod.absy.Element_type_atom.Choice_1_Alt_2 e0)
    <!ELEMENT type_atom (type_builtin | (t_power, type) | (t_seq, type) | (t_map, type, type) | typeref) >
    void
    visit(eu.bandm.tools.umod.absy.Element_type_atom.Choice_1_Alt_3 e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_type_atom.Choice_1_Alt_4 e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_type_atom.Choice_1_Alt_5 e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_type_opt e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_typedef e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_typeref e0)
     
    void
    visit(eu.bandm.tools.umod.absy.Element_visitordecl e0)
     

    Methods inherited from class eu.bandm.tools.umod.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

    Methods inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor

    visit

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • predefinedTypes

      public static final Map<String,UMod.Type> predefinedTypes
    • curforest

      protected UMod.Forest curforest
    • msg

    • curmodname

      String curmodname
    • ifacestack

      List<UMod.IfaceDef> ifacestack
    • classstack

      List<UMod.ClassDef> classstack
    • visitnum

      int visitnum
    • visitnam

      String visitnam
    • visitmult

      boolean visitmult
    • visitrew

      boolean visitrew
    • visitrew_multi

      boolean visitrew_multi
    • visitcorew

      boolean visitcorew
    • visitprinter

      boolean visitprinter
    • visitbrowser

      boolean visitbrowser
    • iscontinuation

      protected boolean iscontinuation
      <!ELEMENT toplevelclass (classdecl)> <!ELEMENT classextension (classdecl)>
       <!ELEMENT classdecl
       (indent*, 
          ident_upper, j_abstract?, algebraic?, ordered?
          ("EXTENDS" t_ext)? 
          impllist?, 
         (fielddef | fieldref | tostring | formatdef | classleveljava | topleveljava)*)
       
    • NULLPOSITION

      protected final Integer NULLPOSITION
    • formatloc

    • typeresult

      protected UMod.Type typeresult
    • actfield

      protected UMod.FieldDef actfield
    • STRING_lrcode_separator

      public static final String STRING_lrcode_separator
      See Also:
    • PATTERN_lrcode

      public static final Pattern PATTERN_lrcode
    • lastType

      protected eu.bandm.tools.umod.absy.Element_singletype lastType
  • Constructor Details

    • Reducer

      public Reducer()
  • Method Details

    • lastinstack

      protected UMod.ClassDef lastinstack()
    • copylocation

      protected void copylocation(TypedElement<?,?> el, UMod.Item it)
    • synterror

      protected void synterror(Location<XMLDocumentIdentifier> loc, String txt)
    • putDef

      protected void putDef(UMod.Item it, String name)
    • reduce

      public static UMod.Forest reduce(@Opt UMod.Forest in_forest, eu.bandm.tools.umod.absy.Document_modeltree el, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg0)
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_modeltree e0)
      Toplevel reducer. <!ELEMENT modeltree (ident_upper, doctext?, modlines)> <!ELEMENT modlines (visitordecl | extdecl | toplevelclass | classextension | typedef | interfaces | enumdef)+ >
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • storeDocumentation

      protected void storeDocumentation(UMod.Item target, eu.bandm.tools.umod.absy.Element_doctext doc)
    • ident_PCData

      protected String ident_PCData(eu.bandm.tools.umod.absy.Element_ident el)
      <!ELEMENT extdecl (sourceonly?, ident, extinstantiation) > <!ELEMENT extinstantiation (absoluteref, extinstantiation*) > // A < B, C<D> > <!ELEMENT ident (ident_lower | ident_upper)
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_extdecl el)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_visitordecl e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_typedef e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_enumdef e0)
      <!ELEMENT enumdef (ident_upper, doctext?, enumitems) >
      <!ELEMENT enumitem (ident, doctext?) >
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_interfaces e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_iface e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_indent e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_ident_upper e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_toplevelclass e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_classextension e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • find_subclass

      protected UMod.ClassDef find_subclass(UMod.ClassDef sup, String name)
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_classdecl e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • patchPragmas

      protected void patchPragmas(Collection<CheckedMap_RD<Integer,UMod.FieldDef>> maps)
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_impllist e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_extendexternal e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_j_abstract e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_algebraic e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_ordered e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_topleveljava e0)
      <!ELEMENT tostring (javablock)> <!ELEMENT classleveljava (javablock)> <!ELEMENT topleveljava (javablock)> <!ELEMENT javablock (#PCDATA)>
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_classleveljava e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_tostring e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • intoString

      protected Location<NoDocumentIdentifier> intoString(int start, int length)
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_formatdef e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_fielddocu e0)
      <!ELEMENT fielddocu (ident_lower, doctext) >
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_fielddef e0)
      <!ELEMENT fielddef (ident_lower, abstractfield?, type, initvalue?, pragmas?, doctext?) >
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • findfield

      protected UMod.FieldDef findfield(String fid)
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_fieldref e0)
      <!ELEMENT fieldref (ident_lower, pragmas)>
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_type el)
      <!ELEMENT type (type_opt, ((cross, type_opt) | (mapto, type_opt))*) >
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_singletype e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_type_opt e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_cross e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_mapto e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_relto e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_plus e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_type_atom.Choice_1_Alt_2 e0)
      <!ELEMENT type_atom (type_builtin | (t_power, type) | (t_seq, type) | (t_map, type, type) | typeref) >
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_type_atom.Choice_1_Alt_3 e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_type_atom.Choice_1_Alt_4 e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_type_atom.Choice_1_Alt_5 e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor
    • visit

      public void visit(eu.bandm.tools.umod.absy.Element_typeref e0)
      Overrides:
      visit in class eu.bandm.tools.umod.absy.Visitor