|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.copernicus.c.MethodListGenerator
public class MethodListGenerator
A class that extracts ordered lists of method declarations with an ordering convention that facilitates translation of methods into function pointers (e.g., for C code generation).
Specifically, the class extracts the class initializer method (if present); the list of constructors; the list of all new public and protected methods that are defined for a given class (i.e., new method definitions, excluding definitions that override methods in superclasses); the list of inherited methods; and the list of private methods. For sub-classes, overridden methods in the inherited methods list are replaced with the overriding definitions. Thus, the inherited methods list is the list of 'active' definitions in the current scope whose declarations originated in superclasses.
For example, consider the following class/method combinations:
class C1(base class), public methods m1, m2, m3; private method p1
class C2(extends C1), public methods m4, m5(overrides m2)
class C3 (extends C2), public methods m6, m7; private methods p1, p2
Then the inherited methods list generated for C3 is
m1, m5, m3, m4;
the private list generated for C3 is
p1, p2;
the inherited methods list generated for C2 is
m1, m5, m3;
and the new methods list generated for C2 is
m4.
If function pointers are declared according to these orderings in the translated type definitions associated with C1, C2, and C3, then virtual functions can be implemented correctly.
The lists constructed by this class are lists of method declarations. That is, each element is of type SootMethod.
| Red (ssb) |
| Red (ssb) |
| Method Summary | |
|---|---|
protected static void |
_generate(soot.SootClass source)
Given a class, construct the lists of constructors, inherited methods, new public and protected methods, and private methods. |
static soot.SootMethod |
getClassInitializer(soot.SootClass source)
Given a class, return the class initializer method if it exists, or return null if the class does not have a class initializer method. |
static java.util.LinkedList |
getConstructors(soot.SootClass source)
Return the list of constructors for a given class. |
static java.util.LinkedList |
getInheritedMethods(soot.SootClass source)
Return the list of inherited methods for a given class. |
static java.util.LinkedList |
getNewMethods(soot.SootClass source)
Return the list of new methods for a given class. |
static java.util.LinkedList |
getPrivateMethods(soot.SootClass source)
Return the list of private methods for a given class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static soot.SootMethod getClassInitializer(soot.SootClass source)
source - The class.
public static java.util.LinkedList getConstructors(soot.SootClass source)
source - The class.
public static java.util.LinkedList getInheritedMethods(soot.SootClass source)
source - The class.
public static java.util.LinkedList getNewMethods(soot.SootClass source)
source - The class.
public static java.util.LinkedList getPrivateMethods(soot.SootClass source)
source - The class.
protected static void _generate(soot.SootClass source)
source - The class.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||