|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.sir.lowering.StaticsProp.IterOverAllFieldsAndMethods
public static class StaticsProp.IterOverAllFieldsAndMethods
Methods to iterate a EmptyAttributeVisitor over all fields / methods / parameters of a stream, or of a subgraph of the stream graph.
The methods preVisit(SIRStream)
and postVisit(SIRStream)
are overridable.
When iterating the visitor over a subgraph, you can use these methods to get / set information
for the visitor per SIRStream.
You can select to visit field definitions, method definitions, and / or parameter definitions. If visiting parameter definitions for push / pop / peek rates,
Constructor Summary | |
---|---|
StaticsProp.IterOverAllFieldsAndMethods()
|
Method Summary | |
---|---|
void |
iterOverAllFieldsAndMethods(SIRStream str,
boolean doFields,
boolean doMethods,
boolean doParameters,
EmptyAttributeVisitor visitor)
Visit all field, method, and parameter definitions reachable from a SIRStream (Including substreams). |
static void |
iterOverFieldsAndMethods(SIRStream str,
boolean doFields,
boolean doMethods,
boolean doParameters,
EmptyAttributeVisitor visitor)
Visit all field and method declarations in a SIRStream element (Not including substreams). |
protected void |
postVisit(SIRStream str)
Operation to perform after visiting a SIRStream |
protected boolean |
preVisit(SIRStream str)
Operation to perform before visiting a SIRstream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StaticsProp.IterOverAllFieldsAndMethods()
Method Detail |
---|
protected boolean preVisit(SIRStream str)
str
- a SIRStream
protected void postVisit(SIRStream str)
str
- a SIRStreampublic void iterOverAllFieldsAndMethods(SIRStream str, boolean doFields, boolean doMethods, boolean doParameters, EmptyAttributeVisitor visitor)
iterOverFieldsAndMethods
for more details.
str
- a SIRStream object -- root of traversaldoFields
- == true to visit field declarationsdoMethods
- == true to visit method declarationsdoParameters
- == true to visit parameters (push / pop / peek rates, joiner / splitter weights...)visitor
- inheriting from EmptyAttributeVisitor that will be used on field / method / parameter declarations.public static void iterOverFieldsAndMethods(SIRStream str, boolean doFields, boolean doMethods, boolean doParameters, EmptyAttributeVisitor visitor)
KjcVisitor
to gather information, you
still need to use a subclass of EmptyAttributeVisitor
.
In fact, you will want a visitor extended for dealing with SIR constructs.
This method contains special cases for visitors extending
ReplacingVisitor
: these visitors automatically
replace (destructively update) sub-trees of the AST that acepts them.
Here, we update any top-level method declarations / field declarations / parameter values,
changed by a ReplacingVisitor.
If you are updating parameters, or just inspecting the actual values of parameters,
you should call #at.dms.kjc.sir.SIRDynamicRateManager.pushIdentityPolicy()
before calling this method (and #at.dms.kjc.sir.SIRDynamicRateManager.popPolicy()
after).
str
- a SIRStream object (filter, splitjoin, ...)doFields
- == true to visit field declarationsdoMethods
- == true to visit method declarationsdoParameters
- == true to visit parameters (push / pop / peek rates, joiner / splitter weights...)visitor
- inheriting from EmptyAttributeVisitor that will be used on field / method / parameter declarations.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |