X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/d9c911529b1480684bb8b6280410f2d09c8525a1..9d2b125d81372b42e8ae310c8de8650d13010d1e:/Driver.hpp diff --git a/Driver.hpp b/Driver.hpp index cd39cfb..0df39d7 100644 --- a/Driver.hpp +++ b/Driver.hpp @@ -31,30 +31,35 @@ #include "Location.hpp" #include "Parser.hpp" -enum CYState { - CYClear, - CYRestricted, - CYNewLine +enum CYMark { + CYMarkIgnore, + CYMarkScript, + CYMarkModule, }; class _visible CYDriver { public: + CYPool &pool_; void *scanner_; - CYState state_; + std::vector buffer_; + bool tail_; + std::stack in_; + std::stack return_; + std::stack template_; + std::stack yield_; - struct { - bool AtImplementation; - bool Function; - bool OpenBrace; - } no_; + bool newline_; + bool last_; + bool next_; std::istream &data_; + CYMark mark_; int debug_; bool strict_; - bool commented_; + bool highlight_; enum Condition { RegExpCondition, @@ -72,7 +77,7 @@ class _visible CYDriver { typedef std::vector Errors; - CYProgram *program_; + CYScript *script_; Errors errors_; bool auto_; @@ -107,13 +112,12 @@ class _visible CYDriver { void ScannerDestroy(); public: - CYDriver(std::istream &data, const std::string &filename = ""); + CYDriver(CYPool &pool, std::istream &data, const std::string &filename = ""); ~CYDriver(); - bool Parse(CYPool &pool); - void Replace(CYPool &pool, CYOptions &options); + bool Parse(CYMark mark = CYMarkScript); + void Replace(CYOptions &options); - Condition GetCondition(); void SetCondition(Condition condition); void PushCondition(Condition condition);