Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!ditmela!yarra!bohra!ejp From: ejp@bohra.cpg.oz (Esmond Pitt) Newsgroups: comp.lang.c Subject: Re: Lex and initial start conditions Message-ID: <117@bohra.cpg.oz> Date: 1 Jun 90 00:53:47 GMT References: <6342@crabcake> <1990May30.174745.1161@csrd.uiuc.edu> <116@bohra.cpg.oz> <1990May31.161800.11133@iwarp.intel.com> Reply-To: ejp@bohra.cpg.oz.au (Esmond Pitt) Organization: Computer Power Group, Melb, Australia Lines: 19 In article <1990May31.161800.11133@iwarp.intel.com> merlyn@iwarp.intel.com (Randal Schwartz) writes: >In article <116@bohra.cpg.oz>, ejp@bohra (Esmond Pitt) [me] writes: >| >| 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. > >Because it is insufficient. It's not "first match", but "longest >match" that determines rule triggering. ("first match" applies when >the rules have the same length.) How does this explain why people put labelled states after non-labelled states, when the manual says not to? -- Esmond Pitt, Computer Power Group ejp@bohra.cpg.oz D