/* $Id: bool_lex.l,v 1.2 2005/10/28 22:59:29 dodell Exp $ */ /* Copyright 2001 Sun Microsystems, Inc. All rights reserved. */ %{ #include #include #include "y.tab.h" extern int yyline; YY_BUFFER_STATE mybuf; void bool_scan(const char *string) { mybuf = yy_scan_string(string); } void bool_terminate() { yy_delete_buffer(mybuf); } %} WORD [A-Za-z_][A-Za-z0-9_]* %% "(" { return LPAREN; } ")" { return RPAREN; } [Aa][Nn][Dd] { return AND; } [Oo][Rr]|, { return OR; } [Nn][Oo][Tt]|! { return NOT; } {WORD}\([^()]*\)|{WORD} { yylval.str = yytext; return RULE; } [ \t\n]* { /* ignored */; } . { return yytext[0]; } %%