diff --git a/src/frontend/scanner.l b/src/frontend/scanner.l
index 6c2bfa148fd802ff4365187015d7636895af86bf..61f1743fa60560c69f2cf5835f9c49827e760b17 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;
+ }
. { /* do nothing for now */ }