lex error "Compiler Design and Construction"

Randy Floyd rdfloyd at ceaport.UUCP
Fri Aug 10 05:05:42 AEST 1990


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 at 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 at esegue.segue.boston.ma.us
{spdcc | ima | lotus| world}!esegue.  Meta-mail to compilers-request at esegue.



More information about the Comp.unix.questions mailing list