summaryrefslogtreecommitdiff
path: root/src/laylex.l
diff options
context:
space:
mode:
authorRafał Mużyło <galtgendo@o2.pl>2011-08-03 02:51:29 +0200
committerMatt Turner <mattst88@gmail.com>2011-08-03 17:15:28 -0400
commitd519434c19d658838322ae95f28e7a19325eba0c (patch)
tree8f8d3b4202bff059e5613e7c2a900aa7b37c0633 /src/laylex.l
parent76c5f905c7178cf76cdf8a5817bb1575d8cdba82 (diff)
Readd requred flex/bison stuff and fix it for autotools
Signed-off-by: Rafał Mużyło <galtgendo@o2.pl> Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/laylex.l')
-rw-r--r--src/laylex.l25
1 files changed, 12 insertions, 13 deletions
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);