Re: Getting rid of backups in flex.

=?ISO-8859-15?q?=22Cass=E9=.Hugues@free.fr,
6 Feb 2002 23:36:16 -0500

          From comp.compilers

Related articles
Getting rid of backups in flex. robertminsk@yahoo.com (2002-01-17)
Re: Getting rid of backups in flex. esmond.pitt@bigpond.com (Esmond Pitt) (2002-01-18)
Re: Getting rid of backups in flex. casse@netcourrier.com (=?ISO-8859-15?q?=22Cass=E9=.Hugues@free.fr,@free.f) (2002-02-06)
Re: Getting rid of backups in flex. dube@dino04.iro.umontreal.ca (Danny Dube) (2002-02-16)
Re: Getting rid of backups in flex. esmond.pitt@bigpond.com (Esmond Pitt) (2002-02-28)
Re: Getting rid of backups in flex. clint@0lsen.net (2002-03-17)
Re: Getting rid of backups in flex. fjh@cs.mu.OZ.AU (2002-03-19)
| List of all articles for this month |

From: =?ISO-8859-15?q?=22Cass=E9=.Hugues@free.fr, " <casse@netcourrier.com>"@free.fr
Newsgroups: comp.compilers
Date: 6 Feb 2002 23:36:16 -0500
Organization: Guest of ProXad - France
References: 02-01-070
Keywords: lex
Posted-Date: 06 Feb 2002 23:36:16 EST

I think the problem arises between the lines:
> [-+]?{DIGIT}*"."{DIGIT}+{EXP}? | (line 7)
    and
> [-+]?{DIGIT}*"."{DIGIT}+{EXPERR}? | (line 11)
    cause of the last "?" mark. It means that this lexical sequence may be
found or not. In the case the sequence is not found, there is no way to
find a difference between the two rules which are exactly equal to the
following:
[-+]?{DIGIT}*"."{DIGIT}+
    So, I think, flex can not choose between the two different actions.


"Robert Minsk" <robertminsk@yahoo.com> a écrit :


> Given the following rules I am still getting 1 backup I'm trying to get
> rid of.
>
> DIGIT [[:digit:]]
> EXP [Ee][+-]?{DIGIT}+
> EXPERR [Ee][+-]?
> %%
> [-+]?{DIGIT}+ { return tInt; }
>
> [-+]?{DIGIT}*"."{DIGIT}+{EXP}? |
> [-+]?{DIGIT}+"."{DIGIT}*{EXP}? |
> [-+]?{DIGIT}+{EXP} { return tFloat }
>
> [-+]?{DIGIT}*"."{DIGIT}+{EXPERR}? |
> [-+]?{DIGIT}+"."{DIGIT}*{EXPERR}? |
> [-+]?{DIGIT}+{EXPERR}
> . { return tError }
>
> I get:
> State #9 is non-accepting -
> associated rule line numbers:
> 7 11
> out-transitions: [ 0-9 ]
> jam-transitions: EOF [ \000-/ :-\377 ]
>
> 1 backing up (non-accepting) states.
>
> I have not been able to fix this backup. Can you get rid of the one
> backup? Is there a better way to code this?



Post a followup to this message

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