too ambiguous?

"Davide Rizzo" <belgioioso@libero.it>
21 Feb 2003 00:44:47 -0500

          From comp.compilers

Related articles
too ambiguous? belgioioso@libero.it (Davide Rizzo) (2003-02-21)
| List of all articles for this month |
From: "Davide Rizzo" <belgioioso@libero.it>
Newsgroups: comp.compilers
Date: 21 Feb 2003 00:44:47 -0500
Organization: [Infostrada]
Keywords: parse, question
Posted-Date: 21 Feb 2003 00:44:47 EST

I need to fix an ambiguous situation: I have the following rules (note that
in italy we use to write sometihn like 1 january 2003, not January, 1
2003!!!):
day_and_month: DIGIT MONTH_NAME
                ;
day_month_and_year: DIGIT MONTH_NAME DIGIT
                ;
only_month: MONTH_NAME
                ;


the problem arises when I insert the input "1 january 3 february", because
the parser undestand I mean a da_month_and_year rule followed by a only_mont
rule, while I'd like to obtain two day_month_and_year rules! I don't think I
can modify lexical scanner (controlling in the second number may stand for a
year or a day) because I'd want to specify yeras even with only the last two
digits. I think I could use associativity and precedence (maybe directly
applied to rules), but I can't figure out how to do it.
Any suggestions?


reply at belgioioso@libero.it


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.