From 53c71a12c8bed583886c857a53e6f13f95d9916b Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 3 May 2002 16:22:54 +0000 Subject: [PATCH 1/1] * data/bison.simple (m4_if): Don't output empty enums. And actually, output valid enum definitions :(. --- ChangeLog | 5 +++++ data/bison.simple | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26c6517c..67d04da5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-05-03 Akim Demaille + + * data/bison.simple (m4_if): Don't output empty enums. + And actually, output valid enum definitions :(. + 2002-05-03 Akim Demaille * configure.bat: Remove, completely obsolete. diff --git a/data/bison.simple b/data/bison.simple index 1c153a0a..a540cd03 100644 --- a/data/bison.simple +++ b/data/bison.simple @@ -82,14 +82,16 @@ m4_define([b4_token_define], # --------------------------------------- # Output the definition of this token as an enum. m4_define([b4_token_enum], -[enum $1 = $2]) +[$1 = $2]) # b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) # ------------------------------------------------------- -# Output the definition of the tokens as #define. +# Output the definition of the tokens (if there are) as enums and #define. m4_define([b4_token_defines], -[#ifndef YYTOKENTYPE +[m4_if([$@], [[]], [], +[/* Tokens. */ +#ifndef YYTOKENTYPE # if defined (__STDC__) || defined (__cplusplus) /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ @@ -101,8 +103,10 @@ m4_map_sep([ b4_token_enum], [, /* POSIX requires `int' for tokens in interfaces. */ # define YYTOKENTYPE int # endif -#endif -m4_map([b4_token_define], [$@])]) +#endif /* !YYTOKENTYPE */ +m4_map([b4_token_define], [$@]) +]) +]) m4_divert(0)dnl @@ -310,7 +314,6 @@ union yyalloc #endif -/* Tokens. */ b4_token_defines(b4_tokens) /* YYFINAL -- State number of the termination state. */ -- 2.45.2