22 std::vector<std::string> includes;
23 std::vector<std::string> globalVars;
30 void generateIncludes();
37 void generateGlobalVars();
44 void generateMainFunction();
51 void generateRandomNumberGenerator();
60 std::string createParams();
70 void genMakefile(std::string dir, std::string target);
111 void addLine(std::string,
int = 0);
119 void addLine(std::vector<std::string>,
int = 0);
174 void freeVars(
bool =
false,
int = 0);
The GeneratorFunction class represents a function in the generated code.
Definition generatorFunction.h:13
The Generator class handles the generation of code and files for benchmarks.
Definition generator.h:20
void addLine(std::string, int=0)
Adds a line of code to the current function with optional indentation.
Definition generator.cpp:60
std::stack< int > ifCounter
Definition generator.h:76
Generator(std::string variableType)
Constructs a Generator object with a specified variable type.
Definition generator.cpp:3
int addVar(std::string)
Adds a new variable of the specified type to the current scope.
Definition generator.cpp:130
bool functionExists(int)
Checks if a function with a given ID already exists.
Definition generator.cpp:93
int loopLevel
Definition generator.h:78
void startScope()
Starts a new scope for variable declarations.
Definition generator.cpp:71
std::stack< GeneratorScope > currentScope
Definition generator.h:82
std::stack< GeneratorFunction * > currentFunction
Definition generator.h:75
std::string varType
Definition generator.h:80
GeneratorFunction mainFunction
Definition generator.h:73
std::list< GeneratorFunction > functions
Definition generator.h:74
std::map< int, GeneratorVariable * > variables
Definition generator.h:81
void endFunc()
Ends the current function.
Definition generator.cpp:159
void returnFunc(int)
Returns a value from a function.
Definition generator.cpp:148
void endScope()
Ends the current scope.
Definition generator.cpp:153
~Generator()
Destructor for the Generator class.
Definition generator.h:99
int varCounter
Definition generator.h:77
void startFunc(int, int)
Starts the definition of a new function.
Definition generator.cpp:76
int loopCounter
Definition generator.h:79
void callFunc(int, int)
Calls a function with the specified ID and parameters.
Definition generator.cpp:113
void generateFiles(std::string)
Generates source and header files for the benchmark.
Definition generator.cpp:192
void freeVars(bool=false, int=0)
Frees variables in the current scope.
Definition generator.cpp:136