OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SKSL_PARSER | 8 #ifndef SKSL_PARSER |
9 #define SKSL_PARSER | 9 #define SKSL_PARSER |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 std::unique_ptr<ASTExpression> term(); | 190 std::unique_ptr<ASTExpression> term(); |
191 | 191 |
192 bool intLiteral(int64_t* dest); | 192 bool intLiteral(int64_t* dest); |
193 | 193 |
194 bool floatLiteral(double* dest); | 194 bool floatLiteral(double* dest); |
195 | 195 |
196 bool boolLiteral(bool* dest); | 196 bool boolLiteral(bool* dest); |
197 | 197 |
198 bool identifier(std::string* dest); | 198 bool identifier(std::string* dest); |
199 | 199 |
200 | |
201 void* fScanner; | 200 void* fScanner; |
202 YY_BUFFER_STATE fBuffer; | 201 YY_BUFFER_STATE fBuffer; |
| 202 // current parse depth, used to enforce a recursion limit to try to keep us
from overflowing the |
| 203 // stack on pathological inputs |
| 204 int fDepth = 0; |
203 Token fPushback; | 205 Token fPushback; |
204 SymbolTable& fTypes; | 206 SymbolTable& fTypes; |
205 ErrorReporter& fErrors; | 207 ErrorReporter& fErrors; |
| 208 |
| 209 friend class AutoDepth; |
206 }; | 210 }; |
207 | 211 |
208 } // namespace | 212 } // namespace |
209 | 213 |
210 #endif | 214 #endif |
OLD | NEW |