jtlc/main/Compiler.h
josh d052712d94 broke Compiler::write() into Compiler::writeHeader() and Compiler::writeFunction()
git-svn-id: svn://anubis/jtlc/trunk@26 f5bc74b8-7b62-4e90-9214-7121d538519f
2010-01-19 16:20:27 +00:00

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