Made lime_scan_tokens.l somewhat more elegant to read

master
Richard van Velzen 2012-01-02 12:59:35 +01:00
parent 6163fdac49
commit f669d69163
1 changed files with 38 additions and 40 deletions

View File

@ -14,9 +14,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
%{
void out(char*t, char*v);
void out(char* t, char* v);
void lit();
void tok(char*t);
void tok(char* t);
void php();
%}
@ -63,9 +63,7 @@ BLOCKCMT "/*"({CC}|{CX})*{CT}
{BLOCKCMT} {}
"/"{WORD}+ |
"/$" out("lambda", yytext+1);
"%prec" {
tok("prec");
}
"%prec" tok("prec");
"%"{WORD}+ {
out("pragma", yytext+1);
yy_push_state(pragma);
@ -115,7 +113,7 @@ void lit() {
out(lit, yytext);
}
void tok(char*t) {
void tok(char* t) {
out(t, yytext);
}
@ -123,7 +121,7 @@ void php() {
out("php", yytext);
}
void out(char*type, char*value) {
void out(char* type, char* value) {
printf("%d\001%s\001%s", yylineno, type, value);
fputc(0, stdout);
}