]> git.saurik.com Git - bison.git/blobdiff - data/c.m4
doc: add bibliography to manual.
[bison.git] / data / c.m4
index 33a4186c446570ad8f2d63afb00a36b88fcde31d..7a718a1dd8eef7cb56069d17d6b9846e12d61fb8 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -1,8 +1,8 @@
                                                             -*- Autoconf -*-
 
 # C M4 Macros for Bison.
-# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+
+# Copyright (C) 2002, 2004-2011 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
@@ -157,6 +157,17 @@ m4_define([b4_int_type_for],
 [b4_int_type($1_min, $1_max)])
 
 
+# b4_table_value_equals(TABLE, VALUE, LITERAL)
+# --------------------------------------------
+# Without inducing a comparison warning from the compiler, check if the
+# literal value LITERAL equals VALUE from table TABLE, which must have
+# TABLE_min and TABLE_max defined.  YYID must be defined as an identity
+# function that suppresses warnings about constant conditions.
+m4_define([b4_table_value_equals],
+[m4_if(m4_eval($3 < m4_indir([b4_]$1[_min])
+               || m4_indir([b4_]$1[_max]) < $3), [1],
+       [[YYID (0)]],
+       [[((]$2[) == (]$3[))]])])
 
 ## ---------##
 ## Values.  ##
@@ -405,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