]> git.saurik.com Git - bison.git/blobdiff - data/c.m4
build: generalize etc/prefix-gnulib-mk
[bison.git] / data / c.m4
index e7308be301bc9764683cca526c4ecdcef2253d88..d09d1f1c3faa56f6751e10ac31c6f7795bd51957 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -1,7 +1,8 @@
                                                             -*- Autoconf -*-
 
 # C M4 Macros for Bison.
-# Copyright (C) 2002, 2004-2010 Free Software Foundation, Inc.
+
+# Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -145,7 +146,7 @@ m4_define([b4_int_type],
 
        m4_eval([0 <= $1]),                [1], [unsigned int],
 
-                                              [int])])
+                                               [int])])
 
 
 # b4_int_type_for(NAME)
@@ -234,7 +235,7 @@ m4_define([b4_token_enums],
    enum yytokentype {
 m4_map_sep([     b4_token_enum], [,
 ],
-          [$@])
+           [$@])
    };
 #endif
 ])])
@@ -313,7 +314,7 @@ $1 (b4_c_ansi_formals(m4_shift2($@)))[]dnl
 m4_define([b4_c_ansi_formals],
 [m4_if([$#], [0], [void],
        [$#$1], [1], [void],
-              [m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
+               [m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
 
 m4_define([b4_c_ansi_formal],
 [$1])
@@ -334,9 +335,9 @@ m4_define([b4_c_knr_formal_name],
 # Output the K&R argument declarations.
 m4_define([b4_c_knr_formal_decls],
 [m4_map_sep([b4_c_knr_formal_decl],
-           [
+            [
 ],
-           [$@])])
+            [$@])])
 
 m4_define([b4_c_knr_formal_decl],
 [    $1;])
@@ -415,6 +416,15 @@ b4_syncline([@oline@], [@ofile@])
     break;])
 
 
+# b4_predicate_case(LABEL, CONDITIONS)
+# ------------------------------------
+m4_define([b4_predicate_case],
+[  case $1:
+    if (! ($2)) YYERROR;
+b4_syncline([@oline@], [@ofile@])
+    break;])
+
+
 # b4_yydestruct_generate(FUNCTION-DECLARATOR)
 # -------------------------------------------
 # Generate the "yydestruct" function, which declaration is issued using
@@ -447,7 +457,7 @@ b4_parse_param_use[]dnl
     {
 ]b4_symbol_foreach([b4_symbol_destructor])dnl
 [      default:
-       break;
+        break;
     }
 }]dnl
 ])
@@ -467,9 +477,9 @@ m4_define_default([b4_yy_symbol_print_generate],
 /*ARGSUSED*/
 ]$1([yy_symbol_value_print],
     [static void],
-              [[FILE *yyoutput],                       [yyoutput]],
-              [[int yytype],                           [yytype]],
-              [[YYSTYPE const * const yyvaluep],       [yyvaluep]][]dnl
+               [[FILE *yyoutput],                       [yyoutput]],
+               [[int yytype],                           [yytype]],
+               [[YYSTYPE const * const yyvaluep],       [yyvaluep]][]dnl
 b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
 m4_ifset([b4_parse_param], [, b4_parse_param]))[
 {
@@ -488,7 +498,7 @@ b4_parse_param_use[]dnl
     {
 ]b4_symbol_foreach([b4_symbol_printer])dnl
 [      default:
-       break;
+        break;
     }
 }
 
@@ -499,9 +509,9 @@ b4_parse_param_use[]dnl
 
 ]$1([yy_symbol_print],
     [static void],
-              [[FILE *yyoutput],                       [yyoutput]],
-              [[int yytype],                           [yytype]],
-              [[YYSTYPE const * const yyvaluep],       [yyvaluep]][]dnl
+               [[FILE *yyoutput],                       [yyoutput]],
+               [[int yytype],                           [yytype]],
+               [[YYSTYPE const * const yyvaluep],       [yyvaluep]][]dnl
 b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl
 m4_ifset([b4_parse_param], [, b4_parse_param]))[
 {