2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2012-08-13 21:42:58 +04:00
|
|
|
#ifndef cmExprParserHelper_h
|
2005-10-18 00:42:47 +04:00
|
|
|
#define cmExprParserHelper_h
|
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <cmConfigure.h> // IWYU pragma: keep
|
2016-09-01 21:05:48 +03:00
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2005-10-18 00:42:47 +04:00
|
|
|
|
|
|
|
#define YYSTYPE cmExprParserHelper::ParserType
|
|
|
|
#define YYSTYPE_IS_DECLARED
|
|
|
|
#define YY_EXTRA_TYPE cmExprParserHelper*
|
|
|
|
#define YY_DECL int cmExpr_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner)
|
|
|
|
|
|
|
|
/** \class cmExprParserHelper
|
|
|
|
* \brief Helper class for parsing java source files
|
|
|
|
*
|
|
|
|
* Finds dependencies for java file and list of outputs
|
|
|
|
*/
|
|
|
|
class cmExprParserHelper
|
|
|
|
{
|
|
|
|
public:
|
2016-05-16 17:34:04 +03:00
|
|
|
typedef struct
|
|
|
|
{
|
2005-10-18 00:42:47 +04:00
|
|
|
int Number;
|
|
|
|
} ParserType;
|
|
|
|
|
|
|
|
cmExprParserHelper();
|
|
|
|
~cmExprParserHelper();
|
|
|
|
|
|
|
|
int ParseString(const char* str, int verb);
|
|
|
|
|
|
|
|
int LexInput(char* buf, int maxlen);
|
|
|
|
void Error(const char* str);
|
|
|
|
|
|
|
|
void SetResult(int value);
|
|
|
|
|
2006-03-15 19:02:08 +03:00
|
|
|
int GetResult() { return this->Result; }
|
2005-10-18 00:42:47 +04:00
|
|
|
|
2006-03-15 19:02:08 +03:00
|
|
|
const char* GetError() { return this->ErrorString.c_str(); }
|
2005-10-18 00:42:47 +04:00
|
|
|
|
|
|
|
private:
|
2014-02-10 09:21:34 +04:00
|
|
|
std::string::size_type InputBufferPos;
|
|
|
|
std::string InputBuffer;
|
2005-10-18 00:42:47 +04:00
|
|
|
std::vector<char> OutputBuffer;
|
|
|
|
int CurrentLine;
|
|
|
|
int Verbose;
|
|
|
|
|
|
|
|
void Print(const char* place, const char* str);
|
|
|
|
|
|
|
|
void CleanupParser();
|
|
|
|
|
2006-03-15 19:02:08 +03:00
|
|
|
int Result;
|
|
|
|
const char* FileName;
|
|
|
|
long FileLine;
|
|
|
|
std::string ErrorString;
|
2005-10-18 00:42:47 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|