diff options
Diffstat (limited to 'src/parser.c')
-rw-r--r-- | src/parser.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/parser.c b/src/parser.c index ed99a7a..94ec0d9 100644 --- a/src/parser.c +++ b/src/parser.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* grecs - Gray's Extensible Configuration System | 1 | /* argot - Gray's Extensible Configuration System |
2 | Copyright (C) 2007-2016 Sergey Poznyakoff | 2 | Copyright (C) 2007-2016 Sergey Poznyakoff |
3 | 3 | ||
4 | Grecs is free software; you can redistribute it and/or modify it | 4 | Grecs is free software; you can redistribute it and/or modify it |
@@ -20,62 +20,62 @@ | |||
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include <string.h> | 21 | #include <string.h> |
22 | #include <errno.h> | 22 | #include <errno.h> |
23 | #include "grecs.h" | 23 | #include "argot.h" |
24 | 24 | ||
25 | int grecs_error_count = 0; | 25 | int argot_error_count = 0; |
26 | int grecs_default_port = 0; | 26 | int argot_default_port = 0; |
27 | 27 | ||
28 | int grecs_trace_flags = 0; | 28 | int argot_trace_flags = 0; |
29 | int grecs_parser_options = 0; | 29 | int argot_parser_options = 0; |
30 | 30 | ||
31 | #ifndef GRECS_DEFAULT_PARSER | 31 | #ifndef ARGOT_DEFAULT_PARSER |
32 | # define GRECS_DEFAULT_PARSER grecs_grecs_parser | 32 | # define ARGOT_DEFAULT_PARSER argot_argot_parser |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | struct grecs_node *(*grecs_parser_fun)(const char *name, int trace) = | 35 | struct argot_node *(*argot_parser_fun)(const char *name, int trace) = |
36 | GRECS_DEFAULT_PARSER; | 36 | ARGOT_DEFAULT_PARSER; |
37 | 37 | ||
38 | void | 38 | void |
39 | grecs_gram_trace(int n) | 39 | argot_gram_trace(int n) |
40 | { | 40 | { |
41 | if (n) | 41 | if (n) |
42 | grecs_trace_flags |= GRECS_TRACE_GRAM; | 42 | argot_trace_flags |= ARGOT_TRACE_GRAM; |
43 | else | 43 | else |
44 | grecs_trace_flags &= ~GRECS_TRACE_GRAM; | 44 | argot_trace_flags &= ~ARGOT_TRACE_GRAM; |
45 | } | 45 | } |
46 | 46 | ||
47 | void | 47 | void |
48 | grecs_lex_trace(int n) | 48 | argot_lex_trace(int n) |
49 | { | 49 | { |
50 | if (n) | 50 | if (n) |
51 | grecs_trace_flags |= GRECS_TRACE_LEX; | 51 | argot_trace_flags |= ARGOT_TRACE_LEX; |
52 | else | 52 | else |
53 | grecs_trace_flags &= ~GRECS_TRACE_LEX; | 53 | argot_trace_flags &= ~ARGOT_TRACE_LEX; |
54 | } | 54 | } |
55 | 55 | ||
56 | struct grecs_node * | 56 | struct argot_node * |
57 | grecs_parse(const char *name) | 57 | argot_parse(const char *name) |
58 | { | 58 | { |
59 | if (!grecs_trace_flags) { | 59 | if (!argot_trace_flags) { |
60 | char *p = getenv("GRECS_DEBUG"); | 60 | char *p = getenv("ARGOT_DEBUG"); |
61 | if (p) { | 61 | if (p) { |
62 | while (*p) { | 62 | while (*p) { |
63 | switch (*p++) { | 63 | switch (*p++) { |
64 | case 'g': | 64 | case 'g': |
65 | case 'G': | 65 | case 'G': |
66 | grecs_trace_flags |= GRECS_TRACE_GRAM; | 66 | argot_trace_flags |= ARGOT_TRACE_GRAM; |
67 | break; | 67 | break; |
68 | case 'l': | 68 | case 'l': |
69 | case 'L': | 69 | case 'L': |
70 | grecs_trace_flags |= GRECS_TRACE_LEX; | 70 | argot_trace_flags |= ARGOT_TRACE_LEX; |
71 | break; | 71 | break; |
72 | } | 72 | } |
73 | } | 73 | } |
74 | } | 74 | } |
75 | } | 75 | } |
76 | grecs_error_count = 0; | 76 | argot_error_count = 0; |
77 | grecs_current_locus_point.file = grecs_install_text(name); | 77 | argot_current_locus_point.file = argot_install_text(name); |
78 | grecs_current_locus_point.line = 1; | 78 | argot_current_locus_point.line = 1; |
79 | grecs_current_locus_point.col = 0; | 79 | argot_current_locus_point.col = 0; |
80 | return grecs_parser_fun(name, grecs_trace_flags); | 80 | return argot_parser_fun(name, argot_trace_flags); |
81 | } | 81 | } |