/********************************************************************************
*
* File: oql.lex
* Title: The oql scanner; it recognizes sql keywords
* Programmer: Leonidas Fegaras, UTA
* Date: 2/21/97
*
********************************************************************************/
%{
%}
/* remove the following line if flex complains */
%option noyywrap
DIGIT    [0-9]
ID       [a-zA-Z][a-zA-Z0-9_]*
%%
{DIGIT}+		{ return NUM; }
"["			{ return LB; }
"]"			{ return RB; }
"{"			{ return LSB; }
"}"			{ return RSB; }
"("			{ return LP; }
")"			{ return RP; }
","			{ return COMMA; }
";"			{ return SEMI; }
":"			{ return COLON; }
"=>"			{ return DARROW; }
"->"			{ return SARROW; }
"<-"            	{ return LARROW; }
":="            	{ return ASSIGN; }
"|"			{ return BAR; }
"="			{ return EQ; }
"if"			{ return IF; }
"then"			{ return THEN; }
"else"			{ return ELSE; }
"in"			{ return IN; }
"and"            	{ return AND; }
"or"            	{ return OR; }
"from"            	{ return FROM; }
"extent"            	{ return EXTENT; }
"class"            	{ return CLASS; }
"select"		{ return SELECT; }
"where"			{ return WHERE; }
"distinct"		{ return DISTINCT; }
"intersect"		{ return INTERSECT; }
"union"			{ return UNION; }
"sort"			{ return SORT; }
"for"			{ return FOR; }
"struct"		{ return STRUCT; }
"all"			{ return ALL; }
"exists"		{ return EXISTS; }
"group"			{ return GROUP; }
"by"			{ return BY; }
"with"			{ return WITH; }
"+"			{ return PLUS; }
"*"			{ return TIMES; }
"-"			{ return MINUS; }
"."			{ return DOT; }
"/"			{ return DIV; }
"<"			{ return LT; }
">"			{ return GT; }
"<="			{ return LE; }
"!="			{ return NE; }
">="			{ return GE; }
"o"			{ return COMPOSE; }
"^"			{ return CONCAT; }
"false"			{ return FALSE; }
"true"			{ return TRUE; }
"enum"			{ return ENUM; }
"key"			{ return KEY; }
"keys"			{ return KEYS; }
"relationship"		{ return RELATIONSHIP; }
"directives"		{ return DIRECTIVES; }
"attribute"		{ return ATTRIBUTE; }
"inverse"		{ return INVERSE; }
"interface"		{ return INTERFACE; }

{ID}			{ return ID; }


\/\*[^*/]*\*\/		{}

\'[^']*\'		{ return LSTRING; }

\"[^"]*\"		{ return LSTRING; }

\n			{ lineno++; }

\ 

\t

%%
