46 #include "tokens_zvr.h"
50 # define strrchr rindex
59 EXPONENT [Ee][+-]?{DIGIT}+
61 REAL [+-]?{DIGIT}+(
"."{DIGIT}+)?{EXPONENT}?
63 IDENT [a-zA-Z][a-zA-Z-]*
65 DIDENT [
A-Z]({DIGIT}{1,2})?
69 %option yylineno noyywrap nounput
prefix=
"zvr_"
78 <VERSION>{DIGITS}
"."{DIGITS} {
84 zvr_lval.f = strtod (zvr_text, NULL);
88 <INITIAL>(
"Hz")|(
"none")|(
"dB") {
89 zvr_lval.ident = strdup (zvr_text);
93 <INITIAL>(
"RI")|(
"COMPLEX")|(
"MAGNITUDE")|(
"PHASE")|(
"MA")|(
"DB") {
94 zvr_lval.ident = strdup (zvr_text);
99 zvr_lval.ident = strdup (zvr_text);
104 zvr_lval.ident = strdup (zvr_text);
108 <INITIAL>((
"re")|(
"im")|(
"mag")|(
"ang")|(
"db"))?{DIDENT} {
109 zvr_lval.ident = strdup (zvr_text);
113 <INITIAL>
";" {
return ';'; }
119 "line %d: syntax error, unrecognized character: `%s'\n",
< INITIAL >< INITIAL >< INITIAL >< INITIAL > return InvalidCharacter