resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmExprParserHelper.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt 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(const char* str, int verb);
24
25   int LexInput(char* buf, int maxlen);
26   void Error(const char* str);
27
28   void SetResult(KWIML_INT_int64_t value);
29
30   KWIML_INT_int64_t GetResult() const { return this->Result; }
31
32   const char* GetError() { return this->ErrorString.c_str(); }
33
34   void UnexpectedChar(char c);
35
36   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(const char* place, const char* str);
46
47   void SetError(std::string errorString);
48
49   KWIML_INT_int64_t Result;
50   const char* FileName;
51   long FileLine;
52   std::string ErrorString;
53   std::string WarningString;
54 };
55
56 #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)