diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-10-17 20:42:47 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-10-17 20:42:47 (GMT) |
commit | 985d092d4d9f6d38c794755c3c64405ef7ec8d35 (patch) | |
tree | 382b35ed4376ba936acb4f160dd4fc5b76173dc6 /Source/cmExprParserHelper.h | |
parent | 427ed70363ad4aea83e071f46d9704f69472017d (diff) | |
download | CMake-985d092d4d9f6d38c794755c3c64405ef7ec8d35.zip CMake-985d092d4d9f6d38c794755c3c64405ef7ec8d35.tar.gz CMake-985d092d4d9f6d38c794755c3c64405ef7ec8d35.tar.bz2 |
ENH: Add rudamentary mathematical expression support
Diffstat (limited to 'Source/cmExprParserHelper.h')
-rw-r--r-- | Source/cmExprParserHelper.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h new file mode 100644 index 0000000..5fd2c3d --- /dev/null +++ b/Source/cmExprParserHelper.h @@ -0,0 +1,79 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmExprParserHelper_h +#define cmExprParserHelper_h + +#include "cmStandardIncludes.h" + +#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 cmMakefile; + +class cmExprParserHelper +{ +public: + typedef struct { + 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); + + int GetResult() { return m_Result; } + + void SetLineFile(long line, const char* file); + + const char* GetError() { return m_Error.c_str(); } + +private: + cmStdString::size_type InputBufferPos; + cmStdString InputBuffer; + std::vector<char> OutputBuffer; + int CurrentLine; + int UnionsAvailable; + int Verbose; + + void Print(const char* place, const char* str); + + void CleanupParser(); + + int m_Result; + const char* m_FileName; + long m_FileLine; + std::string m_Error; +}; + +#endif + + + |