1#include "./main.auto.h"
10#define dbg_puts(s) fputs(s, stdout
)
15#define SZBOOK ((size_t)(sizeof(BOOK) - 1
))
17char SEE[
sizeof(
BOOK)] = {
21#define prm_cmt prmbool.m_cmt
22#define prm_space_found prmbool.m_space_found
23#define prm_first prmbool.m_first
35#define STATE_OUTFAILED 1
36#define STATE_UNEXPECTED 2
37#define STATE_OVERRUN 3
49 ((((c) >= 'A') && ((c) <= 'Z')) || (((c) >= 'a') && ((c) <= 'z')))
50#define isNumber(c) (((c) >= '0') && ((c) <= '9'))
52#define isNewLine(c) ((c) == '\n' || (c) == '\r')
59 register int tprm = 0;
61 register int stack = 0;
63 register struct __prmbool {
65 unsigned m_space_found : 1;
67 unsigned m_is_fn_arg : 1;
68 } prmbool = {0, 0, 0, 0 };
71 puts(
"#undef\t__ae2f_MACRO_GENERATED\n"
72 "#define\t__ae2f_MACRO_GENERATED\t1");
73 while ((c = fgetc(stdin)) != EOF) {
85 if (c ==
'\"')
goto STRING;
88 const char _INCLUDE[
sizeof(
"#include") - 1] =
"#include";
89 char _SEE_INC[
sizeof(_INCLUDE)];
93 for (; i < (size_t)
sizeof(_INCLUDE); i++) {
94 _SEE_INC[i] = (
char)fgetc(stdin);
95 fputc(_SEE_INC[i], stdout);
97 if (_SEE_INC[i] != _INCLUDE[i]) {
102 if (i ==
sizeof(_INCLUDE)) {
103 while ((c = fgetc(stdin)) != EOF && !
isNewLine(c)) {
107 puts(
"\n#undef __ae2f_MACRO_GENERATED\n"
108 "#define __ae2f_MACRO_GENERATED 1");
112 else if (c == (
BOOK)[0]) {
116 SEE[i] = (
char)fgetc(stdin);
118 if (SEE[i] != (
BOOK)[i]) {
125 if (fputs(SEE, stdout) < 0)
131 l = fputs(
"#define _", stdout);
142 switch ((c = fgetc(stdin))) {
170 switch (c = fgetc(stdin)) {
174 l = fputc(c, stdout);
186 dbg_puts(
" \\\n\t/** tparam */ \\\n\t\t");
188 if (fputs(TPARAMS, stdout) < 0)
191 dbg_puts(
" \\\n \\\n\t/** param */ \\\n\t\t");
197 prmbool.m_is_fn_arg = 0;
202 if (fputs(
"/* ", stdout) < 0)
207 switch (c = fgetc(stdin)) {
220 fputs(PARAM, stdout);
228 if (fputc(
',', stdout) < 0)
234 fputs(PARAM, stdout);
246 if(prmbool.m_is_fn_arg) {
247 while((fgetc(stdin)) !=
')');
250 prmbool.m_is_fn_arg = 1;
256 prmbool.m_is_fn_arg = 0;
258 if(c ==
')' && stack--) {
265 if (fputs(
" */ ", stdout) < 0)
273 PARAM[prm + 1] =
'\\';
274 PARAM[prm + 2] =
'\n';
277 l = fputs(PARAM, stdout);
280 l = fputs(PARAM, stdout);
300 switch (c = fgetc(stdin)) {
306 l = fputs(ENDL, stdout);
313 l = fputc(c, stdout);
322 l = fputc(
'{', stdout);
328 l = fputc(
'}', stdout);
348 "\n#undef\t__ae2f_MACRO_GENERATED\n"
349 "\n#define\t__ae2f_MACRO_GENERATED\t0\n"
356 while((c = fgetc(stdin)) != EOF) {