diff --git a/src/frontend/scanner.l b/src/frontend/scanner.l
index 87367f6e4324886fa0e2b0aa93a457c918326b68..1e371f45668435d509dd4ddf942ec196f547ba76 100644 (file)
--- a/src/frontend/scanner.l
+++ b/src/frontend/scanner.l
csc_end \*\/
identifier ([A-Za-z_][A-Za-z_0-9$]*)
+/* TODO: fully support SQL strings */
+string ('[^']*')
%%
}
{identifier} {
- /* XXX */
- if (! strcasecmp(yytext, "LIST"))
+ /* XXX: simplify handling of reserved words */
+ if (! strcasecmp(yytext, "FETCH"))
+ return FETCH;
+ else if (! strcasecmp(yytext, "LIST"))
return LIST;
+ else if (! strcasecmp(yytext, "LOOKUP"))
+ return LOOKUP;
+ else if (! strcasecmp(yytext, "WHERE"))
+ return WHERE;
yylval->str = strdup(yytext);
return IDENTIFIER;
}
+{string} {
+ yytext[yyleng - 1] = '\0';
+ yylval->str = strdup(yytext + 1);
+ return STRING;
+ }
+
+= { return CMP_EQUAL; }
+=~ { return CMP_REGEX; }
-. { /* do nothing for now */ }
+. { /* XXX: */ return yytext[0]; }
%%