/* -*- fundamental -*- */
%{
-#include "y.tab.h"
+#include "record.h"
%}
%option warn
%option batch
%option noyywrap
-
-%option bison-locations
-%option bison-bridge
+%option yylineno
+%option prefix="record_yy"
+%option header-file="record-l.h"
%{
-#define STR yylval->str= xstrdup(yytext); return
+#define STR record_yylval.name= record_tempzone_strdup(yytext); return
%}
%%
-max-trains { yylval->str= 0; return MAXTRAINS; }
-
train { STR TRAIN; }
seg { STR SEG; }
is { STR IS; }
step { STR STEP; }
end { STR END; }
-[A-Za-z0-9_]+ { STR IDENT; }
+[A-Za-z][A-Za-z0-9_]+ { STR IDENT; }
-[0-9]{0,5} { yylval->num= strtoul(yytext,0,10); return NUM; }
-[0-9]{6} { badrecord("number too long"); }
+[0-9]{0,5} { record_yylval.num= strtoul(yytext,0,10); return NUM; }
+[0-9]{6} { record_yyerror("number too long"); }
-[-+:=~$/] { yylval->str= 0; return yytext[0]; }
+[-+:=~/] { record_yylval.name= 0; return yytext[0]; }
-\#.*\n|\ { yylval->str= 0; return NL; }
+\#.*\n|\n { record_yylval.name= 0; return NL; }
[ \t] { }
-. { badrecord("lexically invalid input"); }
+. { record_yyerror("lexically invalid input"); }