public class UMod2visitors extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
UMod2visitors.Lr_decoder |
protected static class |
UMod2visitors.rewriterType |
protected class |
UMod2visitors.V_compileMatchCascade |
protected class |
UMod2visitors.V_compileSimpleActionMethods |
protected class |
UMod2visitors.V_makeDescend
Returns in "result" a Format which represents the descending code.
|
protected class |
UMod2visitors.V_makeRewriterCoRewriter
Is created and called for toplevel classes, and then
created anew for all sub-classes!
|
Modifier and Type | Method and Description |
---|---|
protected void |
collectRegisters(GeneratedClass basevisitor)
The algorithm is basically as follows:
+
|
protected void |
ERROR(Location<XMLDocumentIdentifier> loc,
String txt) |
protected void |
make_actionprepost(UMod.ClassDef cd,
GeneratedClass visitor,
UMod.ClassDef superclass) |
static void |
make_all_abstracts(GeneratedClass visitor,
int key)
Iff visitor optimization is switched on, then the base visitor is derived
from
umod.runtime.OptimizingVisitor , and this method
"makes all abstract" methods which are required by this base class. |
protected void |
make_breakLoop_method(UMod.Forest model,
GeneratedClass visitor) |
protected void |
make_dumpcode(GeneratedClass visitor,
UMod.ClassDef cd,
int keynum) |
protected void |
make_prepost(GeneratedClass visitor,
String methname,
UMod.ClassDef cd,
UMod.ClassDef superclass) |
protected GeneratedClass |
make_v_dumper(UMod.Forest model,
GeneratedContext context,
GeneratedClass basematcher,
int keynum,
String name) |
protected GeneratedClass |
make_v_multiphase(UMod.Forest model,
GeneratedContext context,
GeneratedClass basematcher,
int keynum,
String name) |
protected GeneratedClass |
make_v_rewritercorewriter(UMod.Forest model,
GeneratedContext context,
GeneratedClass basematcher,
int keynum,
String name,
UMod2visitors.rewriterType rtype,
boolean supportMultiSubst) |
protected GeneratedClass |
make_v_simple(UMod.Forest model,
GeneratedContext context,
GeneratedClass basematcher,
int keynum,
String name) |
protected void |
makeCallDescend(GeneratedClass visitor,
UMod.ClassDef cd,
String methodname,
int keynum,
boolean optimizing)
Compiles the method which recursively calls "match()" on all selected
fields, either directly or by calling "descend_
The name of the generated method is "action" in the simple visitor case, or "descend" in the multiphase case. |
void |
makeSCCfields(GeneratedClass basevisitor,
MetaType maptype,
String fieldname,
String methodname) |
protected GeneratedClass |
makeVisitorClass(GeneratedContext context,
GeneratedClass basematcher,
String name) |
protected void |
WARNING(Location<XMLDocumentIdentifier> loc,
String txt) |
protected void |
warnNoVisit(UMod.ClassDef cd,
UMod.FieldDef fd,
boolean isPrim,
boolean isAbstract) |
protected static final String FIELDNAME__class2scc
protected static final String FIELDNAME__field2sccs
protected static final String FIELDNAME__class2reachedSccs
protected static final String METHODNAME__class2scc
protected static final String METHODNAME__field2sccs
protected static final String METHODNAME__class2reachedSccs
protected static final String FIELDNAME_VISITOR_DEBUG_STREAM
protected static final String METHODNAME_VISITOR_DEBUG
protected static final String METHODNAME_getLowestGeneratedClass
protected static final String METHODNAME_getKey
protected static final String METHODNAME_collectFlags
protected static final String METHODNAME_REWRITER_GETRESULT
protected static final String METHODNAME_REWRITER_ISMULTI
protected static final String METHODNAME_REWRITER_REVERT
protected static final String METHODNAME_REWRITER_changed
protected static final String METHODNAME_REWRITER_useCache
protected static final String METHODNAME_REWRITER_breakLoop
protected static final String METHODNAME_REWRITER_RETURN_EMPTY
protected static final String METHODNAME_REWRITER_RETURN
protected static final String METHODNAME_REWRITER_RETURN_MULTIPLE
protected static final String METHODNAME_REWRITER_RETURN_MULT_INTERN
protected static final String METHODNAME_REWRITER_REWRITE
protected static final String METHODNAME_REWRITER_REWRITETYPED
protected static final String VARNAME_TYPEVAR_REWRITETYPED
protected static final String METHODNAME_REWRITER_LOOKUP
protected static final String METHODNAME_REWRITER_putToCache
protected static final String METHODNAME_COREWRITER_rewriteDone
protected static final String NAME_BASEMATCHER
protected static final String FIELDNAME_lowestGeneratedVisitorClass
public static final String METHODNAME_MATCHFOREIGNOBJECT
public static final String METHODNAME_NOMATCH
protected static final String METHODNAMEPREFIX_DESCEND
protected static final int MODIF_STATICCLASS
protected static final int MODIF_VISITMETH
protected static final int MODIF_VISITENTRY
protected static final int MODIF_FIELD
protected static final int MODIF_PACKAGEVISIBLE
protected static final GeneratedAnnotation ANNOTATION_SUPPRESS_UNCHECKED
protected boolean visitordebug
protected boolean visitoroptimize
protected boolean allrewriterwarnings
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg
protected UMod.Forest model
protected GeneratedContext context
protected GeneratedClass modelclass
protected GeneratedClass basematcher
public static final int descend_all_branches_case
protected void ERROR(Location<XMLDocumentIdentifier> loc, String txt)
protected void WARNING(Location<XMLDocumentIdentifier> loc, String txt)
public static void make_all_abstracts(GeneratedClass visitor, int key)
umod.runtime.OptimizingVisitor
, and this method
"makes all abstract" methods which are required by this base class.
For being compilable, also classes which do not need optimization (e.g.
built in UMod2format
) must implement these methods.
Simplest way is to call this method.public void makeSCCfields(GeneratedClass basevisitor, MetaType maptype, String fieldname, String methodname)
protected void collectRegisters(GeneratedClass basevisitor)
field2declaredClasses : Fd -> F Cd // F is *f*inite power set, as in "Z" select: Cd -> N -> seq Fd // seq of fields selected for a certain register super: Cd -> Cd supSub: Cd <-> Cd = symmetricClosurre(reflexiveClosure(transitiveClosure(super))) // CANNOT exchange sequence of symmetric and transitive !! class2declaredClasses: N -> Cd -> F Cd = {n|->c|->field2declaredClasses(|select(c,n).range|)} reach: N-> Cd -> F Cd = subSub(|class2declaredClasses(|n, subSub(|{c}|) |) |) r2 = transitiveClosure ( scc (reach))
protected void warnNoVisit(UMod.ClassDef cd, UMod.FieldDef fd, boolean isPrim, boolean isAbstract)
protected void makeCallDescend(GeneratedClass visitor, UMod.ClassDef cd, String methodname, int keynum, boolean optimizing)
protected GeneratedClass makeVisitorClass(GeneratedContext context, GeneratedClass basematcher, String name)
protected GeneratedClass make_v_simple(UMod.Forest model, GeneratedContext context, GeneratedClass basematcher, int keynum, String name)
protected GeneratedClass make_v_multiphase(UMod.Forest model, GeneratedContext context, GeneratedClass basematcher, int keynum, String name)
protected void make_prepost(GeneratedClass visitor, String methname, UMod.ClassDef cd, UMod.ClassDef superclass)
protected void make_actionprepost(UMod.ClassDef cd, GeneratedClass visitor, UMod.ClassDef superclass)
protected GeneratedClass make_v_dumper(UMod.Forest model, GeneratedContext context, GeneratedClass basematcher, int keynum, String name)
protected void make_dumpcode(GeneratedClass visitor, UMod.ClassDef cd, int keynum)
protected GeneratedClass make_v_rewritercorewriter(UMod.Forest model, GeneratedContext context, GeneratedClass basematcher, int keynum, String name, UMod2visitors.rewriterType rtype, boolean supportMultiSubst)
protected void make_breakLoop_method(UMod.Forest model, GeneratedClass visitor)
see also the complete user documentation .