src/script/parser.h

branch
scripting
changeset 924
d1ac217c9165
parent 923
e15a577a0bfe
child 925
2f316b57b508
equal deleted inserted replaced
923:e15a577a0bfe 924:d1ac217c9165
139 char read(); 139 char read();
140 void unread(); 140 void unread();
141 void skipSpace(); 141 void skipSpace();
142 bool isAtEnd() const { return m_state.position >= m_data.length(); } 142 bool isAtEnd() const { return m_state.position >= m_data.length(); }
143 bool tryMatch (const char* text, bool caseSensitive); 143 bool tryMatch (const char* text, bool caseSensitive);
144 void tokenMustBe (TokenType desiredType);
144 145
145 template<typename... Args> 146 template<typename... Args>
146 void scriptError (QString text, Args... args) 147 void scriptError (QString text, Args... args)
147 { 148 {
148 scriptError (format (text, args...)); 149 scriptError (format (text, args...));
151 private: 152 private:
152 QString m_script; 153 QString m_script;
153 QByteArray m_data; 154 QByteArray m_data;
154 QVector<int> m_lineEndings; 155 QVector<int> m_lineEndings;
155 SavedState m_state; 156 SavedState m_state;
156 AstNode* m_astRoot; 157 Ast::RootPointer m_astRoot;
157 Token m_rejectedToken; 158 Token m_rejectedToken;
158 159
159 void parseString(); 160 void parseString();
160 bool parseNumber(); 161 bool parseNumber();
161 QString parseEscapeSequence(); 162 QString parseEscapeSequence();

mercurial