diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-16 01:08:45 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-16 01:17:20 +0300 |
commit | e559f3f36c99988ee80ac4ec01f80ea6578beebe (patch) | |
tree | e9cd0ab93dc2901fce901a062c7c1ee7442979e5 /src/preproc.c | |
parent | a0826b4c7cd66c4862d9b61bb7e14d73fcba28f6 (diff) | |
download | grecs-e559f3f36c99988ee80ac4ec01f80ea6578beebe.tar.gz grecs-e559f3f36c99988ee80ac4ec01f80ea6578beebe.tar.bz2 |
Implement BIND config parser.
* am/grecs.m4: New option: parser-bind.
* src/.gitignore: Update.
* src/Make.am [GRECS_COND_BIND_PARSER]: Set GRECS_PARSER_BIND
and GRECS_EXTRA_BIND.
(GRECS_SRC): Include GRECS_PARSER_BIND.
(EXTRA_DIST): Include GRECS_EXTRA_BIND.
* src/bind-gram.y: New file.
* src/bind-lex.l: New file.
* src/format.c (grecs_txtacc_format_value): New function.
* src/grecs.h (grecs_bind_parser): New proto.
* src/parser.c: Set grecs_current_locus.
* src/tree.c (grecs_node_bind): Return immediately if node==NULL.
* src/yytrans: Update.
Diffstat (limited to 'src/preproc.c')
-rw-r--r-- | src/preproc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/preproc.c b/src/preproc.c index ea77506..8debdcf 100644 --- a/src/preproc.c +++ b/src/preproc.c | |||
@@ -48,7 +48,7 @@ struct buffer_ctx { | |||
48 | FILE *infile; | 48 | FILE *infile; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | extern int grecs_yy_flex_debug; | 51 | extern int grecs_grecs__flex_debug; |
52 | static struct buffer_ctx *context_stack; | 52 | static struct buffer_ctx *context_stack; |
53 | static char *linebufbase = NULL; | 53 | static char *linebufbase = NULL; |
54 | static size_t linebufsize = 0; | 54 | static size_t linebufsize = 0; |
@@ -432,7 +432,7 @@ push_source(const char *name, int once) | |||
432 | ctx->prev = context_stack; | 432 | ctx->prev = context_stack; |
433 | context_stack = ctx; | 433 | context_stack = ctx; |
434 | 434 | ||
435 | if (grecs_yy_flex_debug) | 435 | if (grecs_grecs__flex_debug) |
436 | fprintf (stderr, "Processing file `%s'\n", name); | 436 | fprintf (stderr, "Processing file `%s'\n", name); |
437 | 437 | ||
438 | pp_line_stmt(); | 438 | pp_line_stmt(); |
@@ -456,14 +456,14 @@ pop_source() | |||
456 | context_stack = ctx; | 456 | context_stack = ctx; |
457 | 457 | ||
458 | if (!context_stack) { | 458 | if (!context_stack) { |
459 | if (grecs_yy_flex_debug) | 459 | if (grecs_grecs__flex_debug) |
460 | fprintf(stderr, "End of input\n"); | 460 | fprintf(stderr, "End of input\n"); |
461 | return 1; | 461 | return 1; |
462 | } | 462 | } |
463 | 463 | ||
464 | LOCUS.line++; | 464 | LOCUS.line++; |
465 | 465 | ||
466 | if (grecs_yy_flex_debug) | 466 | if (grecs_grecs__flex_debug) |
467 | fprintf(stderr, "Resuming file `%s' at line %lu\n", | 467 | fprintf(stderr, "Resuming file `%s' at line %lu\n", |
468 | LOCUS.file, (unsigned long) LOCUS.line); | 468 | LOCUS.file, (unsigned long) LOCUS.line); |
469 | 469 | ||