]> git.saurik.com Git - bison.git/commitdiff
* data/bison.simple (m4_if): Don't output empty enums.
authorAkim Demaille <akim@epita.fr>
Fri, 3 May 2002 16:22:54 +0000 (16:22 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 3 May 2002 16:22:54 +0000 (16:22 +0000)
And actually, output valid enum definitions :(.

ChangeLog
data/bison.simple

index 26c6517c1f16d17854da1d7f29f6b5e528730a69..67d04da5c3201cba1629f5a98bf4fd74f8379446 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-03  Akim Demaille  <akim@epita.fr>
+
+       * data/bison.simple (m4_if): Don't output empty enums.
+       And actually, output valid enum definitions :(.
+
 2002-05-03  Akim Demaille  <akim@epita.fr>
 
        * configure.bat: Remove, completely obsolete.
index 1c153a0a2570b18c6b8a7fca8b9402d5d575bd85..a540cd0375d0e116292a29494fb6a9190e7aec9e 100644 (file)
@@ -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. */