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.
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")
70 mala_module_std_init (MalaEngine self
);
74 mala_null_parser (MalaEngine eng
,
75 MalaStringListNode_ref pptr
,
79 mala_substitute_parser (MalaEngine eng
,
80 MalaStringListNode_ref pptr
,
84 mala_expand_parser (MalaEngine eng
,
85 MalaStringListNode_ref pptr
,
89 mala_macro_parser (MalaEngine eng
,
90 MalaStringListNode_ref pptr
,
94 mala_printl_parser (MalaEngine eng
,
95 MalaStringListNode_ref pptr
,
99 #endif /* MALA_STD_H */
104 // c-file-style: "gnu"
106 // arch-tag: 090999f3-1084-4564-9bef-8d1bcb07914a