|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.javalanglevels.tree.JExpressionIFDepthFirstVisitor<java.lang.Void>
edu.rice.cs.javalanglevels.Augmentor
public class Augmentor
| Nested Class Summary | |
|---|---|
static class |
Augmentor.AugmentorTest
Test class for the Augmentor class. |
static class |
Augmentor.Exception
|
static class |
Augmentor.MethodBodyAugmentor
|
| Constructor Summary | |
|---|---|
|
Augmentor(boolean safeSupportCode,
java.io.BufferedReader fileIn,
java.io.BufferedWriter fileOut,
LanguageLevelVisitor llv)
Main constructor for Augmentor: Used by the LanguageLevelConverter when converting language level files. |
protected |
Augmentor(SymbolData d)
Create another Augmentor sharing the same static fields as the current Augmentor, but with a new _enclosingData d. |
| Method Summary | |
|---|---|
protected void |
augmentVariableDeclarationModifiers(VariableDeclaration that)
Writes out implicit variableDeclarationModfiers that must be added to augmented file. |
protected java.lang.Void |
defaultCase(JExpressionIF that)
This method is called by default from cases that do not override forCASEOnly. |
java.lang.Void |
forAbstractMethodDef(AbstractMethodDef md)
Delegate the augmentation of this AbstractMethodDef to forMethodDef. |
java.lang.Void |
forAnonymousClassInstantiation(AnonymousClassInstantiation e)
|
java.lang.Void |
forClassDef(ClassDef cd)
Class Defs can only appear at the top level of a source file. |
java.lang.Void |
forComplexAnonymousClassInstantiation(ComplexAnonymousClassInstantiation e)
Visit the encosing part of this ComplexAnonymousClass name, and then delegate to forAnonymousClassInstantiation(e). |
java.lang.Void |
forConcreteMethodDef(ConcreteMethodDef that)
Delegate the augmentation of this method def's declaration to forMethodDef. |
java.lang.Void |
forConstructorDef(ConstructorDef that)
Do the augmentation necessary for a ConstructorDef. |
java.lang.Void |
forFormalParameter(FormalParameter that)
All formal parameters (parameters to a method or in a catch clause) are augmented to be "final". |
java.lang.Void |
forInnerClassDef(InnerClassDef cd)
Look up this inner class in the enclosing data, and then visits its body. |
java.lang.Void |
forInnerInterfaceDef(InnerInterfaceDef cd)
Look up this inner interface in the enclosing data, and then visit its body with a new Augmentor. |
java.lang.Void |
forInterfaceDef(InterfaceDef cd)
Look up this top level interface in the symbolTable, and then visit its body. |
protected static TypeData[] |
formalParameters2TypeDatas(FormalParameter[] fps,
SymbolData enclosing)
Convert the provided FormalParameter array into an array of TypeData corresponding to the types of the FormalParameters. |
java.lang.Void |
forMethodDef(MethodDef that)
Do the augmentation necessary for a MethodDef. |
java.lang.Void |
forSimpleAnonymousClassInstantiation(SimpleAnonymousClassInstantiation e)
Delegate to for AnonymousClassInstantiation(e). |
java.lang.Void |
forSourceFile(SourceFile sf)
Sort the Class and Interface defs based on the order they appear in the file. |
java.lang.Void |
forVariableDeclaration(VariableDeclaration that)
Do the augmenting appropriate for a Variable Declaration: all Variable Declarations should be augmented with "final" if such a modifier is not already present. |
static java.util.SortedMap<java.lang.Integer,java.lang.Integer> |
getLineNumberMap()
Returns a copy of the line number map that maps original dj* line numbers to generated java line numbers. |
protected java.lang.Void[] |
makeArrayOfRetType(int len)
Return a Void array of the specified size. |
protected static void |
writeAccessors(SymbolData sd,
int baseIndent)
Write an accessor method for each previously generated (determined by MethodData.isGenerated()) accessor. |
protected static void |
writeAnonEquals(int baseIndent)
AnonymousClasses are only equal if they are identical. |
protected static void |
writeConstructor(java.lang.String className,
SymbolData sd,
int baseIndent)
Write a constructor for a previously generated (determined by MethodData.isGenerated()) constructor, if one exists. |
protected static void |
writeEquals(java.lang.String className,
SymbolData sd,
int baseIndent,
java.lang.String valueEqualsName)
Write an equals method that requires the Object parameter to be an instanceof this type and have matching fields for each of the fields with visible accessors. |
protected static void |
writeHashCode(java.lang.String className,
SymbolData sd,
int baseIndent,
boolean waitForVarDef,
java.lang.String valueHashCodeName)
Write a hashCode method that is consistent with the generated equals(Object) method. |
protected static void |
writeSafeEquals(java.lang.String className,
SymbolData sd,
int baseIndent,
java.lang.String valueEqualsName,
MethodData[] accessors)
Helper to writeEquals; writes an equals that handles infinitely-recursive data structures. |
protected static void |
writeSafeHashCode(java.lang.String className,
SymbolData sd,
int baseIndent,
boolean waitForVarDef,
java.lang.String valueHashCodeName,
MethodData[] accessors)
Helper to writeHashCode; writes a hashCode that handles infinitely-recursive data structures. |
protected static void |
writeSafeToString(SymbolData sd,
int baseIndent,
java.lang.String valueToStringName,
MethodData[] accessors)
Helper to writeToString; writes a toString that handles infinitely-recursive data structures. |
protected static void |
writeSimpleEquals(java.lang.String className,
SymbolData sd,
int baseIndent,
java.lang.String valueEqualsName,
MethodData[] accessors)
Helper to writeEquals; writes a simple equals that does not handle infinitely-recursive data structures. |
protected static void |
writeSimpleHashCode(java.lang.String className,
SymbolData sd,
int baseIndent,
boolean waitForVarDef,
java.lang.String valueHashCodeName,
MethodData[] accessors)
Helper to writeHashCode; writes a simple hashCode that does not handle infinitely-recursive data structures. |
protected static void |
writeSimpleToString(SymbolData sd,
int baseIndent,
java.lang.String valueToStringName,
MethodData[] accessors)
Helper to writeToString; writes a short toString that does not handle infinitely-recursive data structures. |
protected static void |
writeToString(SymbolData sd,
int baseIndent,
java.lang.String valueToStringName)
Write a toString method that prints out each field with a visible accessor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Augmentor(boolean safeSupportCode,
java.io.BufferedReader fileIn,
java.io.BufferedWriter fileOut,
LanguageLevelVisitor llv)
safeSupportCode - true if the user wants safe support code to be generated (this comes with a high overhead)fileIn - A BufferedReader corresponding to the LanguageLevel file we should read fromfileOut - A BufferedWriter corresponding to the .java file we should write to.llv - The LanguageLevelVisitor that was used to traverse the language level file.protected Augmentor(SymbolData d)
d - The EnclosingData from which this Augmentor works.| Method Detail |
|---|
protected java.lang.Void defaultCase(JExpressionIF that)
defaultCase in class JExpressionIFDepthFirstVisitor<java.lang.Void>protected java.lang.Void[] makeArrayOfRetType(int len)
makeArrayOfRetType in class JExpressionIFDepthFirstVisitor<java.lang.Void>protected void augmentVariableDeclarationModifiers(VariableDeclaration that)
that - is the field declaration being augmentedpublic java.lang.Void forVariableDeclaration(VariableDeclaration that)
forVariableDeclaration in interface JExpressionIFVisitor<java.lang.Void>forVariableDeclaration in class JExpressionIFDepthFirstVisitor<java.lang.Void>that - The VariableDeclaration we are augmenting.public java.lang.Void forFormalParameter(FormalParameter that)
forFormalParameter in interface JExpressionIFVisitor<java.lang.Void>forFormalParameter in class JExpressionIFDepthFirstVisitor<java.lang.Void>that - The FormalParameter we are augmenting.public java.lang.Void forConstructorDef(ConstructorDef that)
forConstructorDef in interface JExpressionIFVisitor<java.lang.Void>forConstructorDef in class JExpressionIFDepthFirstVisitor<java.lang.Void>that - The ConstructorDef we are augmenting.public java.lang.Void forMethodDef(MethodDef that)
that - The MethodDef being visited.public java.lang.Void forAbstractMethodDef(AbstractMethodDef md)
forAbstractMethodDef in interface JExpressionIFVisitor<java.lang.Void>forAbstractMethodDef in class JExpressionIFDepthFirstVisitor<java.lang.Void>that - The AbstractMethodDef being augmented.public java.lang.Void forConcreteMethodDef(ConcreteMethodDef that)
forConcreteMethodDef in interface JExpressionIFVisitor<java.lang.Void>forConcreteMethodDef in class JExpressionIFDepthFirstVisitor<java.lang.Void>that - The ConcreteMethodDef being augmented.public java.lang.Void forClassDef(ClassDef cd)
forClassDef in interface JExpressionIFVisitor<java.lang.Void>forClassDef in class JExpressionIFDepthFirstVisitor<java.lang.Void>cd - The ClassDef we're augmenting.public java.lang.Void forInnerClassDef(InnerClassDef cd)
forInnerClassDef in interface JExpressionIFVisitor<java.lang.Void>forInnerClassDef in class JExpressionIFDepthFirstVisitor<java.lang.Void>cd - The InnerClassDef we are augmenting.public java.lang.Void forInterfaceDef(InterfaceDef cd)
forInterfaceDef in interface JExpressionIFVisitor<java.lang.Void>forInterfaceDef in class JExpressionIFDepthFirstVisitor<java.lang.Void>cd - The InterfaceDef being augmented.public java.lang.Void forInnerInterfaceDef(InnerInterfaceDef cd)
forInnerInterfaceDef in interface JExpressionIFVisitor<java.lang.Void>forInnerInterfaceDef in class JExpressionIFDepthFirstVisitor<java.lang.Void>public java.lang.Void forAnonymousClassInstantiation(AnonymousClassInstantiation e)
public java.lang.Void forSimpleAnonymousClassInstantiation(SimpleAnonymousClassInstantiation e)
forSimpleAnonymousClassInstantiation in interface JExpressionIFVisitor<java.lang.Void>forSimpleAnonymousClassInstantiation in class JExpressionIFDepthFirstVisitor<java.lang.Void>public java.lang.Void forComplexAnonymousClassInstantiation(ComplexAnonymousClassInstantiation e)
forComplexAnonymousClassInstantiation in interface JExpressionIFVisitor<java.lang.Void>forComplexAnonymousClassInstantiation in class JExpressionIFDepthFirstVisitor<java.lang.Void>public java.lang.Void forSourceFile(SourceFile sf)
forSourceFile in interface JExpressionIFVisitor<java.lang.Void>forSourceFile in class JExpressionIFDepthFirstVisitor<java.lang.Void>
protected static TypeData[] formalParameters2TypeDatas(FormalParameter[] fps,
SymbolData enclosing)
protected static void writeConstructor(java.lang.String className,
SymbolData sd,
int baseIndent)
sd - The method's enclosing class.baseIndent - The base indent level (number of spaces).
protected static void writeAccessors(SymbolData sd,
int baseIndent)
sd - The method's enclosing class.baseIndent - The base indent level (number of spaces).
protected static void writeToString(SymbolData sd,
int baseIndent,
java.lang.String valueToStringName)
sd - The method's enclosing class.baseIndent - The base indent level (number of spaces).valueToStringName - The name of the generated valueToString method
protected static void writeSafeToString(SymbolData sd,
int baseIndent,
java.lang.String valueToStringName,
MethodData[] accessors)
protected static void writeSimpleToString(SymbolData sd,
int baseIndent,
java.lang.String valueToStringName,
MethodData[] accessors)
protected static void writeEquals(java.lang.String className,
SymbolData sd,
int baseIndent,
java.lang.String valueEqualsName)
className - The unqualified name of this method's class or, in the case of anonymous inner classes, the
name of its superclass (or implemented interface).sd - The method's enclosing class.baseIndent - The base indent level (number of spaces).valueEqualsName - The name of the generated valueEquals method
protected static void writeSafeEquals(java.lang.String className,
SymbolData sd,
int baseIndent,
java.lang.String valueEqualsName,
MethodData[] accessors)
protected static void writeSimpleEquals(java.lang.String className,
SymbolData sd,
int baseIndent,
java.lang.String valueEqualsName,
MethodData[] accessors)
protected static void writeAnonEquals(int baseIndent)
protected static void writeHashCode(java.lang.String className,
SymbolData sd,
int baseIndent,
boolean waitForVarDef,
java.lang.String valueHashCodeName)
className - The unqualified name of this method's class or, in the case of anonymous inner classes, the
name of its superclass (or implemented interface).sd - The method's enclosing class.baseIndent - The base indent level (number of spaces).waitForVarDef - True iff static variables cannot be defined in the current context and should be deferred
by adding them to _endOfClassVarDefs.valueHashCodeName - The name of the generated valueHashCode method
protected static void writeSafeHashCode(java.lang.String className,
SymbolData sd,
int baseIndent,
boolean waitForVarDef,
java.lang.String valueHashCodeName,
MethodData[] accessors)
className - The unqualified name of this method's class or, in the case of anonymous inner classes, the
name of its superclass (or implemented interface).sd - The method's enclosing class.baseIndent - The base indent level (number of spaces).waitForVarDef - True iff static variables cannot be defined in the current context and should be deferred
by adding them to _endOfClassVarDefs.valueHashCodeName - The name of the generated valueHashCode methodaccessors - An Array of the MethodDatas corresponding to the accessors for this class.
protected static void writeSimpleHashCode(java.lang.String className,
SymbolData sd,
int baseIndent,
boolean waitForVarDef,
java.lang.String valueHashCodeName,
MethodData[] accessors)
className - The unqualified name of this method's class or, in the case of anonymous inner classes, the
name of its superclass (or implemented interface).sd - The method's enclosing class.baseIndent - The base indent level (number of spaces).waitForVarDef - True iff static variables cannot be defined in the current context and should be deferred
by adding them to _endOfClassVarDefs.valueHashCodeName - The name of the generated valueHashCode methodaccessors - An Array of the MethodDatas corresponding to the accessors for this class.public static java.util.SortedMap<java.lang.Integer,java.lang.Integer> getLineNumberMap()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||