Sirikata
liboh/plugins/js/emerson/EmersonUtil.h
Go to the documentation of this file.
00001 #ifndef __EMERSON_UTIL__
00002 #define __EMERSON_UTIL__
00003 
00004 
00005 
00006 #include<antlr3.h>
00007 #include <map>
00008 #include <stdio.h>
00009 #include <string>
00010 #include <boost/thread/mutex.hpp>
00011 
00012 
00013 pANTLR3_STRING emerson_printAST(pANTLR3_BASE_TREE tree);
00014 
00015 typedef std::map<int, int> EmersonLineMap;
00016 
00017 
00018 
00019 
00020 class EmersonInfo;
00021 
00022 class EmersonUtil
00023 {
00024 
00025 public:    
00026     
00027     typedef void (*EmersonErrorFuncType)(struct ANTLR3_BASE_RECOGNIZER_struct*, pANTLR3_UINT8*);
00028 
00029 
00030     static bool emerson_compile(
00031         std::string _originalFile, const char* em_script_str,
00032         std::string& toCompileTo, int& errorNum,
00033         EmersonErrorFuncType error_cb, EmersonLineMap* lineMap);
00034 
00035 
00036     static bool emerson_compile(
00037         std::string _originalFile, const char* em_script_str,
00038         std::string& toCompileTo, int& errorNum,
00039         EmersonErrorFuncType error_cb, FILE* dbg,
00040         EmersonLineMap* lineMap);
00041     
00042 private:
00043     
00044     static bool emerson_compile(
00045         const char*,std::string& toCompileTo, int& errorNum, FILE* dbg,
00046         EmersonLineMap* lineMap,EmersonInfo* );
00047 
00048     
00049 };
00050 
00051 
00052 #endif