cmListFileLexer.h 1.9 KB

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