yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
{
AT_NAME_PREFIX::parser parser[]AT_PARAM_IF([ (result, count)]);
yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
{
AT_NAME_PREFIX::parser parser[]AT_PARAM_IF([ (result, count)]);
]AT_SKEL_CC_IF([], [m4_bmatch([$4], [%debug],
[ yydebug = 1;])])[
status = yyparse (]AT_PARAM_IF([&result, &count])[);
]AT_SKEL_CC_IF([], [m4_bmatch([$4], [%debug],
[ yydebug = 1;])])[
status = yyparse (]AT_PARAM_IF([&result, &count])[);
# Some syntax errors.
_AT_CHECK_CALC_ERROR([$1], [1], [0 0], [15],
# Some syntax errors.
_AT_CHECK_CALC_ERROR([$1], [1], [0 0], [15],
_AT_CHECK_CALC_ERROR([$1], [1], [1//2], [20],
_AT_CHECK_CALC_ERROR([$1], [1], [1//2], [20],
_AT_CHECK_CALC_ERROR([$1], [1], [error], [5],
_AT_CHECK_CALC_ERROR([$1], [1], [error], [5],
_AT_CHECK_CALC_ERROR([$1], [1], [1 = 2 = 3], [30],
_AT_CHECK_CALC_ERROR([$1], [1], [1 = 2 = 3], [30],
# Exercise error messages with EOF: work on an empty file.
_AT_CHECK_CALC_ERROR([$1], [1], [/dev/null], [4],
# Exercise error messages with EOF: work on an empty file.
_AT_CHECK_CALC_ERROR([$1], [1], [/dev/null], [4],
-# - check the look-ahead that triggers an error is not discarded
-# when we enter error recovery. Below, the look-ahead causing the
+# - check the lookahead that triggers an error is not discarded
+# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
_AT_CHECK_CALC_ERROR([$1], [0],
[() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1],
[250],
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
_AT_CHECK_CALC_ERROR([$1], [0],
[() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1],
[250],
-[1.1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
-1.17: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
-1.22: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
-1.40: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
+[1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
+1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
+1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
+1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_AT_CHECK_CALC_ERROR([$1], [0], [(!) + (0 0) = 1], [102],
_AT_CHECK_CALC_ERROR([$1], [0], [(!) + (0 0) = 1], [102],
calc: error: 2222 != 1])
_AT_CHECK_CALC_ERROR([$1], [0], [(- *) + (0 0) = 1], [113],
calc: error: 2222 != 1])
_AT_CHECK_CALC_ERROR([$1], [0], [(- *) + (0 0) = 1], [113],
-[1.3: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
-1.11: syntax error, unexpected number
+[1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
+1.12: syntax error, unexpected number
AT_CHECK_CALC_LALR([%verbose])
AT_CHECK_CALC_LALR([%yacc])
AT_CHECK_CALC_LALR([%error-verbose])
AT_CHECK_CALC_LALR([%pure-parser %locations])
AT_CHECK_CALC_LALR([%verbose])
AT_CHECK_CALC_LALR([%yacc])
AT_CHECK_CALC_LALR([%error-verbose])
AT_CHECK_CALC_LALR([%pure-parser %locations])
AT_CHECK_CALC_GLR([%verbose])
AT_CHECK_CALC_GLR([%yacc])
AT_CHECK_CALC_GLR([%error-verbose])
AT_CHECK_CALC_GLR([%verbose])
AT_CHECK_CALC_GLR([%yacc])
AT_CHECK_CALC_GLR([%error-verbose])
m4_define([AT_CHECK_CALC_GLR_CC],
[AT_CHECK_CALC([%skeleton "glr.cc" %defines %locations] $@)])
m4_define([AT_CHECK_CALC_GLR_CC],
[AT_CHECK_CALC([%skeleton "glr.cc" %defines %locations] $@)])
-#AT_CHECK_CALC_GLR_CC([])
-#AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_GLR_CC([])
+AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix "calc" %verbose %yacc])
-# AT_CHECK_CALC_GLR_CC([%debug])
-#AT_CHECK_CALC_GLR_CC([%error-verbose %debug %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_GLR_CC([%debug])
+AT_CHECK_CALC_GLR_CC([%error-verbose %debug %name-prefix "calc" %verbose %yacc])