|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.rstream.GenerateCCode
public class GenerateCCode
This class is the driver that generates the c code for the application. It traverses the stream graph, generating code for each filter. It generates the init fucntion calls for each filter, the initialization stage, and the steady-state stage. It writes its output to *str.c*.
Field Summary | |
---|---|
static boolean |
generateTimingCode
|
static String |
MAINMETHOD
|
Method Summary | |
---|---|
static void |
addStmtArray(JBlock block,
JStatement[] stms)
given a block *block*, add Statement array *stms* to the end of the block, if stms is empty, do nothing |
static void |
addStmtArrayFirst(JBlock block,
JStatement[] stms)
given a block *block*, add Statement array *stms* to the beginning of the block, if stms is empty, do nothing |
static void |
generate(FlatNode top)
The entry point of the code generation pass. |
protected String |
getExterns()
for now, just print all the common math functions as external functions |
static JStatement |
makeDoLoop(JStatement body,
JLocalVariable var,
JIntLiteral count)
Returns a do loop that uses local variable *var* to count *count* times with the body of the loop being *body*. |
static JStatement |
makeForLoop(JStatement body,
JLocalVariable var,
JExpression count)
Returns a for loop that uses local variable *var* to count *count* times with the body of the loop being *body*. |
static JVariableDefinition |
newIntLocal(String prefix,
int uniqueID,
int initVal)
Return a new integer local variable definition with name *prefix* + *uniqueID*, that is initialized to *initVal*. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean generateTimingCode
public static String MAINMETHOD
Method Detail |
---|
public static void generate(FlatNode top)
top
- The top level node in the flat graph for
the applicationprotected String getExterns()
public static JStatement makeForLoop(JStatement body, JLocalVariable var, JExpression count)
public static JStatement makeDoLoop(JStatement body, JLocalVariable var, JIntLiteral count)
public static JVariableDefinition newIntLocal(String prefix, int uniqueID, int initVal)
public static void addStmtArray(JBlock block, JStatement[] stms)
public static void addStmtArrayFirst(JBlock block, JStatement[] stms)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |