3 * This is the lexical analyser for the Event Specification file
6 #define YYSTYPE const char*
8 #include "lwes_esf_parser.h"
9 #include "lwes_esf_parser_y.h" /* token codes from the parser */
14 #define YY_DECL int lweslex( YYSTYPE *lvalp, void *param)
16 /* this fixes a problem in flex where compiling with -Wall fails since
17 the ECHO macro ignores the output of fwrite(). So we assign the output
18 to a static variable but don't use it so the compile suceeds */
19 static int __lwesfwriteout;
20 #define ECHO _fwout = fwrite( yytext, yyleng, 1, yyout )
22 /* function prototypes */
23 int lweslex(YYSTYPE *lvalp, void *param);
24 void lweslexdestroy (void);
30 /* FIXME: This doesn't work with multiple parsers, I think I need to
31 experiment with reentrancy */
32 lwes_delete_buffer (YY_CURRENT_BUFFER);
42 \n { ((struct lwes_parser_state *) param)->lineno++; }
44 *lvalp = (YYSTYPE)lwestext;
48 *lvalp = (YYSTYPE)lwestext;
52 *lvalp = (YYSTYPE)lwestext;
56 *lvalp = (YYSTYPE)lwestext;
60 *lvalp = (YYSTYPE)lwestext;
64 *lvalp = (YYSTYPE)lwestext;
68 *lvalp = (YYSTYPE)lwestext;
72 *lvalp = (YYSTYPE)lwestext;
76 *lvalp = (YYSTYPE)lwestext;
80 *lvalp = (YYSTYPE)lwestext;
81 if (((struct lwes_parser_state *) param)->in_event)
82 return(ATTRIBUTEWORD);
87 ((struct lwes_parser_state *) param)->in_event = 1;
91 ((struct lwes_parser_state *) param)->in_event = 0;
97 "#"[^\n]* /* eat up one-line comments */