cmListFileLexer.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmListFileLexer_h
  11. #define cmListFileLexer_h
  12. typedef enum cmListFileLexer_Type_e
  13. {
  14. cmListFileLexer_Token_None,
  15. cmListFileLexer_Token_Space,
  16. cmListFileLexer_Token_Newline,
  17. cmListFileLexer_Token_Identifier,
  18. cmListFileLexer_Token_ParenLeft,
  19. cmListFileLexer_Token_ParenRight,
  20. cmListFileLexer_Token_ArgumentUnquoted,
  21. cmListFileLexer_Token_ArgumentQuoted,
  22. cmListFileLexer_Token_BadCharacter,
  23. cmListFileLexer_Token_BadString
  24. } cmListFileLexer_Type;
  25. typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
  26. struct cmListFileLexer_Token_s
  27. {
  28. cmListFileLexer_Type type;
  29. char* text;
  30. int length;
  31. int line;
  32. int column;
  33. };
  34. typedef struct cmListFileLexer_s cmListFileLexer;
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. cmListFileLexer* cmListFileLexer_New();
  40. int cmListFileLexer_SetFileName(cmListFileLexer*, const char*);
  41. int cmListFileLexer_SetString(cmListFileLexer*, const char*);
  42. cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer*);
  43. long cmListFileLexer_GetCurrentLine(cmListFileLexer*);
  44. long cmListFileLexer_GetCurrentColumn(cmListFileLexer*);
  45. const char* cmListFileLexer_GetTypeAsString(cmListFileLexer*,
  46. cmListFileLexer_Type);
  47. void cmListFileLexer_Delete(cmListFileLexer*);
  48. #ifdef __cplusplus
  49. } /* extern "C" */
  50. #endif
  51. #endif