mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
global: remove unnecessary horizontal tabs.
This change was made by applying emacs' untabify function to nearly all files in Bison's repository. Required tabs in make files, ChangeLog, regexps, and test code were manually skipped. Other notable exceptions and changes are listed below. * bootstrap: Skip because we sync this with gnulib. * data/m4sugar/foreach.m4 * data/m4sugar/m4sugar.m4: Skip because we sync these with Autoconf. * djgpp: Skip because I don't know how to test djgpp properly, and this code appears to be unmaintained anyway. * README-hacking (Hacking): Specify that tabs should be avoided where not required.
This commit is contained in:
@@ -298,11 +298,11 @@ input:
|
||||
printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
|
||||
}
|
||||
| line input /* Right recursive to load the stack so that popping at
|
||||
END can be exercised. */
|
||||
END can be exercised. */
|
||||
{
|
||||
$$ = 2;
|
||||
printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
|
||||
$$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
|
||||
$$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
|
||||
}
|
||||
;
|
||||
|
||||
@@ -1363,37 +1363,37 @@ AT_DATA([input.y],
|
||||
start: test2 test1 test0 testc;
|
||||
|
||||
test2
|
||||
: 'a' { semi; /* TEST:N:2 */ }
|
||||
| 'b' { if (0) {no_semi} /* TEST:N:2 */ }
|
||||
| 'c' { if (0) {semi;} /* TEST:N:2 */ }
|
||||
| 'd' { semi; no_semi /* TEST:Y:2 */ }
|
||||
| 'e' { semi(); no_semi() /* TEST:Y:2 */ }
|
||||
| 'f' { semi[]; no_semi[] /* TEST:Y:2 */ }
|
||||
| 'g' { semi++; no_semi++ /* TEST:Y:2 */ }
|
||||
| 'h' { {no_semi} no_semi /* TEST:Y:2 */ }
|
||||
| 'i' { {semi;} no_semi /* TEST:Y:2 */ }
|
||||
: 'a' { semi; /* TEST:N:2 */ }
|
||||
| 'b' { if (0) {no_semi} /* TEST:N:2 */ }
|
||||
| 'c' { if (0) {semi;} /* TEST:N:2 */ }
|
||||
| 'd' { semi; no_semi /* TEST:Y:2 */ }
|
||||
| 'e' { semi(); no_semi() /* TEST:Y:2 */ }
|
||||
| 'f' { semi[]; no_semi[] /* TEST:Y:2 */ }
|
||||
| 'g' { semi++; no_semi++ /* TEST:Y:2 */ }
|
||||
| 'h' { {no_semi} no_semi /* TEST:Y:2 */ }
|
||||
| 'i' { {semi;} no_semi /* TEST:Y:2 */ }
|
||||
;
|
||||
test1
|
||||
: 'a' { semi; // TEST:N:1 ;
|
||||
} | 'b' { if (0) {no_semi} // TEST:N:1 ;
|
||||
} | 'c' { if (0) {semi;} // TEST:N:1 ;
|
||||
} | 'd' { semi; no_semi // TEST:Y:1 ;
|
||||
} | 'e' { semi(); no_semi() // TEST:Y:1 ;
|
||||
} | 'f' { semi[]; no_semi[] // TEST:Y:1 ;
|
||||
} | 'g' { semi++; no_semi++ // TEST:Y:1 ;
|
||||
} | 'h' { {no_semi} no_semi // TEST:Y:1 ;
|
||||
} | 'i' { {semi;} no_semi // TEST:Y:1 ;
|
||||
: 'a' { semi; // TEST:N:1 ;
|
||||
} | 'b' { if (0) {no_semi} // TEST:N:1 ;
|
||||
} | 'c' { if (0) {semi;} // TEST:N:1 ;
|
||||
} | 'd' { semi; no_semi // TEST:Y:1 ;
|
||||
} | 'e' { semi(); no_semi() // TEST:Y:1 ;
|
||||
} | 'f' { semi[]; no_semi[] // TEST:Y:1 ;
|
||||
} | 'g' { semi++; no_semi++ // TEST:Y:1 ;
|
||||
} | 'h' { {no_semi} no_semi // TEST:Y:1 ;
|
||||
} | 'i' { {semi;} no_semi // TEST:Y:1 ;
|
||||
} ;
|
||||
test0
|
||||
: 'a' { semi; // TEST:N:1 {}
|
||||
} | 'b' { if (0) {no_semi} // TEST:N:1 {}
|
||||
} | 'c' { if (0) {semi;} // TEST:N:1 {}
|
||||
} | 'd' { semi; no_semi // TEST:Y:1 {}
|
||||
} | 'e' { semi(); no_semi() // TEST:Y:1 {}
|
||||
} | 'f' { semi[]; no_semi[] // TEST:Y:1 {}
|
||||
} | 'g' { semi++; no_semi++ // TEST:Y:1 {}
|
||||
} | 'h' { {no_semi} no_semi // TEST:Y:1 {}
|
||||
} | 'i' { {semi;} no_semi // TEST:Y:1 {}
|
||||
: 'a' { semi; // TEST:N:1 {}
|
||||
} | 'b' { if (0) {no_semi} // TEST:N:1 {}
|
||||
} | 'c' { if (0) {semi;} // TEST:N:1 {}
|
||||
} | 'd' { semi; no_semi // TEST:Y:1 {}
|
||||
} | 'e' { semi(); no_semi() // TEST:Y:1 {}
|
||||
} | 'f' { semi[]; no_semi[] // TEST:Y:1 {}
|
||||
} | 'g' { semi++; no_semi++ // TEST:Y:1 {}
|
||||
} | 'h' { {no_semi} no_semi // TEST:Y:1 {}
|
||||
} | 'i' { {semi;} no_semi // TEST:Y:1 {}
|
||||
} ;
|
||||
|
||||
testc
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# @configure_input@ -*- shell-script -*-
|
||||
# @configure_input@ -*- shell-script -*-
|
||||
# Configurable variable values for Bison test suite.
|
||||
|
||||
# Copyright (C) 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
@@ -211,7 +211,7 @@ m4_define([AT_CHECK_DOXYGEN],
|
||||
[m4_case([$1],
|
||||
[Public], [m4_pushdef([AT_DOXYGEN_PRIVATE], [NO])],
|
||||
[Private], [m4_pushdef([AT_DOXYGEN_PRIVATE], [YES])],
|
||||
[m4_fatal([invalid argument: $1])])
|
||||
[m4_fatal([invalid argument: $1])])
|
||||
AT_SETUP([Doxygen $1 Documentation])
|
||||
|
||||
AT_DATA([input.yy],
|
||||
|
||||
@@ -249,7 +249,7 @@ int yylex (]AT_LEX_FORMALS[);
|
||||
%token <ival> NUM "number"
|
||||
%type <ival> exp
|
||||
|
||||
%nonassoc '=' /* comparison */
|
||||
%nonassoc '=' /* comparison */
|
||||
%left '-' '+'
|
||||
%left '*' '/'
|
||||
%precedence NEG /* negation--unary minus */
|
||||
@@ -332,10 +332,10 @@ AT_YYERROR_SEES_LOC_IF([
|
||||
AT_LOC_FIRST_LINE, AT_LOC_FIRST_COLUMN);
|
||||
if (AT_LOC_FIRST_LINE != AT_LOC_LAST_LINE)
|
||||
fprintf (stderr, "-%d.%d",
|
||||
AT_LOC_LAST_LINE, AT_LOC_LAST_COLUMN - 1);
|
||||
AT_LOC_LAST_LINE, AT_LOC_LAST_COLUMN - 1);
|
||||
else if (AT_LOC_FIRST_COLUMN != AT_LOC_LAST_COLUMN - 1)
|
||||
fprintf (stderr, "-%d",
|
||||
AT_LOC_LAST_COLUMN - 1);
|
||||
AT_LOC_LAST_COLUMN - 1);
|
||||
fprintf (stderr, ": ");])
|
||||
fprintf (stderr, "%s\n", s);
|
||||
}])[
|
||||
|
||||
@@ -92,35 +92,35 @@ $1
|
||||
|
||||
prog :
|
||||
| prog stmt {
|
||||
char *output;]AT_LOCATION_IF([
|
||||
printf ("%d.%d-%d.%d: ",
|
||||
@2.first_line, @2.first_column,
|
||||
@2.last_line, @2.last_column);])[
|
||||
output = node_to_string (]$[2);
|
||||
printf ("%s\n", output);
|
||||
free (output);
|
||||
free_node (]$[2);
|
||||
}
|
||||
char *output;]AT_LOCATION_IF([
|
||||
printf ("%d.%d-%d.%d: ",
|
||||
@2.first_line, @2.first_column,
|
||||
@2.last_line, @2.last_column);])[
|
||||
output = node_to_string (]$[2);
|
||||
printf ("%s\n", output);
|
||||
free (output);
|
||||
free_node (]$[2);
|
||||
}
|
||||
;
|
||||
|
||||
stmt : expr ';' $2 { $$ = ]$[1; }
|
||||
stmt : expr ';' $2 { $$ = ]$[1; }
|
||||
| decl $3
|
||||
| error ';' { $$ = new_nterm ("<error>", 0, 0, 0); }
|
||||
| '@' { YYACCEPT; }
|
||||
| error ';' { $$ = new_nterm ("<error>", 0, 0, 0); }
|
||||
| '@' { YYACCEPT; }
|
||||
;
|
||||
|
||||
expr : ID
|
||||
| TYPENAME '(' expr ')'
|
||||
{ $$ = new_nterm ("<cast>(%s,%s)", ]$[3, ]$[1, 0); }
|
||||
| expr '+' expr { $$ = new_nterm ("+(%s,%s)", ]$[1, ]$[3, 0); }
|
||||
{ $$ = new_nterm ("<cast>(%s,%s)", ]$[3, ]$[1, 0); }
|
||||
| expr '+' expr { $$ = new_nterm ("+(%s,%s)", ]$[1, ]$[3, 0); }
|
||||
| expr '=' expr { $$ = new_nterm ("=(%s,%s)", ]$[1, ]$[3, 0); }
|
||||
;
|
||||
|
||||
decl : TYPENAME declarator ';'
|
||||
{ $$ = new_nterm ("<declare>(%s,%s)", ]$[1, ]$[2, 0); }
|
||||
{ $$ = new_nterm ("<declare>(%s,%s)", ]$[1, ]$[2, 0); }
|
||||
| TYPENAME declarator '=' expr ';'
|
||||
{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", ]$[1,
|
||||
]$[2, ]$[4); }
|
||||
{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", ]$[1,
|
||||
]$[2, ]$[4); }
|
||||
;
|
||||
|
||||
declarator : ID
|
||||
@@ -163,60 +163,60 @@ yylex (LEX_PARAMETERS)
|
||||
while (1)
|
||||
{
|
||||
if (feof (stdin))
|
||||
abort ();
|
||||
abort ();
|
||||
c = getchar ();
|
||||
switch (c)
|
||||
{
|
||||
case EOF:
|
||||
return 0;
|
||||
case '\t':
|
||||
colNum = (colNum + 7) & ~7;
|
||||
break;
|
||||
case ' ': case '\f':
|
||||
colNum += 1;
|
||||
break;
|
||||
case '\n':
|
||||
lineNum += 1;
|
||||
colNum = 0;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
int tok;
|
||||
{
|
||||
case EOF:
|
||||
return 0;
|
||||
case '\t':
|
||||
colNum = (colNum + 7) & ~7;
|
||||
break;
|
||||
case ' ': case '\f':
|
||||
colNum += 1;
|
||||
break;
|
||||
case '\n':
|
||||
lineNum += 1;
|
||||
colNum = 0;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
int tok;
|
||||
#if YYLSP_NEEDED
|
||||
yylloc.first_line = yylloc.last_line = lineNum;
|
||||
yylloc.first_column = colNum;
|
||||
yylloc.first_line = yylloc.last_line = lineNum;
|
||||
yylloc.first_column = colNum;
|
||||
#endif
|
||||
if (isalpha (c))
|
||||
{
|
||||
i = 0;
|
||||
if (isalpha (c))
|
||||
{
|
||||
i = 0;
|
||||
|
||||
do
|
||||
{
|
||||
buffer[i++] = c;
|
||||
colNum += 1;
|
||||
if (i == sizeof buffer - 1)
|
||||
abort ();
|
||||
c = getchar ();
|
||||
}
|
||||
while (isalnum (c) || c == '_');
|
||||
do
|
||||
{
|
||||
buffer[i++] = c;
|
||||
colNum += 1;
|
||||
if (i == sizeof buffer - 1)
|
||||
abort ();
|
||||
c = getchar ();
|
||||
}
|
||||
while (isalnum (c) || c == '_');
|
||||
|
||||
ungetc (c, stdin);
|
||||
buffer[i++] = 0;
|
||||
tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
|
||||
yylval = new_term (strcpy ((char *) malloc (i), buffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
colNum += 1;
|
||||
tok = c;
|
||||
yylval = 0;
|
||||
}
|
||||
ungetc (c, stdin);
|
||||
buffer[i++] = 0;
|
||||
tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
|
||||
yylval = new_term (strcpy ((char *) malloc (i), buffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
colNum += 1;
|
||||
tok = c;
|
||||
yylval = 0;
|
||||
}
|
||||
#if YYLSP_NEEDED
|
||||
yylloc.last_column = colNum-1;
|
||||
yylloc.last_column = colNum-1;
|
||||
#endif
|
||||
return tok;
|
||||
}
|
||||
}
|
||||
return tok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ node_to_string (Node *node)
|
||||
child1 = node_to_string (node->nterm.children[1]);
|
||||
child2 = node_to_string (node->nterm.children[2]);
|
||||
buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
|
||||
+ strlen (child1) + strlen (child2) + 1);
|
||||
+ strlen (child1) + strlen (child2) + 1);
|
||||
sprintf (buffer, node->nterm.form, child0, child1, child2);
|
||||
free (child0);
|
||||
free (child1);
|
||||
@@ -412,61 +412,61 @@ m4_define([_AT_VERBOSE_GLR_STDERR],
|
||||
|
||||
AT_SETUP([GLR: Resolve ambiguity, impure, no locations])
|
||||
_AT_TEST_GLR_CXXTYPES([],
|
||||
[%dprec 1], [%dprec 2])
|
||||
[%dprec 1], [%dprec 2])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
_AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Resolve ambiguity, impure, locations])
|
||||
_AT_TEST_GLR_CXXTYPES([%locations],[%dprec 1],[%dprec 2])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||
_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Resolve ambiguity, pure, no locations])
|
||||
_AT_TEST_GLR_CXXTYPES([%define api.pure],
|
||||
[%dprec 1], [%dprec 2])
|
||||
[%dprec 1], [%dprec 2])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
_AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Resolve ambiguity, pure, locations])
|
||||
_AT_TEST_GLR_CXXTYPES([%define api.pure %locations],
|
||||
[%dprec 1], [%dprec 2])
|
||||
[%dprec 1], [%dprec 2])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||
_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Merge conflicting parses, impure, no locations])
|
||||
_AT_TEST_GLR_CXXTYPES([],
|
||||
[%merge <stmtMerge>], [%merge <stmtMerge>])
|
||||
[%merge <stmtMerge>], [%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Merge conflicting parses, impure, locations])
|
||||
_AT_TEST_GLR_CXXTYPES([%locations],
|
||||
[%merge <stmtMerge>], [%merge <stmtMerge>])
|
||||
[%merge <stmtMerge>], [%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Merge conflicting parses, pure, no locations])
|
||||
_AT_TEST_GLR_CXXTYPES([%define api.pure],
|
||||
[%merge <stmtMerge>], [%merge <stmtMerge>])
|
||||
[%merge <stmtMerge>], [%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
AT_SETUP([GLR: Merge conflicting parses, pure, locations])
|
||||
_AT_TEST_GLR_CXXTYPES([%define api.pure %locations],
|
||||
[%merge <stmtMerge>],[%merge <stmtMerge>])
|
||||
[%merge <stmtMerge>],[%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Verbose messages, resolve ambiguity, impure, no locations])
|
||||
_AT_TEST_GLR_CXXTYPES([%error-verbose],
|
||||
[%merge <stmtMerge>], [%merge <stmtMerge>])
|
||||
[%merge <stmtMerge>], [%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input]], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_VERBOSE_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_VERBOSE_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
1954
tests/existing.at
1954
tests/existing.at
File diff suppressed because it is too large
Load Diff
@@ -85,12 +85,12 @@ yylex (void)
|
||||
{
|
||||
int ch;
|
||||
if (feof (stdin))
|
||||
abort ();
|
||||
abort ();
|
||||
ch = getchar ();
|
||||
if (ch == EOF)
|
||||
return 0;
|
||||
return 0;
|
||||
else if (ch == 'B' || ch == 'P')
|
||||
return ch;
|
||||
return ch;
|
||||
}
|
||||
}
|
||||
]])
|
||||
@@ -341,7 +341,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Duplicate representation of merged trees. See ##
|
||||
## Duplicate representation of merged trees. See ##
|
||||
## <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
@@ -444,7 +444,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## -------------------------------------------------------------------------- ##
|
||||
## User destructor for unresolved GLR semantic value. See ##
|
||||
## User destructor for unresolved GLR semantic value. See ##
|
||||
## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html>. ##
|
||||
## -------------------------------------------------------------------------- ##
|
||||
|
||||
@@ -517,7 +517,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## -------------------------------------------------------------------------- ##
|
||||
## User destructor after an error during a split parse. See ##
|
||||
## User destructor after an error during a split parse. See ##
|
||||
## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html>. ##
|
||||
## -------------------------------------------------------------------------- ##
|
||||
|
||||
@@ -584,7 +584,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Duplicated user destructor for lookahead. See ##
|
||||
## Duplicated user destructor for lookahead. See ##
|
||||
## <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00035.html>. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
@@ -675,7 +675,7 @@ AT_CLEANUP
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Incorrect default location for empty right-hand sides. Adapted from bug ##
|
||||
## report by Claudia Hermann. ##
|
||||
## report by Claudia Hermann. ##
|
||||
## See http://lists.gnu.org/archive/html/bug-bison/2005-10/msg00069.html and ##
|
||||
## http://lists.gnu.org/archive/html/bug-bison/2005-10/msg00072.html ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
@@ -701,25 +701,25 @@ AT_DATA_GRAMMAR([glr-regr8.y],
|
||||
%%
|
||||
|
||||
|
||||
PortClause : T_PORT InterfaceDeclaration T_PORT
|
||||
{ printf("%d/%d - %d/%d - %d/%d\n",
|
||||
@1.first_column, @1.last_column,
|
||||
@2.first_column, @2.last_column,
|
||||
@3.first_column, @3.last_column); }
|
||||
;
|
||||
PortClause : T_PORT InterfaceDeclaration T_PORT
|
||||
{ printf("%d/%d - %d/%d - %d/%d\n",
|
||||
@1.first_column, @1.last_column,
|
||||
@2.first_column, @2.last_column,
|
||||
@3.first_column, @3.last_column); }
|
||||
;
|
||||
|
||||
InterfaceDeclaration : OptConstantWord %dprec 1
|
||||
| OptSignalWord %dprec 2
|
||||
;
|
||||
InterfaceDeclaration : OptConstantWord %dprec 1
|
||||
| OptSignalWord %dprec 2
|
||||
;
|
||||
|
||||
OptConstantWord : /* empty */
|
||||
| T_CONSTANT
|
||||
;
|
||||
OptConstantWord : /* empty */
|
||||
| T_CONSTANT
|
||||
;
|
||||
|
||||
OptSignalWord : /* empty */
|
||||
{ printf("empty: %d/%d\n", @$.first_column, @$.last_column); }
|
||||
| T_SIGNAL
|
||||
;
|
||||
OptSignalWord : /* empty */
|
||||
{ printf("empty: %d/%d\n", @$.first_column, @$.last_column); }
|
||||
| T_SIGNAL
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
@@ -774,7 +774,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## No users destructors if stack 0 deleted. See ##
|
||||
## No users destructors if stack 0 deleted. See ##
|
||||
## <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00109.html>. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
@@ -855,7 +855,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Corrupted semantic options if user action cuts parse. ##
|
||||
## Corrupted semantic options if user action cuts parse. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
AT_SETUP([Corrupted semantic options if user action cuts parse])
|
||||
@@ -920,7 +920,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Undesirable destructors if user action cuts parse. ##
|
||||
## Undesirable destructors if user action cuts parse. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
AT_SETUP([Undesirable destructors if user action cuts parse])
|
||||
@@ -989,7 +989,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Leaked semantic values if user action cuts parse. ##
|
||||
## Leaked semantic values if user action cuts parse. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
AT_SETUP([Leaked semantic values if user action cuts parse])
|
||||
@@ -1120,7 +1120,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Incorrect lookahead during deterministic GLR. See ##
|
||||
## Incorrect lookahead during deterministic GLR. See ##
|
||||
## <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00017.html> and ##
|
||||
## <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00060.html>. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
@@ -1221,10 +1221,10 @@ print_lookahead (char const *reduction)
|
||||
{
|
||||
printf ("'%c', yylval='", yychar);
|
||||
if (yylval.value > ' ')
|
||||
printf ("%c", yylval.value);
|
||||
printf ("%c", yylval.value);
|
||||
printf ("', yylloc=(%d,%d),(%d,%d)",
|
||||
yylloc.first_line, yylloc.first_column,
|
||||
yylloc.last_line, yylloc.last_column);
|
||||
yylloc.first_line, yylloc.first_column,
|
||||
yylloc.last_line, yylloc.last_column);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
@@ -1258,7 +1258,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Incorrect lookahead during nondeterministic GLR. ##
|
||||
## Incorrect lookahead during nondeterministic GLR. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
AT_SETUP([Incorrect lookahead during nondeterministic GLR])
|
||||
@@ -1318,7 +1318,7 @@ merge:
|
||||
| conflict defstate_look 'a' nonconflict2 'b' defstate_shift %dprec 2 {
|
||||
USE ($3); USE ($5);
|
||||
print_lookahead ("merge <- conflict defstate_look 'a' nonconflict2 'b'"
|
||||
" defstate_shift");
|
||||
" defstate_shift");
|
||||
}
|
||||
;
|
||||
|
||||
@@ -1365,7 +1365,7 @@ alt1:
|
||||
USE ($1);
|
||||
if (yychar != 'd' && yychar != YYEOF)
|
||||
{
|
||||
fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
|
||||
fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
|
||||
}
|
||||
}
|
||||
;
|
||||
@@ -1374,7 +1374,7 @@ alt2:
|
||||
USE ($1);
|
||||
if (yychar != 'd' && yychar != YYEOF)
|
||||
{
|
||||
fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
|
||||
fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
|
||||
}
|
||||
}
|
||||
;
|
||||
@@ -1383,7 +1383,7 @@ alt3:
|
||||
USE ($1);
|
||||
if (yychar != 'd' && yychar != YYEOF)
|
||||
{
|
||||
fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
|
||||
fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
|
||||
}
|
||||
}
|
||||
;
|
||||
@@ -1391,8 +1391,8 @@ no_look:
|
||||
{
|
||||
if (yychar != YYEMPTY)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"Found lookahead where shouldn't during stack explosion.\n");
|
||||
fprintf (stderr,
|
||||
"Found lookahead where shouldn't during stack explosion.\n");
|
||||
}
|
||||
}
|
||||
;
|
||||
@@ -1430,10 +1430,10 @@ print_lookahead (char const *reduction)
|
||||
{
|
||||
printf ("'%c', yylval='", yychar);
|
||||
if (yylval.value > ' ')
|
||||
printf ("%c", yylval.value);
|
||||
printf ("%c", yylval.value);
|
||||
printf ("', yylloc=(%d,%d),(%d,%d)",
|
||||
yylloc.first_line, yylloc.first_column,
|
||||
yylloc.last_line, yylloc.last_column);
|
||||
yylloc.first_line, yylloc.first_column,
|
||||
yylloc.last_line, yylloc.last_column);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
@@ -1478,7 +1478,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Leaked semantic values when reporting ambiguity. ##
|
||||
## Leaked semantic values when reporting ambiguity. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
AT_SETUP([Leaked semantic values when reporting ambiguity])
|
||||
@@ -1571,7 +1571,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Leaked lookahead after nondeterministic parse syntax error. ##
|
||||
## Leaked lookahead after nondeterministic parse syntax error. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
AT_SETUP([Leaked lookahead after nondeterministic parse syntax error])
|
||||
@@ -1640,7 +1640,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------------------------- ##
|
||||
## Uninitialized location when reporting ambiguity. ##
|
||||
## Uninitialized location when reporting ambiguity. ##
|
||||
## ------------------------------------------------------------------------- ##
|
||||
|
||||
AT_SETUP([Uninitialized location when reporting ambiguity])
|
||||
@@ -1690,7 +1690,7 @@ static void
|
||||
yyerror (YYLTYPE *locp, char const *msg)
|
||||
{
|
||||
fprintf (stderr, "Error at %d.%d-%d.%d: %s.\n", locp->first_line,
|
||||
locp->first_column, locp->last_line, locp->last_column, msg);
|
||||
locp->first_column, locp->last_line, locp->last_column, msg);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -418,8 +418,8 @@ AT_JAVA_COMPILE([[YYParser.java]])
|
||||
|
||||
|
||||
# AT_CHECK_JAVA_MINIMAL_W_LEXER([1:DIRECTIVES], [2:LEX_THROWS],
|
||||
# [3:YYLEX_ACTION], [4:LEXER_BODY], [5:PARSER_ACTION], [6:STYPE],
|
||||
# [7:POSITION_TYPE], [8:LOCATION_TYPE])
|
||||
# [3:YYLEX_ACTION], [4:LEXER_BODY], [5:PARSER_ACTION], [6:STYPE],
|
||||
# [7:POSITION_TYPE], [8:LOCATION_TYPE])
|
||||
# ---------------------------------------------------------------------
|
||||
# Check that a mininal parser with DIRECTIVES and a "%code lexer".
|
||||
# YYLEX is the body of yylex () which throws LEX_THROW.
|
||||
@@ -454,7 +454,7 @@ m4_define([AT_CHECK_JAVA_MINIMAL_W_LEXER],
|
||||
# Check that YYParser.java contains exactly COUNT lines matching ^LINE$
|
||||
# with grep.
|
||||
m4_define([AT_CHECK_JAVA_GREP],
|
||||
[AT_CHECK([grep -c '^$1$' YYParser.java], [], [m4_default([$2], [1])
|
||||
[AT_CHECK([grep -c '^$1$' YYParser.java], [], [m4_default([$2], [1])
|
||||
])
|
||||
])
|
||||
|
||||
@@ -647,74 +647,74 @@ AT_CLEANUP
|
||||
|
||||
AT_SETUP([Java throws specifications])
|
||||
|
||||
# %define throws - 0 1 2
|
||||
# %define lex-throws - 0 1 2
|
||||
# %code lexer 0 1
|
||||
# %define throws - 0 1 2
|
||||
# %define lex-throws - 0 1 2
|
||||
# %code lexer 0 1
|
||||
|
||||
m4_define([AT_JT_lex_throws_define], [m4_case(AT_JT_lex_throws,
|
||||
-1, [],
|
||||
0, [[%define lex_throws ""]],
|
||||
1, [[%define lex_throws "InterruptedException"]],
|
||||
2, [[%define lex_throws "InterruptedException, IllegalAccessException"]])])
|
||||
-1, [],
|
||||
0, [[%define lex_throws ""]],
|
||||
1, [[%define lex_throws "InterruptedException"]],
|
||||
2, [[%define lex_throws "InterruptedException, IllegalAccessException"]])])
|
||||
|
||||
m4_define([AT_JT_yylex_throws], [m4_case(AT_JT_lex_throws,
|
||||
-1, [[ throws java.io.IOException]],
|
||||
0, [],
|
||||
1, [[ throws InterruptedException]],
|
||||
2, [[ throws InterruptedException, IllegalAccessException]])])
|
||||
-1, [[ throws java.io.IOException]],
|
||||
0, [],
|
||||
1, [[ throws InterruptedException]],
|
||||
2, [[ throws InterruptedException, IllegalAccessException]])])
|
||||
|
||||
m4_define([AT_JT_yylex_action], [m4_case(AT_JT_lex_throws,
|
||||
-1, [[throw new java.io.IOException();]],
|
||||
0, [[return EOF;]],
|
||||
1, [[throw new InterruptedException();]],
|
||||
2, [[throw new IllegalAccessException();]])])
|
||||
-1, [[throw new java.io.IOException();]],
|
||||
0, [[return EOF;]],
|
||||
1, [[throw new InterruptedException();]],
|
||||
2, [[throw new IllegalAccessException();]])])
|
||||
|
||||
|
||||
m4_define([AT_JT_throws_define], [m4_case(AT_JT_throws,
|
||||
-1, [],
|
||||
0, [[%define throws ""]],
|
||||
1, [[%define throws "ClassNotFoundException"]],
|
||||
2, [[%define throws "ClassNotFoundException, InstantiationException"]])])
|
||||
-1, [],
|
||||
0, [[%define throws ""]],
|
||||
1, [[%define throws "ClassNotFoundException"]],
|
||||
2, [[%define throws "ClassNotFoundException, InstantiationException"]])])
|
||||
|
||||
m4_define([AT_JT_yyaction_throws], [m4_case(AT_JT_throws,
|
||||
-1, [],
|
||||
0, [],
|
||||
1, [[ throws ClassNotFoundException]],
|
||||
2, [[ throws ClassNotFoundException, InstantiationException]])])
|
||||
-1, [],
|
||||
0, [],
|
||||
1, [[ throws ClassNotFoundException]],
|
||||
2, [[ throws ClassNotFoundException, InstantiationException]])])
|
||||
|
||||
m4_define([AT_JT_parse_throws_2], [m4_case(AT_JT_throws,
|
||||
-1, [],
|
||||
0, [],
|
||||
1, [[, ClassNotFoundException]],
|
||||
2, [[, ClassNotFoundException, InstantiationException]])])
|
||||
-1, [],
|
||||
0, [],
|
||||
1, [[, ClassNotFoundException]],
|
||||
2, [[, ClassNotFoundException, InstantiationException]])])
|
||||
|
||||
m4_define([AT_JT_parse_throws],
|
||||
[m4_if(m4_quote(AT_JT_yylex_throws), [],
|
||||
[AT_JT_yyaction_throws],
|
||||
[AT_JT_yylex_throws[]AT_JT_parse_throws_2])])
|
||||
[m4_if(m4_quote(AT_JT_yylex_throws), [],
|
||||
[AT_JT_yyaction_throws],
|
||||
[AT_JT_yylex_throws[]AT_JT_parse_throws_2])])
|
||||
|
||||
m4_define([AT_JT_initial_action], [m4_case(AT_JT_throws,
|
||||
-1, [],
|
||||
0, [],
|
||||
1, [[%initial-action {if (true) throw new ClassNotFoundException();}]],
|
||||
2, [[%initial-action {if (true) throw new InstantiationException();}]])])
|
||||
-1, [],
|
||||
0, [],
|
||||
1, [[%initial-action {if (true) throw new ClassNotFoundException();}]],
|
||||
2, [[%initial-action {if (true) throw new InstantiationException();}]])])
|
||||
|
||||
m4_define([AT_JT_parse_action], [m4_case(AT_JT_throws,
|
||||
-1, [],
|
||||
0, [],
|
||||
1, [[throw new ClassNotFoundException();]],
|
||||
2, [[throw new ClassNotFoundException();]])])
|
||||
-1, [],
|
||||
0, [],
|
||||
1, [[throw new ClassNotFoundException();]],
|
||||
2, [[throw new ClassNotFoundException();]])])
|
||||
|
||||
m4_for([AT_JT_lexer], 0, 1, 1,
|
||||
[m4_for([AT_JT_lex_throws], -1, 2, 1,
|
||||
[m4_for([AT_JT_throws], -1, 2, 1,
|
||||
[m4_if(AT_JT_lexer, 0,
|
||||
[AT_CHECK_JAVA_MINIMAL([
|
||||
[AT_CHECK_JAVA_MINIMAL([
|
||||
AT_JT_throws_define
|
||||
AT_JT_lex_throws_define
|
||||
AT_JT_initial_action],
|
||||
[AT_JT_parse_action])],
|
||||
[AT_CHECK_JAVA_MINIMAL_W_LEXER([
|
||||
[AT_CHECK_JAVA_MINIMAL_W_LEXER([
|
||||
AT_JT_throws_define
|
||||
AT_JT_lex_throws_define
|
||||
AT_JT_initial_action],
|
||||
|
||||
@@ -116,34 +116,34 @@ m4_pushdef([AT_TOKEN_PREFIX],
|
||||
# yyerror receives the location if %location & %pure & (%glr or %parse-param).
|
||||
m4_pushdef([AT_YYERROR_ARG_LOC_IF],
|
||||
[AT_GLR_OR_PARAM_IF([AT_PURE_AND_LOC_IF([$1], [$2])],
|
||||
[$2])])
|
||||
[$2])])
|
||||
# yyerror always sees the locations (when activated), except if
|
||||
# (yacc & pure & !param). FIXME: This is wrong. See the manual.
|
||||
m4_pushdef([AT_YYERROR_SEES_LOC_IF],
|
||||
[AT_LOCATION_IF([AT_YACC_IF([AT_PURE_IF([AT_PARAM_IF([$1], [$2])],
|
||||
[$1])],
|
||||
[$1])],
|
||||
[$2])])
|
||||
[$1])],
|
||||
[$1])],
|
||||
[$2])])
|
||||
|
||||
# The interface is pure: either because %define api.pure, or because we
|
||||
# are using the C++ parsers.
|
||||
m4_pushdef([AT_PURE_LEX_IF],
|
||||
[AT_PURE_IF([$1],
|
||||
[AT_SKEL_CC_IF([$1], [$2])])])
|
||||
[AT_SKEL_CC_IF([$1], [$2])])])
|
||||
|
||||
AT_PURE_LEX_IF(
|
||||
[m4_pushdef([AT_LOC], [(*llocp)])
|
||||
m4_pushdef([AT_VAL], [(*lvalp)])
|
||||
m4_pushdef([AT_LEX_FORMALS],
|
||||
[YYSTYPE *lvalp[]AT_LOCATION_IF([, YYLTYPE *llocp])])
|
||||
[YYSTYPE *lvalp[]AT_LOCATION_IF([, YYLTYPE *llocp])])
|
||||
m4_pushdef([AT_LEX_ARGS],
|
||||
[lvalp[]AT_LOCATION_IF([, llocp])])
|
||||
[lvalp[]AT_LOCATION_IF([, llocp])])
|
||||
m4_pushdef([AT_USE_LEX_ARGS],
|
||||
[(void) lvalp;AT_LOCATION_IF([(void) llocp])])
|
||||
[(void) lvalp;AT_LOCATION_IF([(void) llocp])])
|
||||
m4_pushdef([AT_LEX_PRE_FORMALS],
|
||||
[AT_LEX_FORMALS, ])
|
||||
[AT_LEX_FORMALS, ])
|
||||
m4_pushdef([AT_LEX_PRE_ARGS],
|
||||
[AT_LEX_ARGS, ])
|
||||
[AT_LEX_ARGS, ])
|
||||
],
|
||||
[m4_pushdef([AT_LOC], [[(]AT_NAME_PREFIX[lloc)]])
|
||||
m4_pushdef([AT_VAL], [[(]AT_NAME_PREFIX[lval)]])
|
||||
@@ -417,7 +417,7 @@ m4_define([AT_QUELL_VALGRIND],
|
||||
# assume that we are linking too; this is a hack.
|
||||
m4_define([AT_COMPILE],
|
||||
[AT_CHECK([$CC $CFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1 m4_default([$2], [$1.c])[]m4_bmatch([$1], [[.]], [], [ $LIBS])],
|
||||
0, [ignore], [ignore])])
|
||||
0, [ignore], [ignore])])
|
||||
|
||||
# AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.cc])
|
||||
# --------------------------------------------
|
||||
@@ -428,7 +428,7 @@ m4_define([AT_COMPILE_CXX],
|
||||
[AT_KEYWORDS(c++)
|
||||
AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore)
|
||||
AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1 m4_default([$2], [$1.cc])[]m4_bmatch([$1], [[.]], [], [ $LIBS])],
|
||||
0, [ignore], [ignore])])
|
||||
0, [ignore], [ignore])])
|
||||
|
||||
# AT_JAVA_COMPILE(SOURCES)
|
||||
# ------------------------
|
||||
|
||||
@@ -40,27 +40,27 @@ $(top_srcdir)/tests/package.m4: $(top_srcdir)/configure
|
||||
## Test suite. ##
|
||||
## ------------ ##
|
||||
|
||||
TESTSUITE_AT = \
|
||||
tests/actions.at \
|
||||
tests/c++.at \
|
||||
tests/calc.at \
|
||||
tests/conflicts.at \
|
||||
tests/cxx-type.at \
|
||||
tests/existing.at \
|
||||
tests/glr-regression.at \
|
||||
tests/headers.at \
|
||||
tests/input.at \
|
||||
tests/java.at \
|
||||
tests/local.at \
|
||||
tests/named-refs.at \
|
||||
tests/output.at \
|
||||
tests/push.at \
|
||||
tests/reduce.at \
|
||||
tests/regression.at \
|
||||
tests/sets.at \
|
||||
tests/skeletons.at \
|
||||
tests/synclines.at \
|
||||
tests/testsuite.at \
|
||||
TESTSUITE_AT = \
|
||||
tests/actions.at \
|
||||
tests/c++.at \
|
||||
tests/calc.at \
|
||||
tests/conflicts.at \
|
||||
tests/cxx-type.at \
|
||||
tests/existing.at \
|
||||
tests/glr-regression.at \
|
||||
tests/headers.at \
|
||||
tests/input.at \
|
||||
tests/java.at \
|
||||
tests/local.at \
|
||||
tests/named-refs.at \
|
||||
tests/output.at \
|
||||
tests/push.at \
|
||||
tests/reduce.at \
|
||||
tests/regression.at \
|
||||
tests/sets.at \
|
||||
tests/skeletons.at \
|
||||
tests/synclines.at \
|
||||
tests/testsuite.at \
|
||||
tests/torture.at
|
||||
|
||||
TESTSUITE = $(top_srcdir)/tests/testsuite
|
||||
|
||||
@@ -44,7 +44,7 @@ int yylex (void);
|
||||
%token <ival> NUM "number"
|
||||
%type <ival> exp
|
||||
|
||||
%nonassoc '=' /* comparison */
|
||||
%nonassoc '=' /* comparison */
|
||||
%left '-' '+'
|
||||
%left '*' '/'
|
||||
%precedence NEG /* negation--unary minus */
|
||||
@@ -215,7 +215,7 @@ int yylex (void);
|
||||
%token <ival> NUM "number"
|
||||
%type <ival> exp
|
||||
|
||||
%nonassoc '=' /* comparison */
|
||||
%nonassoc '=' /* comparison */
|
||||
%left '-' '+'
|
||||
%left '*' '/'
|
||||
%precedence NEG /* negation--unary minus */
|
||||
|
||||
@@ -42,65 +42,65 @@ AT_CLEANUP
|
||||
])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.y], [], [-dv],
|
||||
[foo.output foo.tab.c foo.tab.h])
|
||||
[foo.output foo.tab.c foo.tab.h])
|
||||
|
||||
# Some versions of Valgrind (at least valgrind-3.6.0.SVN-Debian) report
|
||||
# "fgrep: write error: Bad file descriptor" when stdout is closed, so we
|
||||
# skip this test group during maintainer-check-valgrind.
|
||||
AT_CHECK_OUTPUT([foo.y], [], [-dv],
|
||||
[foo.output foo.tab.c foo.tab.h],
|
||||
[>&-], [],
|
||||
[AT_CHECK([[case "$PREBISON" in *valgrind*) exit 77;; esac]])])
|
||||
[foo.output foo.tab.c foo.tab.h],
|
||||
[>&-], [],
|
||||
[AT_CHECK([[case "$PREBISON" in *valgrind*) exit 77;; esac]])])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.y], [], [-dv -o foo.c],
|
||||
[foo.c foo.h foo.output])
|
||||
[foo.c foo.h foo.output])
|
||||
AT_CHECK_OUTPUT([foo.y], [], [-dv -o foo.tab.c],
|
||||
[foo.output foo.tab.c foo.tab.h])
|
||||
[foo.output foo.tab.c foo.tab.h])
|
||||
AT_CHECK_OUTPUT([foo.y], [], [-dv -y],
|
||||
[y.output y.tab.c y.tab.h])
|
||||
[y.output y.tab.c y.tab.h])
|
||||
AT_CHECK_OUTPUT([foo.y], [], [-dv -b bar],
|
||||
[bar.output bar.tab.c bar.tab.h])
|
||||
[bar.output bar.tab.c bar.tab.h])
|
||||
AT_CHECK_OUTPUT([foo.y], [], [-dv -g -o foo.c],
|
||||
[foo.c foo.dot foo.h foo.output])
|
||||
[foo.c foo.dot foo.h foo.output])
|
||||
|
||||
|
||||
AT_CHECK_OUTPUT([foo.y], [%defines %verbose], [],
|
||||
[foo.output foo.tab.c foo.tab.h])
|
||||
[foo.output foo.tab.c foo.tab.h])
|
||||
AT_CHECK_OUTPUT([foo.y], [%defines %verbose %yacc],[],
|
||||
[y.output y.tab.c y.tab.h])
|
||||
[y.output y.tab.c y.tab.h])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy], [%defines %verbose %yacc],[],
|
||||
[y.output y.tab.c y.tab.h])
|
||||
[y.output y.tab.c y.tab.h])
|
||||
|
||||
# Exercise %output and %file-prefix including deprecated `='
|
||||
AT_CHECK_OUTPUT([foo.y], [%file-prefix "bar" %defines %verbose], [],
|
||||
[bar.output bar.tab.c bar.tab.h])
|
||||
[bar.output bar.tab.c bar.tab.h])
|
||||
AT_CHECK_OUTPUT([foo.y], [%output="bar.c" %defines %verbose %yacc],[],
|
||||
[bar.output bar.c bar.h])
|
||||
[bar.output bar.c bar.h])
|
||||
AT_CHECK_OUTPUT([foo.y],
|
||||
[%file-prefix="baz" %output "bar.c" %defines %verbose %yacc],
|
||||
[],
|
||||
[bar.output bar.c bar.h])
|
||||
[%file-prefix="baz" %output "bar.c" %defines %verbose %yacc],
|
||||
[],
|
||||
[bar.output bar.c bar.h])
|
||||
|
||||
|
||||
# Check priorities of extension control.
|
||||
AT_CHECK_OUTPUT([foo.yy], [%defines %verbose], [],
|
||||
[foo.output foo.tab.cc foo.tab.hh])
|
||||
[foo.output foo.tab.cc foo.tab.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy], [%defines %verbose ], [-o foo.c],
|
||||
[foo.c foo.h foo.output])
|
||||
[foo.c foo.h foo.output])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy], [],
|
||||
[--defines=foo.hpp -o foo.c++],
|
||||
[foo.c++ foo.hpp])
|
||||
[--defines=foo.hpp -o foo.c++],
|
||||
[foo.c++ foo.hpp])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy], [%defines "foo.hpp"],
|
||||
[-o foo.c++],
|
||||
[foo.c++ foo.hpp])
|
||||
[-o foo.c++],
|
||||
[foo.c++ foo.hpp])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy], [],
|
||||
[-o foo.c++ --graph=foo.gph],
|
||||
[foo.c++ foo.gph])
|
||||
[-o foo.c++ --graph=foo.gph],
|
||||
[foo.c++ foo.gph])
|
||||
|
||||
|
||||
## ------------ ##
|
||||
@@ -114,29 +114,29 @@ AT_CHECK([grep 'include .subdir/' $1.hh], 1, [])
|
||||
])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy], [%skeleton "lalr1.cc" %defines %verbose], [],
|
||||
[foo.tab.cc foo.tab.hh foo.output stack.hh])
|
||||
[foo.tab.cc foo.tab.hh foo.output stack.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy], [%skeleton "lalr1.cc" %defines %verbose %locations], [],
|
||||
[foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh])
|
||||
[foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([subdir/foo.yy], [%skeleton "lalr1.cc" %defines %verbose], [],
|
||||
[foo.tab.cc foo.tab.hh foo.output stack.hh],
|
||||
[], [AT_CHECK_NO_SUBDIR_PART([foo.tab])])
|
||||
[foo.tab.cc foo.tab.hh foo.output stack.hh],
|
||||
[], [AT_CHECK_NO_SUBDIR_PART([foo.tab])])
|
||||
|
||||
AT_CHECK_OUTPUT([subdir/foo.yy], [%skeleton "lalr1.cc" %defines %verbose %locations],
|
||||
[-o subdir/foo.cc],
|
||||
[subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh],
|
||||
[], [AT_CHECK_NO_SUBDIR_PART([subdir/foo])])
|
||||
[-o subdir/foo.cc],
|
||||
[subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh],
|
||||
[], [AT_CHECK_NO_SUBDIR_PART([subdir/foo])])
|
||||
|
||||
AT_CHECK_OUTPUT([gram_dir/foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo"],
|
||||
[],
|
||||
[output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/stack.hh])
|
||||
[output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/stack.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([gram_dir/foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %locations %verbose %file-prefix "output_dir/foo"],
|
||||
[],
|
||||
[output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh])
|
||||
[output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh])
|
||||
|
||||
|
||||
# AT_CHECK_CONFLICTING_OUTPUT(INPUT-FILE, DIRECTIVES, FLAGS, STDERR,
|
||||
|
||||
@@ -532,7 +532,7 @@ AT_SETUP([Web2c Report])
|
||||
AT_KEYWORDS([report])
|
||||
|
||||
AT_DATA([input.y],
|
||||
[[%token undef_id_tok const_id_tok
|
||||
[[%token undef_id_tok const_id_tok
|
||||
|
||||
%start CONST_DEC_PART
|
||||
|
||||
@@ -542,12 +542,12 @@ CONST_DEC_PART:
|
||||
;
|
||||
|
||||
CONST_DEC_LIST:
|
||||
CONST_DEC
|
||||
CONST_DEC
|
||||
| CONST_DEC_LIST CONST_DEC
|
||||
;
|
||||
|
||||
CONST_DEC:
|
||||
{ } undef_id_tok '=' const_id_tok ';'
|
||||
{ } undef_id_tok '=' const_id_tok ';'
|
||||
;
|
||||
%%
|
||||
]])
|
||||
@@ -1062,7 +1062,7 @@ static int yylex (void);
|
||||
start:
|
||||
{
|
||||
printf ("Bison would once convert this action to a midrule because of the"
|
||||
" subsequent braced code.\n");
|
||||
" subsequent braced code.\n");
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
@@ -288,15 +288,15 @@ mv stdout expout
|
||||
# Get the final state in the report, from the "accept" action..
|
||||
AT_CHECK([sed -n '
|
||||
/^state \(.*\)/{
|
||||
s//final state \1/
|
||||
x
|
||||
}
|
||||
/ accept/{
|
||||
x
|
||||
p
|
||||
q
|
||||
}
|
||||
' input.output],
|
||||
0, [expout])
|
||||
s//final state \1/
|
||||
x
|
||||
}
|
||||
/ accept/{
|
||||
x
|
||||
p
|
||||
q
|
||||
}
|
||||
' input.output],
|
||||
0, [expout])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Test suite for GNU Bison. -*- Autotest -*-
|
||||
# Test suite for GNU Bison. -*- Autotest -*-
|
||||
|
||||
# Copyright (C) 2000-2004, 2006-2007, 2009-2011 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
@@ -89,9 +89,9 @@ for my $size (1 .. $max)
|
||||
{
|
||||
use Text::Wrap;
|
||||
print wrap ("| ", " ",
|
||||
(map { "\"$_\"" } (1 .. $size)),
|
||||
" END \n"),
|
||||
" { \$\$ = $size; }\n";
|
||||
(map { "\"$_\"" } (1 .. $size)),
|
||||
" END \n"),
|
||||
" { \$\$ = $size; }\n";
|
||||
};
|
||||
print ";\n";
|
||||
|
||||
@@ -190,7 +190,7 @@ EOF
|
||||
use Text::Wrap;
|
||||
print
|
||||
wrap ("exp: ", " ",
|
||||
(map { "\"$_\"" } (1 .. $max)), ";"),
|
||||
(map { "\"$_\"" } (1 .. $max)), ";"),
|
||||
"\n";
|
||||
|
||||
print <<EOF;
|
||||
@@ -292,8 +292,8 @@ EOF
|
||||
|
||||
print
|
||||
wrap ("%type <val> ",
|
||||
" ",
|
||||
map { "n$_" } (1 .. $max)),
|
||||
" ",
|
||||
map { "n$_" } (1 .. $max)),
|
||||
"\n";
|
||||
|
||||
print "%token\n";
|
||||
@@ -334,7 +334,7 @@ yylex (void)
|
||||
if (counter > $max)
|
||||
{
|
||||
if (counter++ != $max + 1)
|
||||
abort ();
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
||||
if (return_token)
|
||||
@@ -435,8 +435,8 @@ main (int argc, const char **argv)
|
||||
abort ();
|
||||
yylval_init = strtol (argv[1], &endp, 10);
|
||||
if (! (argv[1] != endp
|
||||
&& 0 <= yylval_init && yylval_init <= INT_MAX
|
||||
&& errno != ERANGE))
|
||||
&& 0 <= yylval_init && yylval_init <= INT_MAX
|
||||
&& errno != ERANGE))
|
||||
abort ();
|
||||
yydebug = 1;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user