Lex and initial start conditions

Esmond Pitt ejp at bohra.cpg.oz
Thu May 31 15:07:00 AEST 1990


In article <1990May30.174745.1161 at csrd.uiuc.edu> pommu at iis.ethz.ch (Claude Pommerell) writes:
>
>There is a way to solve your problem, Jack.

There are two even simpler ways.

Instead of effectively changing the initial condition to <Text>, either:

1. Ensure each start-state is equipped with enough rules to handle any
possible input, and, as the documentation does state, place all the
unlabelled rules after all the labelled rules, and/or

2. Label all the rules you only want applied in the INITAL state with
<INITIAL>, so they won't be applied as defaults in other states.

Placing non-labelled rules before labelled rules is probably the single
most common error in writing LEX scripts, even after 15 years.

I don't know why.


-- 
Esmond Pitt, Computer Power Group
ejp at bohra.cpg.oz
D



More information about the Comp.unix.wizards mailing list