split std/ into smaller files
[mala.git] / std / std.h
blob57b967771b4a72f5df0ee407ff7605ed15efcfab
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}
25 #define MALA_PASS_PARSER(name) \
26 MALA_PARSER(name, mala_pass_parser, NULL, NULL, NULL)
27 #define MALA_PASS_PARSER_P(name,parent) \
28 MALA_PARSER(name, mala_pass_parser, NULL, NULL, parent)
30 #define MALA_SUBSTITUTE_PARSER(name,subst) \
31 MALA_PARSER(name, mala_substitute_parser, mala_string_factory, subst, NULL)
32 #define MALA_SUBSTITUTE_PARSER_P(name,subst,parent) \
33 MALA_PARSER(name, mala_substitute_parser, mala_string_factory, subst, parent)
35 #define MALA_EXPAND_PARSER(name, expand) \
36 MALA_PARSER(name, mala_expand_parser, mala_stringlist_factory, \
37 MALA_STATIC_STRINGLIST_INIT expand, NULL)
38 #define MALA_EXPAND_PARSER_P(name, expand, parent) \
39 MALA_PARSER(name, mala_expand_parser, mala_stringlist_factory, \
40 MALA_STATIC_STRINGLIST_INIT expand, parent)
42 #define MALA_MACRO_PARSER(name, macro) \
43 MALA_PARSER(name, mala_macro_parser, mala_stringlist_factory, \
44 MALA_STATIC_STRINGLIST_INIT macro, NULL)
45 #define MALA_MACRO_PARSER_P(name, macro, parent) \
46 MALA_PARSER(name, mala_macro_parser, mala_stringlist_factory, \
47 MALA_STATIC_STRINGLIST_INIT macro, parent)
49 #define MALA_PARSER_BRIEF(name, brief) \
50 MALA_SUBSTITUTE_PARSER_P("--BRIEF_" name, brief, name)
52 #define MALA_PARSER_HELP(name, args) \
53 MALA_EXPAND_PARSER_P("--HELP_" name, args, name)
55 #define MALA_PARSER_EXAMPLE(name, example) \
56 MALA_SUBSTITUTE_PARSER_P("--EXAMPLE_" name, example, name)
58 #define MALA_PARSER_TYPE(name, explain) \
59 MALA_SUBSTITUTE_PARSER("--TYPE_" name, explain)
61 #define MALA_PARSER_RESULT_TYPE(name, args) \
62 MALA_EXPAND_PARSER_P("--RESULT-TYPE_" name, args, name)
64 #define MALA_PARSER_RESULT_USAGE(name, args) \
65 MALA_EXPAND_PARSER_P("--RESULT-USAGE_" name, args, name)
67 #define MALA_PARSER_SIGNATURE_TYPE(name, args) \
68 MALA_EXPAND_PARSER_P("--SIGNATURE-TYPE_" name, args, name)
70 #define MALA_PARSER_SIGNATURE_USAGE(name, args) \
71 MALA_EXPAND_PARSER_P("--SIGNATURE-USAGE_" name, args, name)
73 #define MALA_TRUE_PARSER(name) \
74 MALA_SUBSTITUTE_PARSER(name,"--TRUE")
75 #define MALA_FALSE_PARSER(name) \
76 MALA_SUBSTITUTE_PARSER(name,"--FALSE")
78 #include "std_macros.h"
79 #include "std_statements.h"
80 #include "std_io.h"
82 int
83 mala_module_std_init (MalaEngine self);
85 #endif /* MALA_STD_H */
87 // Local Variables:
88 // mode: C
89 // c-file-style: "gnu"
90 // End:
91 // arch-tag: df02af8a-69d7-4d51-8acc-aa544cb3acbe
92 // end_of_file