silvert@dalcs.UUCP (Bill Silvert) (06/21/85)
Whenever I use a right context in a long lex program I get the message: (Error) Too man right contexts And if I eliminate enought statements which do NOT have right contexts it works. Specifically, I am working on a cross-reference program for f77, which has lines like: WRITE ; to ignore reserved words, and I would like to recognize assignement statements with lines such as: [A-Z][A-Z0-9]*/= ECHO; (It's a bit more complex than ECHO, actually), and I get the error message. Can anyone shed light on how right contexts are treated? I get an error even if there is only one right context, as in the example. -- Bill Silvert Marine Ecology Lab. Dartmouth, NS dalcs!silvert dalcs!biomel!bill
sambo@ukma.UUCP (Inventor of micro-S) (06/28/85)
In article <1527@dalcs.UUCP> silvert@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@anl-mcs.arpa, or even anlams!ukma!sambo@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."