aboutsummaryrefslogtreecommitdiff
path: root/include/argot/parser.h
blob: 286e42eefe3bf23e91d88d528ce6e4ee6ce7dd50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* argot - Gray's Extensible Configuration System -*- c -*-
   Copyright (C) 2007-2016 Sergey Poznyakoff

   Grecs is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 3 of the License, or (at your
   option) any later version.

   Grecs is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along
   with Grecs. If not, see <http://www.gnu.org/licenses/>. */

#ifndef _ARGOT_PARSER_H
#define _ARGOT_PARSER_H

typedef struct argot_node *(*argot_parser_t)(const char *name, int trace);

#define ARGOT_TRACE_GRAM 0x01
#define ARGOT_TRACE_LEX  0x02

extern int argot_trace_flags;
extern argot_parser_t argot_parser_fun;
extern int argot_default_port;

extern struct argot_locus_point argot_current_locus_point;
extern argot_locus_t argot_locus;
extern int argot_error_count;    

#define ARGOT_OPTION_ADJUST_STRING_LOCATIONS 0x01
#define ARGOT_OPTION_QUOTED_STRING_CONCAT    0x02
extern int argot_parser_options;

/* Main entry point */
struct argot_node *argot_parse(const char *name);
void argot_gram_trace(int n);
void argot_lex_trace(int n);

/* Parsers: */
struct argot_node *argot_argot_parser(const char *name, int traceflags);
struct argot_node *argot_meta1_parser(const char *name, int traceflags);
struct argot_node *argot_bind_parser(const char *name, int traceflags);
struct argot_node *argot_dhcpd_parser(const char *name, int traceflags);
struct argot_node *argot_git_parser(const char *name, int traceflags);
struct argot_node *argot_path_parser(const char *name, int traceflags);


/* Parser database */
int argot_enumerate_parsers(int (*fun)(const char *, argot_parser_t, void *),
			    void *);
argot_parser_t argot_get_parser_by_type(const char *type);

#endif

Return to:

Send suggestions and report system problems to the System administrator.