26 |
#include "files.h" |
#include "files.h" |
27 |
int skel_lex PARAMS ((void)); |
int skel_lex PARAMS ((void)); |
28 |
static int yylineno = 1; |
static int yylineno = 1; |
29 |
|
static char *yyoutname = NULL; |
30 |
%} |
%} |
31 |
%% |
%% |
32 |
/* This is an approximation, but we don't need more. */ |
/* This is an approximation, but we don't need more. */ |
33 |
^"#output \""[^\"]+\"\n { |
^"#output \""[^\"]+\"\n { |
34 |
yytext[yyleng - 2] = '\0'; |
yytext[yyleng - 2] = '\0'; |
35 |
skel_out = xfopen (yytext + strlen ("#output \""), "w"); |
XFREE (yyoutname); |
36 |
|
yyoutname = xstrdup (yytext + strlen ("#output \"")); |
37 |
|
yyout = xfopen (yyoutname, "w"); |
38 |
yylineno = 1; |
yylineno = 1; |
39 |
} |
} |
40 |
|
|
41 |
"__oline__" fprintf (yyout, "%d", yylineno); |
"__oline__" fprintf (yyout, "%d", yylineno); |
42 |
|
"__ofile__" fprintf (yyout, "%s", yyoutname); |
43 |
[^_\n]+ ECHO; |
[^_\n]+ ECHO; |
44 |
\n+ yylineno += yyleng; ECHO; |
\n+ yylineno += yyleng; ECHO; |
45 |
. ECHO; |
. ECHO; |