Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/3/85; site ukma.UUCP Path: utzoo!watmath!clyde!cbosgd!ukma!sambo From: sambo@ukma.UUCP (Inventor of micro-S) Newsgroups: net.unix Subject: Re: lex query: "Too many right contexts" Message-ID: <1921@ukma.UUCP> Date: Fri, 28-Jun-85 01:47:53 EDT Article-I.D.: ukma.1921 Posted: Fri Jun 28 01:47:53 1985 Date-Received: Sat, 29-Jun-85 01:20:31 EDT References: <1527@dalcs.UUCP> Reply-To: sambo@ukma.UUCP (Inventor of micro-S) Organization: Univ. of KY Mathematical Sciences Lines: 25 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."