X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/f6b561d9f9cbc6fc95bbb86518372a5cb52f45a6..ea99d6e6a02a06bd63e788393fd42cde5cb1fa71:/tests/existing.at?ds=sidebyside diff --git a/tests/existing.at b/tests/existing.at index 20dbde82..a1b95ac9 100644 --- a/tests/existing.at +++ b/tests/existing.at @@ -1,6 +1,6 @@ # Exercising Bison on actual grammars. -*- Autotest -*- -# Copyright (C) 1989-1992, 2000-2005, 2007, 2009-2012 Free Software +# Copyright (C) 1989-1992, 2000-2005, 2007, 2009-2013 Free Software # Foundation, Inc. # This program is free software: you can redistribute it and/or modify @@ -403,32 +403,60 @@ dnl parses it as: dnl dnl getline $!(4*0); dnl -dnl That is, they shift `*' immediately and make it part of the getline +dnl That is, they shift '*' immediately and make it part of the getline dnl argument. dnl dnl The grammar below using LALR(1) parses it as a syntax error. So does dnl GNU AWK 3.0.6, 3.1.0, and 3.1.1. They reduce the full getline expression -dnl before shifting `*' even though `*' is not a valid lookahead. +dnl before shifting '*' even though '*' is not a valid lookahead. dnl dnl GNU AWK 3.1.2, 3.1.3, 3.1.4, and 3.1.5 parse it as: dnl dnl (getline $!4)*0; dnl dnl That is, like the other versions of GNU AWK, they reduce the full getline -dnl expression before shifting `*'. However, because of a different LHS on the -dnl getline rule, `*' actually is a valid lookahead. Solaris /usr/xpg4/bin/awk +dnl expression before shifting '*'. However, because of a different LHS on the +dnl getline rule, '*' actually is a valid lookahead. Solaris /usr/xpg4/bin/awk dnl and the Open Group awk specification seem to agree: dnl dnl http://www.opengroup.org/pubs/online/7908799/xcu/awk.html dnl dnl /bin/nawk and /bin/awk on Solaris 10 report it as a syntax error, but they -dnl don't like even `print $!4;'. +dnl don't like even 'print $!4;'. [[LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';']], dnl BISON-STDERR -[AT_COND_CASE([[canonical LR]], +[[input.y:66.10: warning: empty rule without %empty [-Wempty-rule] +input.y:169.8: warning: empty rule without %empty [-Wempty-rule] +input.y:174.12: warning: empty rule without %empty [-Wempty-rule] +input.y:179.13: warning: empty rule without %empty [-Wempty-rule] +input.y:187.15: warning: empty rule without %empty [-Wempty-rule] +input.y:201.8: warning: empty rule without %empty [-Wempty-rule] +input.y:206.21: warning: empty rule without %empty [-Wempty-rule] +input.y:220.20: warning: empty rule without %empty [-Wempty-rule] +input.y:299.13: warning: empty rule without %empty [-Wempty-rule] +input.y:322.9: warning: empty rule without %empty [-Wempty-rule] +]AT_COND_CASE([[canonical LR]], [[input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr]]], [[input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]]])[ +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] ]], dnl LAST-STATE @@ -489,7 +517,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' $default reduce using rule 45 (statement) + + -+state 320 ++State 320 + + 139 non_post_simp_exp: . '!' simp_exp + 140 | . '(' exp r_paren @@ -527,7 +555,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' + variable go to state 63 + + -+state 321 ++State 321 + + 146 non_post_simp_exp: INCREMENT . variable + 154 variable: . NAME @@ -540,7 +568,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' + variable go to state 50 + + -+state 322 ++State 322 + + 147 non_post_simp_exp: DECREMENT . variable + 154 variable: . NAME @@ -553,7 +581,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' + variable go to state 51 + + -+state 323 ++State 323 + + 130 simp_exp: . non_post_simp_exp + 131 | . simp_exp '^' simp_exp @@ -601,7 +629,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' + variable go to state 57 + + -+state 324 ++State 324 + + 130 simp_exp: . non_post_simp_exp + 131 | . simp_exp '^' simp_exp @@ -649,7 +677,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' + variable go to state 57 + + -+state 325 ++State 325 + + 130 simp_exp: . non_post_simp_exp + 131 | . simp_exp '^' simp_exp @@ -697,7 +725,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' + variable go to state 57 + + -+state 326 ++State 326 + + 131 simp_exp: simp_exp . '^' simp_exp + 132 | simp_exp . '*' simp_exp @@ -718,7 +746,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' + Conflict between rule 151 and token '-' resolved as reduce ('-' < UNARY). + + -+state 327 ++State 327 + + 131 simp_exp: simp_exp . '^' simp_exp + 132 | simp_exp . '*' simp_exp @@ -739,7 +767,7 @@ dnl - 61 -> 328: reduce -> shift on '*', '/', and '%' + Conflict between rule 150 and token '-' resolved as reduce ('-' < UNARY). + + -+state 328 ++State 328 + + 131 simp_exp: simp_exp . '^' simp_exp + 132 | simp_exp . '*' simp_exp @@ -1367,11 +1395,39 @@ dnl INPUT [[]], dnl BISON-STDERR -[AT_COND_CASE([[canonical LR]], +[[input.y:128.12: warning: empty rule without %empty [-Wempty-rule] +input.y:137.10: warning: empty rule without %empty [-Wempty-rule] +input.y:142.8: warning: empty rule without %empty [-Wempty-rule] +input.y:161.15: warning: empty rule without %empty [-Wempty-rule] +input.y:179.17: warning: empty rule without %empty [-Wempty-rule] +input.y:205.16: warning: empty rule without %empty [-Wempty-rule] +input.y:213.9: warning: empty rule without %empty [-Wempty-rule] +input.y:225.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.18: warning: empty rule without %empty [-Wempty-rule] +input.y:294.19: warning: empty rule without %empty [-Wempty-rule] +input.y:367.16: warning: empty rule without %empty [-Wempty-rule] +input.y:373.11: warning: empty rule without %empty [-Wempty-rule] +input.y:387.15: warning: empty rule without %empty [-Wempty-rule] +input.y:401.18: warning: empty rule without %empty [-Wempty-rule] +input.y:413.15: warning: empty rule without %empty [-Wempty-rule] +input.y:443.15: warning: empty rule without %empty [-Wempty-rule] +input.y:471.15: warning: empty rule without %empty [-Wempty-rule] +input.y:474.15: warning: empty rule without %empty [-Wempty-rule] +input.y:489.15: warning: empty rule without %empty [-Wempty-rule] +input.y:506.14: warning: empty rule without %empty [-Wempty-rule] +input.y:587.9: warning: empty rule without %empty [-Wempty-rule] +input.y:591.14: warning: empty rule without %empty [-Wempty-rule] +]AT_COND_CASE([[canonical LR]], [[input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr]]], [[input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]]])[ +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] ]], dnl LAST-STATE @@ -1537,7 +1593,7 @@ box "foo" above ljust == box ("foo" above ljust) %left LEFT RIGHT /* Give attributes that take an optional expression a higher -precedence than left and right, so that eg `line chop left' +precedence than left and right, so that eg 'line chop left' parses properly. */ %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED %left LABEL @@ -1550,7 +1606,7 @@ parses properly. */ /* these need to be lower than '-' */ %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS -/* these must have higher precedence than CHOP so that `label %prec CHOP' +/* these must have higher precedence than CHOP so that 'label %prec CHOP' works */ %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER @@ -1953,7 +2009,93 @@ dnl without being followed by "of".) [[VARIABLE, '=', LABEL, LEFT, DOT_X]], dnl BISON-STDERR -[[input.y:470.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path [-Wother] +[[input.y:202.19: warning: empty rule without %empty [-Wempty-rule] +input.y:270.6: warning: empty rule without %empty [-Wempty-rule] +input.y:292.12: warning: empty rule without %empty [-Wempty-rule] +input.y:309.17: warning: empty rule without %empty [-Wempty-rule] +input.y:382.13: warning: empty rule without %empty [-Wempty-rule] +input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '@<:@', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] ]], dnl LAST-STATE @@ -2042,7 +2184,7 @@ dnl - 383 -> 427 nth_primitive go to state 105 @@ -3256,7 +3256,7 @@ - state 102 + State 102 - 146 place: label . [$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, AND, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '`', ',', '>', '+', '-', '!', ';', '}', '@:>@', ')'] + 146 place: label . [$end, LABEL, VARIABLE, NUMBER, TEXT, ORDINAL, LEFT_ARROW_HEAD, RIGHT_ARROW_HEAD, DOUBLE_ARROW_HEAD, LAST, UP, DOWN, LEFT, RIGHT, HEIGHT, RADIUS, WIDTH, DIAMETER, FROM, TO, AT, WITH, BY, THEN, SOLID, DOTTED, DASHED, CHOP, SAME, INVISIBLE, LJUST, RJUST, ABOVE, BELOW, HERE, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, SIN, COS, ATAN2, LOG, EXP, SQRT, K_MAX, K_MIN, INT, RAND, SRAND, CW, CCW, THICKNESS, FILL, COLORED, OUTLINED, SHADED, ALIGNED, SPRINTF, '(', '`', '+', '-', '!', ';', '}', '@:>@'] @@ -2207,7 +2349,7 @@ dnl - 383 -> 427 + expr go to state 424 - state 165 + State 165 @@ -7987,7 +7987,7 @@ text_expr go to state 112 text go to state 113 @@ -2324,7 +2466,7 @@ dnl - 383 -> 427 + between go to state 425 - state 193 + State 193 @@ -10152,7 +10152,7 @@ expr_pair go to state 317 @@ -2492,7 +2634,7 @@ dnl - 383 -> 427 + expr go to state 424 - state 238 + State 238 @@ -12937,7 +12937,7 @@ '!' shift, and go to state 94 @@ -2579,7 +2721,7 @@ dnl - 383 -> 427 + expr go to state 424 - state 315 + State 315 @@ -16124,7 +16124,7 @@ $default reduce using rule 239 (expr) @@ -2630,7 +2772,7 @@ dnl - 383 -> 427 + expr go to state 424 - state 383 + State 383 @@ -18071,7 +18071,7 @@ '!' shift, and go to state 94 @@ -2673,7 +2815,7 @@ dnl - 383 -> 427 $default reduce using rule 29 (placeless_element) + + -+state 423 ++State 423 + + 146 place: label . [$end, AND, DOT_X, DOT_Y, DOT_HT, DOT_WID, DOT_RAD, ',', '>', '+', '-', ';', '}', '@:>@', ')'] + 147 | label . corner @@ -2744,7 +2886,7 @@ dnl - 383 -> 427 + corner go to state 205 + + -+state 424 ++State 424 + + 140 position_not_place: expr . between position AND position + 141 | expr . '<' position ',' position '>' @@ -2787,7 +2929,7 @@ dnl - 383 -> 427 + between go to state 425 + + -+state 425 ++State 425 + + 134 position: . position_not_place + 135 | . place @@ -2943,7 +3085,7 @@ dnl - 383 -> 427 + expr go to state 424 + + -+state 426 ++State 426 + + 137 position_not_place: position . '+' expr_pair + 138 | position . '-' expr_pair @@ -2954,7 +3096,7 @@ dnl - 383 -> 427 + '-' shift, and go to state 198 + + -+state 427 ++State 427 + + 134 position: . position_not_place + 135 | . place