25 #ifndef CFG_LEXER_H_INCLUDED
26 #define CFG_LEXER_H_INCLUDED 1
39 #define MAX_INCLUDE_DEPTH 256
114 #define KWS_OBSOLETE 1
117 typedef struct _CfgLexerKeyword
125 #define CFG_KEYWORD_STOP "@!#?"
206 const gchar *
name,
const gchar *
buffer, gsize length);
223 CfgLexer *
cfg_lexer_new(GlobalConfig *
cfg, FILE *file,
const gchar *filename, GString *preprocess_output);
241 #define CFG_LEXER_ERROR cfg_lexer_error_quark()
gboolean cfg_lexer_include_buffer_without_backtick_substitution(CfgLexer *self, const gchar *name, const gchar *buffer, gsize length)
Definition: cfg-lexer.c:745
void cfg_lexer_set_file_location(CfgLexer *self, const gchar *filename, gint line, gint column)
Definition: cfg-lexer.c:165
int cfg_lexer_map_word_to_token(CfgLexer *self, CFG_STYPE *yylval, const CFG_LTYPE *yylloc, const char *token)
Definition: cfg-lexer.c:238
void cfg_token_block_free(CfgTokenBlock *self)
Definition: cfg-lexer.c:1351
gboolean cfg_lexer_include_buffer(CfgLexer *self, const gchar *name, const gchar *buffer, gssize length)
Definition: cfg-lexer.c:763
void cfg_lexer_pop_context(CfgLexer *self)
Definition: cfg-lexer.c:108
void cfg_lexer_start_block_state(CfgLexer *self, const gchar block_boundary[2])
gboolean cfg_lexer_include_file(CfgLexer *self, const gchar *filename)
Definition: cfg-lexer.c:716
int cfg_lexer_lex(CfgLexer *self, CFG_STYPE *yylval, CFG_LTYPE *yylloc)
Definition: cfg-lexer.c:1122
CfgLexer * cfg_lexer_new_buffer(GlobalConfig *cfg, const gchar *buffer, gsize length)
Definition: cfg-lexer.c:1224
void cfg_lexer_append_char(CfgLexer *self, char c)
char * cfg_lexer_get_keyword_string(CfgLexer *self, int kw)
void cfg_token_block_add_token(CfgTokenBlock *self, CFG_STYPE *token)
Definition: cfg-lexer.c:1321
gboolean cfg_lexer_start_next_include(CfgLexer *self)
Definition: cfg-lexer.c:425
void cfg_lexer_set_current_keywords(CfgLexer *self, CfgLexerKeyword *keywords)
gint cfg_lexer_get_context_type(CfgLexer *self)
Definition: cfg-lexer.c:123
CfgLexerError
Definition: cfg-lexer.h:246
@ CFG_LEXER_CANNOT_REPRESENT_APOSTROPHES_IN_QSTRINGS
Definition: cfg-lexer.h:248
@ CFG_LEXER_MISSING_BACKTICK_PAIR
Definition: cfg-lexer.h:247
@ CFG_LEXER_BACKTICKS_CANT_BE_SUBSTITUTED_AFTER_BACKSLASH
Definition: cfg-lexer.h:249
#define MAX_INCLUDE_DEPTH
Definition: cfg-lexer.h:39
GQuark cfg_lexer_error_quark(void)
Definition: cfg-lexer.c:1368
void cfg_lexer_register_generator_plugin(PluginContext *context, CfgBlockGenerator *gen)
Definition: cfg-lexer.c:818
void cfg_lexer_free(CfgLexer *self)
Definition: cfg-lexer.c:1242
void cfg_lexer_free_token(CFG_STYPE *token)
Definition: cfg-lexer.c:895
EVTTAG * cfg_lexer_format_location_tag(CfgLexer *self, const CFG_LTYPE *yylloc)
Definition: cfg-lexer.c:157
void cfg_lexer_append_string(CfgLexer *self, int length, char *str)
const gchar * cfg_lexer_lookup_context_name_by_type(gint id)
Definition: cfg-lexer.c:1304
gint cfg_lexer_lookup_context_type_by_name(const gchar *name)
Definition: cfg-lexer.c:1291
CFG_STYPE * cfg_token_block_get_token(CfgTokenBlock *self)
Definition: cfg-lexer.c:1328
void cfg_lexer_start_block_arg_state(CfgLexer *self)
CfgTokenBlock * cfg_token_block_new(void)
Definition: cfg-lexer.c:1342
const gchar * cfg_lexer_get_context_description(CfgLexer *self)
Definition: cfg-lexer.c:139
void cfg_lexer_push_context(CfgLexer *self, gint context, CfgLexerKeyword *keywords, const gchar *desc)
Definition: cfg-lexer.c:91
const gchar * cfg_lexer_format_location(CfgLexer *self, const CFG_LTYPE *yylloc, gchar *buf, gsize buf_len)
Definition: cfg-lexer.c:150
void cfg_token_block_add_and_consume_token(CfgTokenBlock *self, CFG_STYPE *token)
Definition: cfg-lexer.c:1314
void cfg_lexer_inject_token_block(CfgLexer *self, CfgTokenBlock *block)
Definition: cfg-lexer.c:787
CfgLexer * cfg_lexer_new(GlobalConfig *cfg, FILE *file, const gchar *filename, GString *preprocess_output)
Definition: cfg-lexer.c:1205
void cfg_lexer_unput_token(CfgLexer *self, CFG_STYPE *yylval)
Definition: cfg-lexer.c:880
const gchar * name
Definition: debugger.c:265
Definition: cfg-lexer.h:88
int last_line
Definition: cfg-lexer.h:91
const gchar * name
Definition: cfg-lexer.h:94
int first_line
Definition: cfg-lexer.h:89
int last_column
Definition: cfg-lexer.h:92
int first_column
Definition: cfg-lexer.h:90
Definition: cfg-lexer.h:99
double fnum
Definition: cfg-lexer.h:106
gint token
Definition: cfg-lexer.h:104
gpointer node
Definition: cfg-lexer.h:109
void * ptr
Definition: cfg-lexer.h:108
gint64 num
Definition: cfg-lexer.h:105
char * cptr
Definition: cfg-lexer.h:107
int type
Definition: cfg-lexer.h:101
Definition: cfg-lexer.h:118
gint kw_token
Definition: cfg-lexer.h:120
gint kw_status
Definition: cfg-lexer.h:121
const gchar * kw_explain
Definition: cfg-lexer.h:122
const gchar * kw_name
Definition: cfg-lexer.h:119
Definition: cfg-lexer.h:131
struct _CfgIncludeLevel::@6::@9 buffer
GSList * files
Definition: cfg-lexer.h:142
enum _CfgIncludeLevel::@5 include_type
CFG_LTYPE lloc
Definition: cfg-lexer.h:158
gsize content_length
Definition: cfg-lexer.h:151
gchar * original_content
Definition: cfg-lexer.h:148
struct _CfgIncludeLevel::@6::@8 file
gboolean lloc_changed_by_at_line
Definition: cfg-lexer.h:157
gchar * content
Definition: cfg-lexer.h:150
@ CFGI_NONE
Definition: cfg-lexer.h:134
@ CFGI_FILE
Definition: cfg-lexer.h:135
@ CFGI_BUFFER
Definition: cfg-lexer.h:136
FILE * include_file
Definition: cfg-lexer.h:143
struct yy_buffer_state * yybuf
Definition: cfg-lexer.h:159
Definition: cfg-lexer.h:167
gint tokenize_eol
Definition: cfg-lexer.h:176
CfgIncludeLevel include_stack[MAX_INCLUDE_DEPTH]
Definition: cfg-lexer.h:171
guint ignore_pragma
Definition: cfg-lexer.h:184
GList * context_stack
Definition: cfg-lexer.h:172
gchar block_boundary[2]
Definition: cfg-lexer.h:174
gint preprocess_suppress_tokens
Definition: cfg-lexer.h:180
GlobalConfig * cfg
Definition: cfg-lexer.h:183
guint first_non_pragma_seen
Definition: cfg-lexer.h:184
GString * string_buffer
Definition: cfg-lexer.h:178
gpointer state
Definition: cfg-lexer.h:169
jmp_buf fatal_error
Definition: cfg-lexer.h:170
GString * token_text
Definition: cfg-lexer.h:182
gint include_depth
Definition: cfg-lexer.h:173
GString * token_pretext
Definition: cfg-lexer.h:181
gint brace_count
Definition: cfg-lexer.h:175
GList * token_blocks
Definition: cfg-lexer.h:177
GString * preprocess_output
Definition: cfg-lexer.h:179
Definition: cfg-lexer.c:54
GlobalConfig * cfg
Definition: test_batched_ack_tracker.c:34
GString * buffer
Definition: test_smart_multi_line.c:69