cmListFileLexer.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. int cmListFileLexer_SetString(cmListFileLexer*, const char*);
  43. cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer*);
  44. long cmListFileLexer_GetCurrentLine(cmListFileLexer*);
  45. long cmListFileLexer_GetCurrentColumn(cmListFileLexer*);
  46. void cmListFileLexer_Delete(cmListFileLexer*);
  47. #ifdef __cplusplus
  48. } /* extern "C" */
  49. #endif
  50. #endif