cmListFileLexer.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_Newline,
  16. cmListFileLexer_Token_Identifier,
  17. cmListFileLexer_Token_ParenLeft,
  18. cmListFileLexer_Token_ParenRight,
  19. cmListFileLexer_Token_ArgumentUnquoted,
  20. cmListFileLexer_Token_ArgumentQuoted,
  21. cmListFileLexer_Token_BadCharacter,
  22. cmListFileLexer_Token_BadString
  23. } cmListFileLexer_Type;
  24. typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
  25. struct cmListFileLexer_Token_s
  26. {
  27. cmListFileLexer_Type type;
  28. char* text;
  29. int length;
  30. int line;
  31. int column;
  32. };
  33. typedef struct cmListFileLexer_s cmListFileLexer;
  34. #ifdef __cplusplus
  35. extern "C"
  36. {
  37. #endif
  38. cmListFileLexer* cmListFileLexer_New();
  39. int cmListFileLexer_SetFileName(cmListFileLexer*, const char*);
  40. int cmListFileLexer_SetString(cmListFileLexer*, const char*);
  41. cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer*);
  42. long cmListFileLexer_GetCurrentLine(cmListFileLexer*);
  43. long cmListFileLexer_GetCurrentColumn(cmListFileLexer*);
  44. const char* cmListFileLexer_GetTypeAsString(cmListFileLexer*,
  45. cmListFileLexer_Type);
  46. void cmListFileLexer_Delete(cmListFileLexer*);
  47. #ifdef __cplusplus
  48. } /* extern "C" */
  49. #endif
  50. #endif