[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I fix it?
From: |
Carl Cerecke |
Subject: |
Re: How can I fix it? |
Date: |
Mon, 10 Feb 2003 09:54:35 +1300 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 |
Davide Rizzo wrote:
I defined two similar rules which look like
date_interval: FROM { /* exec some code - mid-rule action */ }
date { /* exec some code - mid-rule action */ }
UPTO
date { /* exec some code - normal action */ }
;
time_interval: FROM { /* exec some code - mid-rule action */ }
time { /* exec some code - mid-rule action */ }
UPTO
time { /* exec some code - normal action */ }
;
Usually, bison (or any LR-base parser) decides at the latest
possible moment which rule it is parsing.
The problem here could be that, with embedded actions, bison must
decide earlier about which rule it is parsing.
In other words, because of your actions after the FROM token,
bison is forced to choose either the date_interval rule or
the time_interval rule so it can execute the attached code. It
won't execute the attached code for both rules; it must decide
on one of them.
Cheers,
Carl.