10 # include "syntax.tab.h"
15 extern YYSTYPE yylval;
16 extern FILE *fc, *fhs;
19 void countNewlines (char *s)
21 while (*s) if (*s++ == '\n') lineno += 1;
27 ";" { return(SEMICOL); }
28 ":" { return(COLON); }
29 "<" { return(STDEF); }
30 ">" { return(ENDDEF); }
31 "type" { return(TYPE); }
32 "end" { return(END); }
33 [A-Za-z][A-Za-z0-9_]* { yylval = (YYSTYPE) installid(yytext); return(ID); }
36 "/*"([^*]|"*"[^/]|\n)*"*/" { countNewlines(yytext); }
37 "%{{"([^%]|"%"[^}]|\n)*"%}}" {
38 /* For Haskell includes */
39 countNewlines(yytext);
40 yytext[yyleng-3] = '\0';
41 fprintf(fhs, "\n%s", yytext+3);
43 "%{"([^%]|"%"[^}]|\n)*"%}" {
44 countNewlines(yytext);
45 yytext[yyleng-2] = '\0';
46 fprintf(fc, "\n%s", &yytext[2]);