#include "glslparsertable_p.h" #include "glsllexer.h" #include "glslast.h" #include #include namespace GLSL { class Parser: public GLSLParserTable { public: Parser(const char *source, unsigned size, int variant); ~Parser(); bool parse(); private: inline int consumeToken() { return _index++; } inline const Token &tokenAt(int index) const { return _tokens.at(index); } inline int tokenKind(int index) const { return _tokens.at(index).kind; } void dump(AST *ast); private: int _tos; int _index; std::vector _stateStack; std::vector _locationStack; std::vector _astStack; std::vector _tokens; }; } // end of namespace GLSL