* data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,

src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
tests/action.at, tests/calc.at, tests/conflicts.at,
tests/cxx-type.at, tests/regression.at:
"parse error" -> "syntax error" for POSIX compatibility.
"parsing stack overflow..." -> "parser stack overflow" so
that code matches Bison documentation.
This commit is contained in:
Paul Eggert
2002-11-15 20:32:21 +00:00
parent 0f39aab92a
commit 6e649e659e
15 changed files with 80 additions and 62 deletions

View File

@@ -322,7 +322,7 @@ thing(1@10): 'x'(1@10)
sending: 'x' (value = 2, line 20)
thing(2@20): 'x'(2@20)
sending: 'x' (value = 3, line 30)
30: parse error, unexpected 'x', expecting ';'
30: syntax error, unexpected 'x', expecting ';'
Freeing nterm thing (2@20)
Freeing nterm thing (1@10)
Freeing nterm thing (0@0)
@@ -344,7 +344,7 @@ thing(10@100): 'x'(10@100)
sending: ';' (value = 11, line 110)
line(10@100): thing(10@100) ';'
sending: 'y' (value = 12, line 120)
120: parse error, unexpected $undefined, expecting $end or 'x'
120: syntax error, unexpected $undefined, expecting $end or 'x'
sending: EOF
Freeing nterm line (10@100)
Freeing nterm line (7@70)

View File

@@ -353,7 +353,7 @@ m4_bmatch([$1],
# [NUM-DEBUG-LINES],
# [VERBOSE-AND-LOCATED-ERROR-MESSAGE])
# ---------------------------------------------------------
# Run `calc' on INPUT, and expect a `parse error' message.
# Run `calc' on INPUT, and expect a `syntax error' message.
#
# If INPUT starts with a slash, it is used as absolute input file name,
# otherwise as contents.
@@ -362,7 +362,7 @@ m4_bmatch([$1],
# is correctly output on stderr.
#
# If BISON-OPTIONS contains `%error-verbose', then make sure the
# IF-YYERROR-VERBOSE message is properly output after `parse error, '
# IF-YYERROR-VERBOSE message is properly output after `syntax error, '
# on STDERR.
#
# If BISON-OPTIONS contains `%debug' but not `%glr', then NUM-STDERR-LINES
@@ -406,7 +406,7 @@ AT_YYERROR_SEES_LOC_IF([],
mv at-expout expout]])
# 4. If error-verbose is not used, strip the`, unexpected....' part.
m4_bmatch([$1], [%error-verbose], [],
[[sed 's/parse error, .*$/parse error/' expout >at-expout
[[sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout]])
# 5. Check
AT_CHECK([cat stderr], 0, [expout])
@@ -497,30 +497,30 @@ _AT_CHECK_CALC([$1],
(2^2)^3 = 64],
[486])
# Some parse errors.
# Some syntax errors.
_AT_CHECK_CALC_ERROR([$1], [1], [0 0], [11],
[1.3-1.4: parse error, unexpected "number"])
[1.3-1.4: syntax error, unexpected "number"])
_AT_CHECK_CALC_ERROR([$1], [1], [1//2], [15],
[1.3-1.4: parse error, unexpected '/', expecting "number" or '-' or '('])
[1.3-1.4: syntax error, unexpected '/', expecting "number" or '-' or '('])
_AT_CHECK_CALC_ERROR([$1], [1], [error], [4],
[1.1-1.2: parse error, unexpected $undefined, expecting "number" or '-' or '\n' or '('])
[1.1-1.2: syntax error, unexpected $undefined, expecting "number" or '-' or '\n' or '('])
_AT_CHECK_CALC_ERROR([$1], [1], [1 = 2 = 3], [22],
[1.7-1.8: parse error, unexpected '='])
[1.7-1.8: syntax error, unexpected '='])
_AT_CHECK_CALC_ERROR([$1], [1],
[
+1],
[14],
[2.1-2.2: parse error, unexpected '+'])
[2.1-2.2: syntax error, unexpected '+'])
# Exercise error messages with EOF: work on an empty file.
_AT_CHECK_CALC_ERROR([$1], [1], [/dev/null], [4],
[1.1-1.2: parse error, unexpected "end of input", expecting "number" or '-' or '\n' or '('])
[1.1-1.2: syntax error, unexpected "end of input", expecting "number" or '-' or '\n' or '('])
# Exercise the error token: without it, we die at the first error,
# hence be sure i. to have several errors, ii. to test the action
# associated to `error'.
_AT_CHECK_CALC_ERROR([$1], [0], [(1 ++ 2) + (0 0) = 1], [82],
[1.5-1.6: parse error, unexpected '+', expecting "number" or '-' or '('
1.15-1.16: parse error, unexpected "number"
[1.5-1.6: syntax error, unexpected '+', expecting "number" or '-' or '('
1.15-1.16: syntax error, unexpected "number"
calc: error: 0 != 1])
AT_CHECK_POPDEFS

View File

@@ -108,16 +108,16 @@ AT_PARSER_CHECK([./input '0<0'])
# no one has ever spotted it! The messages are *wrong*: there should
# be nothing there, it should be expected eof.
AT_PARSER_CHECK([./input '0<0<0'], [1], [],
[parse error, unexpected '<', expecting '<' or '>'
[syntax error, unexpected '<', expecting '<' or '>'
])
AT_PARSER_CHECK([./input '0>0'])
AT_PARSER_CHECK([./input '0>0>0'], [1], [],
[parse error, unexpected '>', expecting '<' or '>'
[syntax error, unexpected '>', expecting '<' or '>'
])
AT_PARSER_CHECK([./input '0<0>0'], [1], [],
[parse error, unexpected '>', expecting '<' or '>'
[syntax error, unexpected '>', expecting '<' or '>'
])
AT_CLEANUP

View File

@@ -241,11 +241,11 @@ z q +
]])
m4_define([_AT_GLR_STDERR],
[[parse error
[[syntax error
]])
m4_define([_AT_VERBOSE_GLR_STDERR],
[[parse error, unexpected ID, expecting '=' or '+' or ')'
[[syntax error, unexpected ID, expecting '=' or '+' or ')'
]])
## ---------------------------------------------------- ##

View File

@@ -298,7 +298,7 @@ input.y:5.1-17: invalid directive: `%a-does-not-exist'
input.y:6.1: invalid character: `%'
input.y:6.2: invalid character: `-'
input.y:7.1-8.0: missing `%}' at end of file
input.y:7.1-8.0: parse error, unexpected "%{...%}", expecting ";" or "|"
input.y:7.1-8.0: syntax error, unexpected "%{...%}", expecting ";" or "|"
]])
AT_CLEANUP