|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.dms.kjc.EmptyAttributeVisitor
at.dms.kjc.ReplacingVisitor
at.dms.kjc.SLIRReplacingVisitor
at.dms.kjc.sir.lowering.RenameAll
public class RenameAll
This visitor renames every variable, method, and field to a globally unique name.
| Field Summary | |
|---|---|
static RenameAll |
globalRenamer
This renamer is used by the renameOverAllFilters, to rename across filters, keep names distinct over all the filter |
| Fields inherited from class at.dms.kjc.EmptyAttributeVisitor |
|---|
forwards |
| Fields inherited from interface at.dms.kjc.Constants |
|---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
| Method Summary | |
|---|---|
static void |
expandFunctionNames(SIRStream str)
For all init, initWork, and work functions in all filters of |
static String |
newName(String oldName)
Return a new name of the form oldName__number |
static void |
renameAllFilters(SIRStream str)
Renames the contents of all filters in that are connected to |
static void |
renameFilterContents(SIRFilter f1)
Renames the contents of |
static void |
renameOverAllFilters(SIRStream str)
Renames the contents of all filters in that are connected to |
static void |
renamePhylum(JPhylum phylum)
|
Object |
visitBlockStatement(JBlock self,
JavaStyleComment[] comments)
prints an expression statement |
Object |
visitFieldDeclaration(JFieldDeclaration self,
int modifiers,
CType type,
String ident,
JExpression expr)
prints a field declaration |
Object |
visitFieldExpression(JFieldAccessExpression self,
JExpression left,
String ident)
prints a field expression |
Object |
visitFormalParameters(JFormalParameter self,
boolean isFinal,
CType type,
String ident)
prints an array length expression |
Object |
visitForStatement(JForStatement self,
JStatement init,
JExpression cond,
JStatement incr,
JStatement body)
visits a for statement |
Object |
visitMethodCallExpression(JMethodCallExpression self,
JExpression prefix,
String ident,
JExpression[] args)
prints a method call expression |
Object |
visitMethodDeclaration(JMethodDeclaration self,
int modifiers,
CType returnType,
String ident,
JFormalParameter[] parameters,
CClassType[] exceptions,
JBlock body)
prints a method declaration |
Object |
visitNameExpression(JNameExpression self,
JExpression prefix,
String ident)
prints a name expression |
Object |
visitVariableDefinition(JVariableDefinition self,
int modifiers,
CType type,
String ident,
JExpression expr)
renames local variable expression |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static RenameAll globalRenamer
| Method Detail |
|---|
public static String newName(String oldName)
oldName - prefix for new name
public static void expandFunctionNames(SIRStream str)
public static void renameFilterContents(SIRFilter f1)
public static void renamePhylum(JPhylum phylum)
public static void renameOverAllFilters(SIRStream str)
public static void renameAllFilters(SIRStream str)
public Object visitBlockStatement(JBlock self,
JavaStyleComment[] comments)
ReplacingVisitor
visitBlockStatement in interface AttributeVisitor<Object>visitBlockStatement in class ReplacingVisitor
public Object visitFieldDeclaration(JFieldDeclaration self,
int modifiers,
CType type,
String ident,
JExpression expr)
ReplacingVisitor
visitFieldDeclaration in interface AttributeVisitor<Object>visitFieldDeclaration in class ReplacingVisitor
public Object visitFormalParameters(JFormalParameter self,
boolean isFinal,
CType type,
String ident)
ReplacingVisitor
visitFormalParameters in interface AttributeVisitor<Object>visitFormalParameters in class ReplacingVisitor
public Object visitVariableDefinition(JVariableDefinition self,
int modifiers,
CType type,
String ident,
JExpression expr)
visitVariableDefinition in interface AttributeVisitor<Object>visitVariableDefinition in class ReplacingVisitor
public Object visitForStatement(JForStatement self,
JStatement init,
JExpression cond,
JStatement incr,
JStatement body)
ReplacingVisitor
visitForStatement in interface AttributeVisitor<Object>visitForStatement in class ReplacingVisitor
public Object visitNameExpression(JNameExpression self,
JExpression prefix,
String ident)
ReplacingVisitor
visitNameExpression in interface AttributeVisitor<Object>visitNameExpression in class ReplacingVisitor
public Object visitMethodCallExpression(JMethodCallExpression self,
JExpression prefix,
String ident,
JExpression[] args)
ReplacingVisitor
visitMethodCallExpression in interface AttributeVisitor<Object>visitMethodCallExpression in class ReplacingVisitor
public Object visitMethodDeclaration(JMethodDeclaration self,
int modifiers,
CType returnType,
String ident,
JFormalParameter[] parameters,
CClassType[] exceptions,
JBlock body)
EmptyAttributeVisitor
visitMethodDeclaration in interface AttributeVisitor<Object>visitMethodDeclaration in class EmptyAttributeVisitor
public Object visitFieldExpression(JFieldAccessExpression self,
JExpression left,
String ident)
ReplacingVisitor
visitFieldExpression in interface AttributeVisitor<Object>visitFieldExpression in class ReplacingVisitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||