2 std.c - MaLa standard parser module
4 Copyright (C) 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.
26 mala_substitute_parser (MalaEngine eng
,
27 MalaStringListNode_ref pptr
,
30 if (!mala_stringlist_after_new (&eng
->program
, *pptr
, (MalaString
) data
))
33 mala_stringlist_elem_delete_fwd (&eng
->program
, pptr
);
38 return eng
->state
= MALA_EALLOC
;
42 mala_expand_parser (MalaEngine eng
,
43 MalaStringListNode_ref pptr
,
46 MalaStringListNode itr
;
47 for (itr
= mala_stringlist_tail ((MalaStringList
) data
);
48 !mala_stringlist_is_end ((MalaStringList
) data
, itr
);
49 mala_stringlist_rev (&itr
))
51 if (!mala_stringlist_after_new (&eng
->program
, *pptr
, itr
->string
))
55 mala_stringlist_elem_delete_fwd (&eng
->program
, pptr
);
61 return eng
->state
= MALA_EALLOC
;
65 mala_macro_parser (MalaEngine eng
,
66 MalaStringListNode_ref pptr
,
72 return MALA_ENOACTION
;
76 mala_null_parser (MalaEngine eng
,
77 MalaStringListNode_ref pptr
,
81 mala_stringlist_elem_delete_fwd (&eng
->program
, pptr
);
88 // c-file-style: "gnu"
90 // arch-tag: 687e1195-8aad-4425-983d-9767a25c3793