block_parser
[mala.git] / std / std.h
blob126b9c1abd1780f4e3a7d89ff2e55f97ee6bc38c
1 /*
2 std.h - MaLa standard parser module
4 Copyright (C) 2004, 2005, Christian Thaeter <chth@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, contact me.
20 #ifndef MALA_STD_H
21 #define MALA_STD_H
23 #define MALA_PARSER(n,p,f,d,m) {n, (MalaParserFunc)p, (MalaDataFactory)f, d, m}
26 /*----above to mala.h-----*/
29 #define MALA_NULL_PARSER(name) \
30 MALA_PARSER(name, mala_null_parser, NULL, NULL, NULL)
31 #define MALA_NULL_PARSER_P(name,parent) \
32 MALA_PARSER(name, mala_null_parser, NULL, NULL, parent)
34 #define MALA_SUBSTITUTE_PARSER(name,subst) \
35 MALA_PARSER(name, mala_substitute_parser, mala_string_factory, subst, NULL)
36 #define MALA_SUBSTITUTE_PARSER_P(name,subst,parent) \
37 MALA_PARSER(name, mala_substitute_parser, mala_string_factory, subst, parent)
39 #define MALA_EXPAND_PARSER(name, expand) \
40 MALA_PARSER(name, mala_expand_parser, mala_stringlist_factory, \
41 MALA_STATIC_STRINGLIST_INIT expand, NULL)
42 #define MALA_EXPAND_PARSER_P(name, expand, parent) \
43 MALA_PARSER(name, mala_expand_parser, mala_stringlist_factory, \
44 MALA_STATIC_STRINGLIST_INIT expand, parent)
46 #define MALA_MACRO_PARSER(name, macro) \
47 MALA_PARSER(name, mala_macro_parser, mala_stringlist_factory, \
48 MALA_STATIC_STRINGLIST_INIT macro, NULL)
49 #define MALA_MACRO_PARSER_P(name, macro, parent) \
50 MALA_PARSER(name, mala_macro_parser, mala_stringlist_factory, \
51 MALA_STATIC_STRINGLIST_INIT macro, parent)
54 // {name, (MalaParserFunc)mala_macro_parser, (MalaDataFactory)mala_stringlist_factory,
55 // MALA_STATIC_STRINGLIST_INIT macro, parent}
57 #define MALA_PARSER_BRIEF(name, brief) \
58 MALA_EXPAND_PARSER_P("--BRIEF." name, ("--BRIEF-ACTION", brief), name)
60 #define MALA_PARSER_HELP(name, args) \
61 MALA_EXPAND_PARSER_P("--HELP." name, args, name)
63 #define MALA_TRUE_PARSER(name) \
64 MALA_SUBSTITUTE_PARSER(name,"--TRUE")
65 #define MALA_FALSE_PARSER(name) \
66 MALA_SUBSTITUTE_PARSER(name,"--FALSE")
69 int
70 mala_module_std_init (MalaEngine self);
73 int
74 mala_null_parser (MalaEngine eng,
75 MalaStringListNode_ref pptr,
76 void * data);
78 int
79 mala_substitute_parser (MalaEngine eng,
80 MalaStringListNode_ref pptr,
81 void * data);
83 int
84 mala_expand_parser (MalaEngine eng,
85 MalaStringListNode_ref pptr,
86 void * data);
88 int
89 mala_macro_parser (MalaEngine eng,
90 MalaStringListNode_ref pptr,
91 void * data);
93 int
94 mala_printl_parser (MalaEngine eng,
95 MalaStringListNode_ref pptr,
96 void * data);
98 int
99 mala_literal_parser (MalaEngine eng,
100 MalaStringListNode_ref pptr,
101 void * data);
104 mala_not_parser (MalaEngine eng,
105 MalaStringListNode_ref pptr,
106 void * data);
109 mala_block_parser (MalaEngine eng,
110 MalaStringListNode_ref pptr,
111 void * data);
114 #endif /* MALA_STD_H */
117 // Local Variables:
118 // mode: C
119 // c-file-style: "gnu"
120 // End:
121 // arch-tag: 090999f3-1084-4564-9bef-8d1bcb07914a
122 // end_of_file