You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.9 KiB

  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmExprParserHelper_h
  14. #define cmExprParserHelper_h
  15. #include "cmStandardIncludes.h"
  16. #define YYSTYPE cmExprParserHelper::ParserType
  17. #define YYSTYPE_IS_DECLARED
  18. #define YY_EXTRA_TYPE cmExprParserHelper*
  19. #define YY_DECL int cmExpr_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner)
  20. /** \class cmExprParserHelper
  21. * \brief Helper class for parsing java source files
  22. *
  23. * Finds dependencies for java file and list of outputs
  24. */
  25. class cmMakefile;
  26. class cmExprParserHelper
  27. {
  28. public:
  29. typedef struct {
  30. int Number;
  31. } ParserType;
  32. cmExprParserHelper();
  33. ~cmExprParserHelper();
  34. int ParseString(const char* str, int verb);
  35. int LexInput(char* buf, int maxlen);
  36. void Error(const char* str);
  37. void SetResult(int value);
  38. int GetResult() { return this->Result; }
  39. void SetLineFile(long line, const char* file);
  40. const char* GetError() { return this->ErrorString.c_str(); }
  41. private:
  42. cmStdString::size_type InputBufferPos;
  43. cmStdString InputBuffer;
  44. std::vector<char> OutputBuffer;
  45. int CurrentLine;
  46. int UnionsAvailable;
  47. int Verbose;
  48. void Print(const char* place, const char* str);
  49. void CleanupParser();
  50. int Result;
  51. const char* FileName;
  52. long FileLine;
  53. std::string ErrorString;
  54. };
  55. #endif