From d519434c19d658838322ae95f28e7a19325eba0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mu=C5=BCy=C5=82o?= Date: Wed, 3 Aug 2011 02:51:29 +0200 Subject: Readd requred flex/bison stuff and fix it for autotools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Mużyło Signed-off-by: Matt Turner --- src/laylex.l | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/laylex.l') diff --git a/src/laylex.l b/src/laylex.l index c7dced9..8aa19ef 100644 --- a/src/laylex.l +++ b/src/laylex.l @@ -1,4 +1,5 @@ - +%option prefix="LayYY" +%option outfile="lex.yy.c" %{ #ifndef FLEX_SCANNER #undef input @@ -12,6 +13,11 @@ #include "LayoutP.h" #include "laygram.h" + +#define yylval LayYYlval +#define yyerror LayYYerror +#define yysetsource LayYYsetsource + static char *yysourcebase, *yysource; #ifndef FLEX_SCANNER @@ -23,9 +29,7 @@ static void my_yyinput(char *buf, int *result, int max_size); #define YY_INPUT(buf, res, max) my_yyinput(buf, &(res), max) #endif -#ifdef __STDC__ -static int count (); -#endif +static int count (char *s, char c); %} %% vertical return VERTICAL; @@ -75,9 +79,7 @@ height return HEIGHT; %% static int -count (s, c) - char *s; - char c; +count (char *s, char c) { int i = 0; while (*s) @@ -86,14 +88,12 @@ count (s, c) return i; } -yysetsource(s) - char *s; +void yysetsource(char *s) { yysourcebase = yysource = s; } -yyerror(s) - char *s; +void yyerror(char *s) { char *t; @@ -115,8 +115,7 @@ yyerror(s) #ifdef FLEX_SCANNER static void -my_yyinput(buf, result, max_size) - char *buf; int *result; int max_size; +my_yyinput(char *buf, int *result, int max_size) { int size = max_size < strlen(yysource) ? max_size : strlen(yysource); -- cgit v1.2.3