X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/2c1d569a0ed9ddd14d3d1d73ee8be776e0889d35..63db22e50caddb75792b67534547cb3ac7ccff61:/Driver.hpp diff --git a/Driver.hpp b/Driver.hpp index 88956fb..fbc96d9 100644 --- a/Driver.hpp +++ b/Driver.hpp @@ -29,12 +29,18 @@ #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 { @@ -42,20 +48,24 @@ class _visible CYDriver { 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, @@ -73,7 +83,7 @@ class _visible CYDriver { typedef std::vector Errors; - CYProgram *program_; + CYScript *script_; Errors errors_; bool auto_; @@ -111,10 +121,9 @@ class _visible CYDriver { CYDriver(CYPool &pool, std::istream &data, const std::string &filename = ""); ~CYDriver(); - bool Parse(); + bool Parse(CYMark mark = CYMarkScript); void Replace(CYOptions &options); - Condition GetCondition(); void SetCondition(Condition condition); void PushCondition(Condition condition);