Re: flex default rule

Chris Dodd <cdodd@acm.org>
3 Apr 2006 01:41:42 -0400

          From comp.compilers

Related articles
flex default rule dmaziuk@bmrb.wisc.edu (Dimitri Maziuk) (2006-04-01)
Re: flex default rule johnmillaway@yahoo.com (John Millaway) (2006-04-03)
Re: flex default rule dmaziuk@bmrb.wisc.edu (Dimitri Maziuk) (2006-04-03)
Re: flex default rule cdodd@acm.org (Chris Dodd) (2006-04-03)
Re: flex default rule dmaziuk@bmrb.wisc.edu (Dimitri Maziuk) (2006-04-08)
| List of all articles for this month |
From: Chris Dodd <cdodd@acm.org>
Newsgroups: comp.compilers
Date: 3 Apr 2006 01:41:42 -0400
Organization: Compilers Central
References: 06-04-001
Keywords: lex
Posted-Date: 03 Apr 2006 01:41:42 EDT

Dimitri Maziuk <dmaziuk@bmrb.wisc.edu> wrote in news:06-04-
001@comp.compilers:
> %%
><INITIAL>{SEMI} { ...
><YYSEMI>{SEMI} { ...
><INITIAL>[^{SEMI}] { ...
>
:
>
> Why the hell does it trigger the default rule at 'S', 'S', 'I', and 'M'?
> Any takers?


When you're in state YYSEMI, the only rule you have is the second one
({SEMI}), so any other character will trigger the defout rule (echo to
stdout). Prehaps you meant the third rule to be YYSEMI instead of INITIAL?


Chris Dodd
cdodd@acm.org



Post a followup to this message

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