/* $Id: mod_tbl.l,v 1.5 2004/04/01 05:37:59 jmuelmen Exp $ */ %{ #include #include "y.tab.h" void comment (); void mod_yyerror (const char *); %} %% "/*" { mod_comment(); } [Mm][0-9]* { return(MODULE); } 200[0-9][0-1][0-9][A-Za-z][A-Za-z][A-Za-z][0-9][0-9][0-9] { return(BOARD); } [0-3] { return(CHANNEL); } [\r\n] { return(NEWLINE); } \#.*[\r\n] ; [ \t\v\f\r] ; . { mod_yyerror("Unrecognized symbol"); } %% #ifndef mod_yywrap int mod_yywrap () { return 1; } #endif #ifndef yytext_ptr #define yytext_ptr mod_yytext #endif void mod_comment() { char c, c1; loop: while ((c = input()) != '*' && c != 0) putchar(c); if ((c1 = input()) != '/' && c != 0) { unput(c1); goto loop; } if (c != 0) putchar(c1); } void mod_tbl_set_input (FILE *f) { mod_yyin = f; }