aboutsummaryrefslogtreecommitdiff
path: root/include/argot/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/argot/parser.h')
-rw-r--r--include/argot/parser.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/include/argot/parser.h b/include/argot/parser.h
new file mode 100644
index 0000000..286e42e
--- /dev/null
+++ b/include/argot/parser.h
@@ -0,0 +1,56 @@
1/* argot - Gray's Extensible Configuration System -*- c -*-
2 Copyright (C) 2007-2016 Sergey Poznyakoff
3
4 Grecs is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 3 of the License, or (at your
7 option) any later version.
8
9 Grecs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along
15 with Grecs. If not, see <http://www.gnu.org/licenses/>. */
16
17#ifndef _ARGOT_PARSER_H
18#define _ARGOT_PARSER_H
19
20typedef struct argot_node *(*argot_parser_t)(const char *name, int trace);
21
22#define ARGOT_TRACE_GRAM 0x01
23#define ARGOT_TRACE_LEX 0x02
24
25extern int argot_trace_flags;
26extern argot_parser_t argot_parser_fun;
27extern int argot_default_port;
28
29extern struct argot_locus_point argot_current_locus_point;
30extern argot_locus_t argot_locus;
31extern int argot_error_count;
32
33#define ARGOT_OPTION_ADJUST_STRING_LOCATIONS 0x01
34#define ARGOT_OPTION_QUOTED_STRING_CONCAT 0x02
35extern int argot_parser_options;
36
37/* Main entry point */
38struct argot_node *argot_parse(const char *name);
39void argot_gram_trace(int n);
40void argot_lex_trace(int n);
41
42/* Parsers: */
43struct argot_node *argot_argot_parser(const char *name, int traceflags);
44struct argot_node *argot_meta1_parser(const char *name, int traceflags);
45struct argot_node *argot_bind_parser(const char *name, int traceflags);
46struct argot_node *argot_dhcpd_parser(const char *name, int traceflags);
47struct argot_node *argot_git_parser(const char *name, int traceflags);
48struct argot_node *argot_path_parser(const char *name, int traceflags);
49
50
51/* Parser database */
52int argot_enumerate_parsers(int (*fun)(const char *, argot_parser_t, void *),
53 void *);
54argot_parser_t argot_get_parser_by_type(const char *type);
55
56#endif

Return to:

Send suggestions and report system problems to the System administrator.