cmListFileLexer.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_Error
  25. } cmListFileLexer_Type;
  26. typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
  27. struct cmListFileLexer_Token_s
  28. {
  29. cmListFileLexer_Type type;
  30. char* text;
  31. int length;
  32. int line;
  33. int column;
  34. };
  35. typedef struct cmListFileLexer_s cmListFileLexer;
  36. #ifdef __cplusplus
  37. extern "C"
  38. {
  39. #endif
  40. cmListFileLexer* cmListFileLexer_New();
  41. int cmListFileLexer_SetFileName(cmListFileLexer*, const char*);
  42. cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer*);
  43. long cmListFileLexer_GetCurrentLine(cmListFileLexer*);
  44. long cmListFileLexer_GetCurrentColumn(cmListFileLexer*);
  45. void cmListFileLexer_Delete(cmListFileLexer*);
  46. #ifdef __cplusplus
  47. } /* extern "C" */
  48. #endif
  49. #endif