Re: Problem with GIF file scanner (flex) (Vern Paxson)
29 Jan 1997 11:53:32 -0500

          From comp.compilers

Related articles
Problem with GIF file scanner (flex) (1997-01-25)
Re: Problem with GIF file scanner (flex) (1997-01-26)
Re: Problem with GIF file scanner (flex) (1997-01-29)
| List of all articles for this month |

From: (Vern Paxson)
Newsgroups: comp.compilers
Date: 29 Jan 1997 11:53:32 -0500
Organization: Lawrence Berkeley National Laboratory, Berkeley CA
References: 97-01-197
Summary: not a flex bug
Keywords: flex

Kristian Nilssen <> wrote:
> For some
> unknown reason, flex will not enter the Logical_Screen_Descriptor
> ...
> %%
> %{
> BEGIN Header;
> %}

By putting the "BEGIN Header" as indented code at the beginning of the
rules, it's executed every time you call yylex. Since the rule used
to enter Logical_Screen_Descriptor ends with a return statement,
you're for sure reexecuting "BEGIN Header" before scanning the next
token, so you lose the Logical_Screen_Descriptor state and instead
wind up in "Header" again.

Either get rid of the return in the <Header> rule, or get rid of <Header>
entirely, along with the "BEGIN Header". With %x, you don't need to worry
about any conflicts between Header and Logical_Screen_Descriptor, anyway,
so there's no pressing need to have the header scanning be it's own start

[Oh. right. Oops. -John]


Post a followup to this message

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