lex query: "Too many right contexts"
Inventor of micro-S
sambo at ukma.UUCP
Fri Jun 28 15:47:53 AEST 1985
In article <1527 at dalcs.UUCP> silvert at dalcs.UUCP (Bill Silvert) writes:
>Whenever I use a right context in a long lex program I get the message:
> (Error) Too man right contexts
>Specifically, I am working on a cross-reference program for f77,
>which has lines like:
> WRITE ;
>to ignore reserved words . . .
In the lexical analyzer for the compiler I am writing, I used to get some
message about exceeding some limit. I never was able to figure out how to
change that limit. (If I tried some number close to 980, I would get this
message, and if I tried the next number, lex would crash. I was using a
Vax 11/750, and still am.) What I ended up doing was to treat all the keywords
as normal identifiers, and then call a function to figure out if it was actually
a keyword or an identifier. I suspect that having lex recognize keywords
directly makes it consume large amounts of memory, making it easy to exceed
its limits.
-----------------------------------------
Samuel A. Figueroa, Dept. of CS, Univ. of KY, Lexington, KY 40506-0027
ARPA: ukma!sambo<@ANL-MCS>, or sambo%ukma.uucp at anl-mcs.arpa,
or even anlams!ukma!sambo at ucbvax.arpa
UUCP: {ucbvax,unmvax,boulder,oddjob}!anlams!ukma!sambo,
or cbosgd!ukma!sambo
"Micro-S is great, if only people would start using it."
More information about the Comp.unix
mailing list