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 and FORTIFY_SOURCE
17 fails since the ECHO macro ignores the output of fwrite().
18 So we assign the output to a static variable but don't use it so
19 the compile suceeds */
21 static int __lwesfwriteout;
22 #define ECHO _fwout = fwrite( yytext, yyleng, 1, yyout )
25 /* function prototypes */
26 int lweslex(YYSTYPE *lvalp, void *param);
27 void lweslexdestroy (void);
33 /* FIXME: This doesn't work with multiple parsers, I think I need to
34 experiment with reentrancy */
35 lwes_delete_buffer (YY_CURRENT_BUFFER);
45 \n { ((struct lwes_parser_state *) param)->lineno++; }
47 *lvalp = (YYSTYPE)lwestext;
51 *lvalp = (YYSTYPE)lwestext;
55 *lvalp = (YYSTYPE)lwestext;
59 *lvalp = (YYSTYPE)lwestext;
63 *lvalp = (YYSTYPE)lwestext;
67 *lvalp = (YYSTYPE)lwestext;
71 *lvalp = (YYSTYPE)lwestext;
75 *lvalp = (YYSTYPE)lwestext;
79 *lvalp = (YYSTYPE)lwestext;
83 *lvalp = (YYSTYPE)lwestext;
84 if (((struct lwes_parser_state *) param)->in_event)
85 return(ATTRIBUTEWORD);
90 ((struct lwes_parser_state *) param)->in_event = 1;
94 ((struct lwes_parser_state *) param)->in_event = 0;
100 "#"[^\n]* /* eat up one-line comments */