# Exercising Bison on actual grammars. -*- Autotest -*-
-# Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1989-1992, 2000-2005, 2007, 2009-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
dnl support is rapidly evolving, let's keep that information to be careful.
dnl However, we don't do diffs for canonical LR(1) because the diff is huge.
m4_pushdef([AT_LALR1_DIFF_CHECK],
-[AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
+[dnl We need diff -u, which is not portable.
+AT_CHECK([diff -u /dev/null /dev/null || exit 77], [0], [ignore])
+
+AT_CHECK([[sed 's/^%define lr.type .*$//' input.y > input-lalr.y]])
AT_BISON_CHECK([[--report=all input-lalr.y]], [[0]], [ignore], [ignore])
AT_CHECK([[diff -u input-lalr.output input.output \
| sed -n '/^@@/,$p' | sed 's/^ $//']],
[[0]], [$1])])
AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]],
- [[%define lr.type "lalr"
+ [[%define lr.type lalr
]$3],
[$4], [$5], [$6], [$7],
[AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
AT_TEST_TABLES_AND_PARSE([$2[: IELR(1)]], [[IELR]], [[last-state]],
- [[%define lr.type "ielr"
+ [[%define lr.type ielr
]$3],
[$4], [$5], [$6], [$7],
[AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
AT_TEST_TABLES_AND_PARSE([$2[: Canonical LR(1)]], [[canonical LR]],
[[last-state,no-xml]],
- [[%define lr.type "canonical-lr"
+ [[%define lr.type canonical-lr
]$3],
[$4], [$5], [$6], [$7],
[$9], [$10], [$11], [$12])
# It reported 80 SR && 99 RR conflicts instead of 78/10!!!
AT_TEST_EXISTING_GRAMMAR([[GNU Cim Grammar]],
-[[%union {}
-
+[[
%token
HACTIVATE HAFTER /*HAND*/ HARRAY HAT
HBEFORE HBEGIN HBOOLEAN
AT_TEST_EXISTING_GRAMMAR([[GNU pic (Groff 1.18.1) Grammar]],
[[%error-verbose
-%union {}
%token LABEL
%token VARIABLE
%token RAND
%token SRAND
%token COPY
-%token THRU
+%token THROUGH
%token TOP
%token BOTTOM
%token UPPER
{}
DELIMITED
| COPY TEXT
- | COPY TEXT THRU
+ | COPY TEXT THROUGH
{}
DELIMITED
{}
until
- | COPY THRU
+ | COPY THROUGH
{}
DELIMITED
{}
[[VARIABLE, '=', LABEL, LEFT, DOT_X]],
dnl BISON-STDERR
-[[input.y:471.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
+[[input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
]],
dnl LAST-STATE