Compiler.h 471 B

123456789101112131415161718192021222324252627
  1. #ifndef COMPILER_H
  2. #define COMPILER_H
  3. #include <string>
  4. #include "../data/ArrayList.h"
  5. #include "Token.h"
  6. #include "Tokenizer.h"
  7. #include "../code/Script.h"
  8. using namespace std;
  9. class Compiler
  10. {
  11. public:
  12. Compiler(string s);
  13. virtual ~Compiler();
  14. void compile(Script& sc);
  15. private:
  16. Tokenizer tokenizer;
  17. void compile(Script& sc, TokenList& tokens);
  18. void addInstruction(ArrayList<Instruction*>& code, Stack<Token*>& st, Token* t);
  19. };
  20. #endif