2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2003-12-08 21:36:59 +03:00
|
|
|
#ifndef cmListFileLexer_h
|
|
|
|
#define cmListFileLexer_h
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
typedef enum cmListFileLexer_Type_e {
|
2003-12-08 21:36:59 +03:00
|
|
|
cmListFileLexer_Token_None,
|
2013-02-17 05:41:47 +04:00
|
|
|
cmListFileLexer_Token_Space,
|
2003-12-08 21:36:59 +03:00
|
|
|
cmListFileLexer_Token_Newline,
|
|
|
|
cmListFileLexer_Token_Identifier,
|
|
|
|
cmListFileLexer_Token_ParenLeft,
|
|
|
|
cmListFileLexer_Token_ParenRight,
|
|
|
|
cmListFileLexer_Token_ArgumentUnquoted,
|
|
|
|
cmListFileLexer_Token_ArgumentQuoted,
|
2013-08-06 23:58:22 +04:00
|
|
|
cmListFileLexer_Token_ArgumentBracket,
|
|
|
|
cmListFileLexer_Token_CommentBracket,
|
2004-09-01 02:39:42 +04:00
|
|
|
cmListFileLexer_Token_BadCharacter,
|
2013-08-06 23:58:22 +04:00
|
|
|
cmListFileLexer_Token_BadBracket,
|
2004-09-01 02:39:42 +04:00
|
|
|
cmListFileLexer_Token_BadString
|
2003-12-08 21:36:59 +03:00
|
|
|
} cmListFileLexer_Type;
|
|
|
|
|
|
|
|
typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
|
|
|
|
struct cmListFileLexer_Token_s
|
|
|
|
{
|
|
|
|
cmListFileLexer_Type type;
|
|
|
|
char* text;
|
|
|
|
int length;
|
|
|
|
int line;
|
|
|
|
int column;
|
|
|
|
};
|
|
|
|
|
2013-10-14 23:13:11 +04:00
|
|
|
enum cmListFileLexer_BOM_e
|
|
|
|
{
|
|
|
|
cmListFileLexer_BOM_None,
|
|
|
|
cmListFileLexer_BOM_UTF8,
|
|
|
|
cmListFileLexer_BOM_UTF16BE,
|
|
|
|
cmListFileLexer_BOM_UTF16LE,
|
|
|
|
cmListFileLexer_BOM_UTF32BE,
|
|
|
|
cmListFileLexer_BOM_UTF32LE
|
|
|
|
};
|
|
|
|
typedef enum cmListFileLexer_BOM_e cmListFileLexer_BOM;
|
|
|
|
|
2003-12-08 21:36:59 +03:00
|
|
|
typedef struct cmListFileLexer_s cmListFileLexer;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2016-05-16 17:34:04 +03:00
|
|
|
extern "C" {
|
2003-12-08 21:36:59 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
cmListFileLexer* cmListFileLexer_New();
|
2013-10-14 23:13:11 +04:00
|
|
|
int cmListFileLexer_SetFileName(cmListFileLexer*, const char*,
|
|
|
|
cmListFileLexer_BOM* bom);
|
2004-04-22 00:23:58 +04:00
|
|
|
int cmListFileLexer_SetString(cmListFileLexer*, const char*);
|
2003-12-08 21:36:59 +03:00
|
|
|
cmListFileLexer_Token* cmListFileLexer_Scan(cmListFileLexer*);
|
|
|
|
long cmListFileLexer_GetCurrentLine(cmListFileLexer*);
|
|
|
|
long cmListFileLexer_GetCurrentColumn(cmListFileLexer*);
|
2004-09-01 02:39:42 +04:00
|
|
|
const char* cmListFileLexer_GetTypeAsString(cmListFileLexer*,
|
|
|
|
cmListFileLexer_Type);
|
2003-12-08 21:36:59 +03:00
|
|
|
void cmListFileLexer_Delete(cmListFileLexer*);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|