X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/c1d3e52e58e86c49f9d04e06ae8e0ece4b98250c..9d2b125d81372b42e8ae310c8de8650d13010d1e:/Driver.hpp?ds=sidebyside diff --git a/Driver.hpp b/Driver.hpp index 5c330e7..0df39d7 100644 --- a/Driver.hpp +++ b/Driver.hpp @@ -31,29 +31,35 @@ #include "Location.hpp" #include "Parser.hpp" -enum CYState { - CYClear, - CYRestricted, - CYNewLine +enum CYMark { + CYMarkIgnore, + CYMarkScript, + CYMarkModule, }; -class CYDriver { +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, @@ -71,7 +77,7 @@ class CYDriver { typedef std::vector Errors; - CYProgram *program_; + CYScript *script_; Errors errors_; bool auto_; @@ -106,10 +112,12 @@ class CYDriver { void ScannerDestroy(); public: - CYDriver(std::istream &data, const std::string &filename = ""); + CYDriver(CYPool &pool, std::istream &data, const std::string &filename = ""); ~CYDriver(); - Condition GetCondition(); + bool Parse(CYMark mark = CYMarkScript); + void Replace(CYOptions &options); + void SetCondition(Condition condition); void PushCondition(Condition condition);