X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/d9c911529b1480684bb8b6280410f2d09c8525a1..1abe53bff9f3ea0bebf749a4b49271c4eff7ec12:/Driver.hpp diff --git a/Driver.hpp b/Driver.hpp index cd39cfb..fbc96d9 100644 --- a/Driver.hpp +++ b/Driver.hpp @@ -29,32 +29,43 @@ #include #include "Location.hpp" -#include "Parser.hpp" - -enum CYState { - CYClear, - CYRestricted, - CYNewLine +#include "Options.hpp" +#include "Pooling.hpp" +#include "Standard.hpp" + +struct CYExpression; +struct CYScript; +struct CYWord; + +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 +83,7 @@ class _visible CYDriver { typedef std::vector Errors; - CYProgram *program_; + CYScript *script_; Errors errors_; bool auto_; @@ -107,13 +118,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);