/[bison]/bison/tests/regression.at
ViewVC logotype

Diff of /bison/tests/regression.at

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by akim, Thu Dec 13 11:02:21 2001 UTC revision 1.22 by akim, Sat Dec 22 14:42:36 2001 UTC
# Line 605  AT_CLEANUP Line 605  AT_CLEANUP
605    
606  AT_TEST_CPP_GUARD_H([input/input])  AT_TEST_CPP_GUARD_H([input/input])
607  AT_TEST_CPP_GUARD_H([9foo])  AT_TEST_CPP_GUARD_H([9foo])
608    
609    
610    
611    ## ------- ##
612    ## Web2c.  ##
613    ## ------- ##
614    
615    # The generation of the reduction was once wrong in Bison, and made it
616    # miss some reductions.  In the following test case, the reduction on
617    # `undef_id_tok' in state 1 was missing.  This is stripped down from
618    # the actual web2c.y.
619    
620    AT_SETUP([Web2c])
621    
622    AT_DATA([input.y],
623    [[%token        undef_id_tok const_id_tok
624    
625    %start CONST_DEC_PART
626    
627    %%
628    CONST_DEC_PART:
629             CONST_DEC_LIST
630            ;
631    
632    CONST_DEC_LIST:
633              CONST_DEC
634            | CONST_DEC_LIST CONST_DEC
635            ;
636    
637    CONST_DEC:
638              { } undef_id_tok '=' const_id_tok ';'
639            ;
640    %%
641    
642    ]])
643    
644    AT_CHECK([bison -v input.y])
645    
646    AT_CHECK([sed -n 's/  *$//;/^$/!p' input.output], 0,
647    [[Grammar
648      Number, Line, Rule
649        1   6 CONST_DEC_PART -> CONST_DEC_LIST
650        2  10 CONST_DEC_LIST -> CONST_DEC
651        3  12 CONST_DEC_LIST -> CONST_DEC_LIST CONST_DEC
652        4  15 @1 -> /* empty */
653        5  15 CONST_DEC -> @1 undef_id_tok '=' const_id_tok ';'
654    Terminals, with rules where they appear
655    $ (-1)
656    ';' (59) 5
657    '=' (61) 5
658    error (256)
659    undef_id_tok (257) 5
660    const_id_tok (258) 5
661    Nonterminals, with rules where they appear
662    CONST_DEC_PART (7)
663        on left: 1
664    CONST_DEC_LIST (8)
665        on left: 2 3, on right: 1 3
666    CONST_DEC (9)
667        on left: 5, on right: 2 3
668    @1 (10)
669        on left: 4, on right: 5
670    state 0
671        $default    reduce using rule 4 (@1)
672        CONST_DEC_PART      go to state 9
673        CONST_DEC_LIST      go to state 1
674        CONST_DEC   go to state 2
675        @1          go to state 3
676    state 1
677        CONST_DEC_PART  ->  CONST_DEC_LIST .   (rule 1)
678        CONST_DEC_LIST  ->  CONST_DEC_LIST . CONST_DEC   (rule 3)
679        undef_id_tok        reduce using rule 4 (@1)
680        $default    reduce using rule 1 (CONST_DEC_PART)
681        CONST_DEC   go to state 4
682        @1          go to state 3
683    state 2
684        CONST_DEC_LIST  ->  CONST_DEC .   (rule 2)
685        $default    reduce using rule 2 (CONST_DEC_LIST)
686    state 3
687        CONST_DEC  ->  @1 . undef_id_tok '=' const_id_tok ';'   (rule 5)
688        undef_id_tok        shift, and go to state 5
689    state 4
690        CONST_DEC_LIST  ->  CONST_DEC_LIST CONST_DEC .   (rule 3)
691        $default    reduce using rule 3 (CONST_DEC_LIST)
692    state 5
693        CONST_DEC  ->  @1 undef_id_tok . '=' const_id_tok ';'   (rule 5)
694        '='         shift, and go to state 6
695    state 6
696        CONST_DEC  ->  @1 undef_id_tok '=' . const_id_tok ';'   (rule 5)
697        const_id_tok        shift, and go to state 7
698    state 7
699        CONST_DEC  ->  @1 undef_id_tok '=' const_id_tok . ';'   (rule 5)
700        ';'         shift, and go to state 8
701    state 8
702        CONST_DEC  ->  @1 undef_id_tok '=' const_id_tok ';' .   (rule 5)
703        $default    reduce using rule 5 (CONST_DEC)
704    state 9
705        $           shift, and go to state 10
706    state 10
707        $default    accept
708    ]])
709    
710    AT_CLEANUP

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26