File indexing completed on 2024-05-12 04:39:27

0001 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
0002    file Copyright.txt or https://cmake.org/licensing for details.  */
0003 #ifndef cmListFileLexer_h
0004 #define cmListFileLexer_h
0005 
0006 typedef enum cmListFileLexer_Type_e {
0007   cmListFileLexer_Token_None,
0008   cmListFileLexer_Token_Space,
0009   cmListFileLexer_Token_Newline,
0010   cmListFileLexer_Token_Identifier,
0011   cmListFileLexer_Token_ParenLeft,
0012   cmListFileLexer_Token_ParenRight,
0013   cmListFileLexer_Token_ArgumentUnquoted,
0014   cmListFileLexer_Token_ArgumentQuoted,
0015   cmListFileLexer_Token_ArgumentBracket,
0016   cmListFileLexer_Token_CommentBracket,
0017   cmListFileLexer_Token_BadCharacter,
0018   cmListFileLexer_Token_BadBracket,
0019   cmListFileLexer_Token_BadString
0020 } cmListFileLexer_Type;
0021 
0022 typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
0023 struct cmListFileLexer_Token_s
0024 {
0025   cmListFileLexer_Type type;
0026   char* text;
0027   int length;
0028   int line;
0029   int column;
0030 };
0031 
0032 enum cmListFileLexer_BOM_e
0033 {
0034   cmListFileLexer_BOM_None,
0035   cmListFileLexer_BOM_Broken,
0036   cmListFileLexer_BOM_UTF8,
0037   cmListFileLexer_BOM_UTF16BE,
0038   cmListFileLexer_BOM_UTF16LE,
0039   cmListFileLexer_BOM_UTF32BE,
0040   cmListFileLexer_BOM_UTF32LE
0041 };
0042 typedef enum cmListFileLexer_BOM_e cmListFileLexer_BOM;
0043 
0044 typedef struct cmListFileLexer_s cmListFileLexer;
0045 
0046 #ifdef __cplusplus
0047 extern "C" {
0048 #endif
0049 
0050 cmListFileLexer* cmListFileLexer_New(void);
0051 int cmListFileLexer_SetFileName(cmListFileLexer*, const char*,
0052                                 cmListFileLexer_BOM* bom);
0053 int cmListFileLexer_SetString(cmListFileLexer*, const char*);
0054 cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer*);
0055 long cmListFileLexer_GetCurrentLine(cmListFileLexer*);
0056 long cmListFileLexer_GetCurrentColumn(cmListFileLexer*);
0057 const char* cmListFileLexer_GetTypeAsString(cmListFileLexer*,
0058                                             cmListFileLexer_Type);
0059 void cmListFileLexer_Delete(cmListFileLexer*);
0060 
0061 #ifdef __cplusplus
0062 } /* extern "C" */
0063 #endif
0064 
0065 #endif