[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: |
Akim Demaille |
Subject: |
Re: How to change default outcome of shift/reduce conflict? |
Date: |
12 Jan 2002 14:47:39 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) |
| 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
Well, if the problem is on a sentence such as
ANSWER expr WITH expr OR expr
and you want it too be understood as
ANSWER expr WITH (expr OR expr)
then you need to say that WITH has a very low priority: lower than any
operator that can appear in the second expr of ANSWER/WITH.
- Re: How to change default outcome of shift/reduce conflict?, (continued)
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/15
- Re: How to change default outcome of shift/reduce conflict?, Anthony DeRobertis, 2002/01/16
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/16
- Re: How to change default outcome of shift/reduce conflict?, Akim Demaille, 2002/01/17
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/17
- Message not available
- Re: [FC-general] Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/15
- Re: [FC-general] Re: How to change default outcome of shift/reduce conflict?, Tim Van Holder, 2002/01/15
- Re: [FC-general] Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/15
- 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?,
Akim Demaille <=
Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/15
Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/15
Re: How to change default outcome of shift/reduce conflict?, Scott Raney, 2002/01/16
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/17
- Re: How to change default outcome of shift/reduce conflict?, Scott Raney, 2002/01/17
- Re: How to change default outcome of shift/reduce conflict?, Anthony DeRobertis, 2002/01/18
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/18
- Re: How to change default outcome of shift/reduce conflict?, Akim Demaille, 2002/01/18
- Re: How to change default outcome of shift/reduce conflict?, Hans Aberg, 2002/01/18