Re: flex default rule

John Millaway <>
3 Apr 2006 01:39:51 -0400

          From comp.compilers

Related articles
flex default rule (Dimitri Maziuk) (2006-04-01)
Re: flex default rule (John Millaway) (2006-04-03)
Re: flex default rule (Dimitri Maziuk) (2006-04-03)
Re: flex default rule (Chris Dodd) (2006-04-03)
Re: flex default rule (Dimitri Maziuk) (2006-04-08)
| List of all articles for this month |

From: John Millaway <>
Newsgroups: comp.compilers
Date: 3 Apr 2006 01:39:51 -0400
Organization: Compilers Central
References: 06-04-001
Keywords: lex
Posted-Date: 03 Apr 2006 01:39:51 EDT

Hi, Named rules like "{SEMI}" are not expanded inside character classes. The
problem is in these lines:

> SEMI ^;
> %%

Note that the ^ in SEMI means beginning of line. The ^ in [^] means character
class complement. So, it's not clear what you're trying to match. Anything
but a semi-colon?


Anything but a semi-colon preceeded by a newline?


A newline followed by anything but a semicolon?


Or is your input always delimited by \n; ? Then just match on

      \n; BEGIN(YYSEMI);

without trying to account for all possible newline types or [\n;] combos.


Post a followup to this message

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