29 lines
581 B
C++
29 lines
581 B
C++
|
|
#ifndef COMPILER_H
|
|
#define COMPILER_H
|
|
|
|
#include <stdio.h>
|
|
#include <string>
|
|
#include <map>
|
|
|
|
class Compiler
|
|
{
|
|
public:
|
|
Compiler(const std::string & out_filename);
|
|
~Compiler();
|
|
|
|
void writeHeader(const std::string & str);
|
|
void writeFunction(const std::string & str);
|
|
void beginFunction(const std::string & name);
|
|
void close();
|
|
|
|
protected:
|
|
FILE * m_outfile;
|
|
std::string m_header;
|
|
std::map<std::string, std::string> m_functions;
|
|
std::string m_current_function;
|
|
bool m_file_open;
|
|
};
|
|
|
|
#endif
|