aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c54
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
25int grecs_error_count = 0; 25int argot_error_count = 0;
26int grecs_default_port = 0; 26int argot_default_port = 0;
27 27
28int grecs_trace_flags = 0; 28int argot_trace_flags = 0;
29int grecs_parser_options = 0; 29int 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
35struct grecs_node *(*grecs_parser_fun)(const char *name, int trace) = 35struct argot_node *(*argot_parser_fun)(const char *name, int trace) =
36 GRECS_DEFAULT_PARSER; 36 ARGOT_DEFAULT_PARSER;
37 37
38void 38void
39grecs_gram_trace(int n) 39argot_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
47void 47void
48grecs_lex_trace(int n) 48argot_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
56struct grecs_node * 56struct argot_node *
57grecs_parse(const char *name) 57argot_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}

Return to:

Send suggestions and report system problems to the System administrator.