Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: expression evaluation Message-ID: <10522@jpl-devvax.JPL.NASA.GOV> Date: 24 Nov 90 20:48:51 GMT References: <9171@pasteur.Berkeley.EDU> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 21 In article <9171@pasteur.Berkeley.EDU> jhh@sprite.Berkeley.EDU (John H. Hartman) writes: : : I'd like to write a Perl program that evaluates expressions with the : following grammar: : : expr -> expr op expr : expr -> ( expr ) : expr -> 1 : expr -> 0 : op -> || : op -> && : : : Does anyone have a program that does something similar? My brother-in-law Mark Biggar (who did the big* packages) is about to release a parser generator that takes an ll(1) grammar and turns it into a recursive descent tokener/parser. The above grammar isn't ll(1) but could be turned into one. Larry