Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!iecc!compilers-sender From: amb@Apple.COM (A. Michael Burbidge) Newsgroups: comp.compilers Subject: Handling keywords that are not reserved? Keywords: parse, yacc, question Message-ID: <48132@apple.Apple.COM> Date: 15 Jan 91 23:38:09 GMT Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: amb@Apple.COM (A. Michael Burbidge) Organization: Apple Computer Inc., Cupertino, CA Lines: 16 Approved: compilers@iecc.cambridge.ma.us I am writing a parser for MPW's Object Pascal. Some of the extension keywords to standard Pascal are not reserved. I am using yacc and having some trouble figuring out a clean way to handle non-reserved keywords. I know this is a rather vague question, but if anyone has any tips or hints on handling non-reserved keywords using yacc please let me know. Mike Burbidge Apple Computer, Inc. amb@apple.com [There isn't any clean way to handle non-reserved keywords in yacc. You have to feed information from the parser back to the lexer to tell it when a token can be a keyword and when it can't. -John] -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.