/[bison]/bison/tests/glr-regr1.at
ViewVC logotype

Diff of /bison/tests/glr-regr1.at

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

revision 1.1 by hilfinger, Wed Oct 30 02:03:14 2002 UTC revision 1.2 by akim, Mon Nov 4 08:30:18 2002 UTC
# Line 29  AT_DATA([glr-regr1.y], Line 29  AT_DATA([glr-regr1.y],
29    
30  #define YYSTYPE int  #define YYSTYPE int
31  static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);  static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
32    int yylex (void);
33    int yyerror (char const *msg);
34  %}  %}
35    
36    
# Line 52  E: E 'P' E { $$=1; printf("E -> E 'P' E\ Line 54  E: E 'P' E { $$=1; printf("E -> E 'P' E\
54    
55  static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)  static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)
56  {  {
57      (void) x0;
58      (void) x1;
59    printf ("<OR>\n");    printf ("<OR>\n");
60    return 0;    return 0;
61  }  }
62    
63  int main()  int
64    main (void)
65  {  {
66    yyparse();    yyparse();
67    return 0;    return 0;
68  }  }
69    
70  int yyerror(char const *msg)  int
71    yyerror (char const *msg)
72  {  {
73    printf("%s\n", msg);    printf("%s\n", msg);
74    exit(4);    exit(4);
75  }  }
76    
77    
78  int yylex()  int
79    yylex (void)
80  {  {
81    while (1) {    while (1) {
82      int ch = fgetc(stdin);      int ch = fgetc(stdin);
# Line 86  AT_CHECK([[bison -o glr-regr1.c glr-regr Line 93  AT_CHECK([[bison -o glr-regr1.c glr-regr
93  [glr-regr1.y: warning: 1 shift/reduce conflict  [glr-regr1.y: warning: 1 shift/reduce conflict
94  ])  ])
95  AT_COMPILE([glr-regr1])  AT_COMPILE([glr-regr1])
96  AT_CHECK([[echo BPBPB | ./glr-regr1]], 0,  AT_CHECK([[echo BPBPB | ./glr-regr1]], 0,
97  [[E -> 'B'  [[E -> 'B'
98  E -> 'B'  E -> 'B'
99  E -> E 'P' E  E -> E 'P' E

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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