/src/CMake/Source/cmExprParserHelper.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include <string> |
8 | | #include <vector> |
9 | | |
10 | | #include <cm3p/kwiml/int.h> |
11 | | |
12 | | class cmExprParserHelper |
13 | | { |
14 | | public: |
15 | | struct ParserType |
16 | | { |
17 | | KWIML_INT_int64_t Number; |
18 | | }; |
19 | | |
20 | | cmExprParserHelper(); |
21 | | ~cmExprParserHelper(); |
22 | | |
23 | | int ParseString(char const* str, int verb); |
24 | | |
25 | | int LexInput(char* buf, int maxlen); |
26 | | void Error(char const* str); |
27 | | |
28 | | void SetResult(KWIML_INT_int64_t value); |
29 | | |
30 | 746 | KWIML_INT_int64_t GetResult() const { return this->Result; } |
31 | | |
32 | 746 | char const* GetError() { return this->ErrorString.c_str(); } |
33 | | |
34 | | void UnexpectedChar(char c); |
35 | | |
36 | 746 | std::string const& GetWarning() const { return this->WarningString; } |
37 | | |
38 | | private: |
39 | | std::string::size_type InputBufferPos; |
40 | | std::string InputBuffer; |
41 | | std::vector<char> OutputBuffer; |
42 | | int CurrentLine; |
43 | | int Verbose; |
44 | | |
45 | | void Print(char const* place, char const* str); |
46 | | |
47 | | void SetError(std::string errorString); |
48 | | |
49 | | KWIML_INT_int64_t Result; |
50 | | char const* FileName; |
51 | | long FileLine; |
52 | | std::string ErrorString; |
53 | | std::string WarningString; |
54 | | }; |
55 | | |
56 | 3.73k | #define YYSTYPE cmExprParserHelper::ParserType |
57 | | #define YYSTYPE_IS_DECLARED |
58 | | #define YY_EXTRA_TYPE cmExprParserHelper* |
59 | | #define YY_DECL int cmExpr_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner) |