7 #include "exceptions.h"
9 #define YY_FATAL_ERROR(str) throw parseException(str)
23 WORDANY [$#a-zA-Z0-9:?!_+-]
26 f\*\*k lex_lineno = yylineno; return make_word("f**k");
30 \'.\' lex_lineno = yylineno; return make_int(yytext[1]);
31 %[01]* lex_lineno = yylineno; return make_bin(yytext);
32 {WORDANY}*{WORDINIT}{WORDANY}* lex_lineno = yylineno; return make_word(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");
45 "[" BEGIN(L_BRSTRING);
46 <L_BRSTRING>"]" BEGIN(INITIAL); lex_lineno = yylineno; return make_string();
47 <L_BRSTRING>. push_string_lit(yytext[0]);
50 <L_STRING>\\. push_string_escape(yytext[1]);
51 <L_STRING>\" BEGIN(INITIAL); lex_lineno = yylineno; return make_string();
52 <L_STRING>. push_string_lit(yytext[0]);
54 [ ,\t\n\r] // eat whitespace and commas (separating commands)
55 . parse_error(yytext, yylineno);