[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to change default outcome of shift/reduce conflict?
From: |
Anthony DeRobertis |
Subject: |
Re: How to change default outcome of shift/reduce conflict? |
Date: |
Sat, 12 Jan 2002 03:53:30 -0500 |
Hans Aberg writes:
You can use the Bison %left command on your "or" operator (see the manual
for calculator example).
OR is already %left.
The actual lines look like this:
answer_statement: ANSWER expr answer_btn_list { ... }
| ANSWER_FILE { ... }
| ANSWER_FILE expr { ... }
| ANSWER_FILE expr OF TYPE expr { ... }
;
answer_btn_list: WITH answer_btn_list_oneplus { ... }
| { ... }
;
answer_btn_list_oneplus: answer_btn_list_oneplus OR expr { ... }
| expr { ... }
;
Now, expr contains, among many other lines,
expr: ...
| expr OR expr { ... }
...
;
The problem is a line which looks like this
ANSWER expr WITH expr OR expr
^^
Bison chooses the resolve the ambiguous grammar by shifting at the
pgpkbRFsah84R.pgp
Description: PGP signature
- How to change default outcome of shift/reduce conflict?, Anthony DeRobertis, 2002/01/11
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/11
- Re: How to change default outcome of shift/reduce conflict?,
Anthony DeRobertis <=
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/12
- Re: How to change default outcome of shift/reduce conflict?, Anthony DeRobertis, 2002/01/12
- Re: How to change default outcome of shift/reduce conflict?, Akim Demaille, 2002/01/12
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/12
- Re: How to change default outcome of shift/reduce conflict?, Anthony DeRobertis, 2002/01/12
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/12
- Re: How to change default outcome of shift/reduce conflict?, Akim Demaille, 2002/01/13
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/13
- Re: How to change default outcome of shift/reduce conflict?, Anthony DeRobertis, 2002/01/14
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/14