7 #include "exceptions.h"
9 #define YY_FATAL_ERROR(str) throw parseException(str)
24 WORDANY [#a-zA-Z0-9:?!_+-]
29 \'.\' lex_lineno = yylineno; return make_int(yytext[1]);
30 %[01]* lex_lineno = yylineno; return make_bin(yytext);
31 {WORDINIT}{WORDANY}* lex_lineno = yylineno; return make_word(yytext);
32 [-+]?{DIGIT}*\.{DIGIT}* lex_lineno = yylineno; return make_float(atof(yytext));
33 [-+]?{DIGIT}+ lex_lineno = yylineno; return make_int(atoi(yytext));
35 "<>" lex_lineno = yylineno; return make_word("ne");
36 "<=" lex_lineno = yylineno; return make_word("le");
37 ">=" lex_lineno = yylineno; return make_word("ge");
38 "<" lex_lineno = yylineno; return make_word("lt");
39 ">" lex_lineno = yylineno; return make_word("gt");
40 "==" lex_lineno = yylineno; return make_word("eq");
41 "=" lex_lineno = yylineno; return make_word("eq");
42 "&&" lex_lineno = yylineno; return make_word("and");
43 "||" lex_lineno = yylineno; return make_word("or");
47 <L_BYTESTR>[0-9]+ push_bytestr(atoi(yytext));
49 <L_BYTESTR>"]" BEGIN(INITIAL); lex_lineno = yylineno; return make_bytestr();
52 <L_STRING>\\. push_string_escape(yytext[1]);
53 <L_STRING>\" BEGIN(INITIAL); lex_lineno = yylineno; return make_string();
54 <L_STRING>. push_string_lit(yytext[0]);
56 [ \t\n\r] // eat whitespace
57 . parse_error(yytext, yylineno);