Xref: utzoo comp.unix.questions:24489 comp.compilers:1114 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!usc!snorkelwacker!spdcc!esegue!compilers-sender From: rdfloyd@ceaport.UUCP (Randy Floyd) Newsgroups: comp.unix.questions,comp.compilers Subject: lex error "Compiler Design and Construction" Keywords: C,lex,question Message-ID: <136@ceaport.UUCP> Date: 9 Aug 90 19:05:42 GMT Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: rdfloyd@ceaport.UUCP (Randy Floyd) Followup-To: comp.unix.questions Distribution: usa Organization: C Tech, Memphis, TN Lines: 30 Approved: compilers@esegue.segue.boston.ma.us In "Compiler Design and Construction" by: Authur B. Pyster (second edition) On page 67 there is a small lex for part of C syntax but when I try to run it through FLEX I get an error. Syntax error at line 38: bad iteration values the definition of char and line 38 follow: char \'([^'\n]|\\[ntrbrf'\n]|\\0[0-7]{0,2})+\' line 38: {char} return token(CHARLIT); now!!! Can a kind soul please give me a rundown of the definition line for char and tell me why I might be getting this message. BTW: I am new to lex/yacc but learning. thanks for any help!! rdfloyd@ceaport [This is a pretty gross way to define a character constant, but I don't see anything obviously wrong with it, other than that it matches things like '\000' ambiguously. -John] -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus| world}!esegue. Meta-mail to compilers-request@esegue.