CodeTransformations Module
This module implements the core of a simple compiler for translating MiniC programs to CmdType programs and control dataflow graphs.
Functions and values
Function or value | Description |
|
ExpandFunCallsInStmtC expands all function calls in a statement. The function definitions have to be provided in the array of MiniC functions.
|
Full Usage:
ExpandFunCallsInStmtC funcArr stmt
Parameters:
MiniCFunction[]
stmt : StmtC
Returns: StmtC
|
ExpandFunCallsInStmtC expands all function calls in a statement. The function definitions have to be provided in the array of MiniC functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
PrintStmtC2C indent ostr stmt
Parameters:
string
ostr : TextWriter
stmt : StmtC
|
print a statement as C code; it is called with the initial indentation, the stream to print and the MiniC statement
|
Full Usage:
PrintThread2C ostr mcp thrdName
Parameters:
TextWriter
mcp : MiniCProgram
thrdName : string
|
print a single threads of a MiniC program as C code after expanding the function and procedure calls
|
|
print all threads of a MiniC program as C code after expanding the function and procedure calls
|
|
compute SSA form of a MiniC program (it only transforms the threads, and not the functions which are expected to be inlined before this trafa)
|
|
Compute static single assignment (SSA) form for a given MiniC statement. The function requires also the declarations of the variables that occur in the statement, and will generate a pair (decL,stmtSSA) where the declarations decL contain the declarations of the generated variables, and stmtSSA is the statement in SSA form. |
|
|
Translate a MiniC type to a type in C. The function returns a tuple (tyS,dimS) where tyS is the type in C syntax and dimS is a further string for dimensions in case of arrays (otherwise it is the empty string).
|