From owner-freebsd-questions Thu Feb 17 1: 0: 4 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fb01.eng00.mindspring.net (fb01.eng00.mindspring.net [207.69.229.19]) by hub.freebsd.org (Postfix) with ESMTP id 92BA937B686 for ; Thu, 17 Feb 2000 00:59:51 -0800 (PST) (envelope-from jhix@mindspring.com) Received: from jhix.mindspring.com (user-33qtkcv.dialup.mindspring.com [199.174.209.159]) by fb01.eng00.mindspring.net (8.9.3/8.8.5) with ESMTP id DAA06028; Thu, 17 Feb 2000 03:59:47 -0500 (EST) Received: from localhost (jhix@localhost [127.0.0.1]) by jhix.mindspring.com (8.9.3/8.9.2) with ESMTP id BAA02882; Thu, 17 Feb 2000 01:03:02 -0800 (PST) (envelope-from jhix@mindspring.com) To: jcm@dogma.freebsd-uk.eu.org Cc: freebsd-questions@FreeBSD.ORG Subject: Re: parser question In-Reply-To: References: X-Mailer: Mew version 1.94.1 on XEmacs 21.1 (Bryce Canyon) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000217010302L.jhix@mindspring.com> Date: Thu, 17 Feb 2000 01:03:02 -0800 From: W Gerald Hicks X-Dispatcher: imput version 990905(IM130) Lines: 29 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG From: Jonathon McKitrick Subject: parser question Date: Wed, 16 Feb 2000 17:26:31 +0000 (GMT) > Hi all, > I have to write a recursive-descent parser for a class assignment. I > was reading through the source for gcc, and some of the code is > written in yacc, which is developed expressly for parsers and > compilers. Is there a simpler way to understand this? My prof just > gave me a small BNF grammar, and my prog must parse it and generate > errors for any input file that breaks the grammar rules. Does gcc use > recursive descent at all? Is there one file in source which is a good > example of this, without requiring me to learn YACC/Lex?? > Hrm. 1) Learn Yacc/Lex. It is the Unix way. 2) Get the dragon-book(s) by Aho/Ullman 3) Read "The Unix Programming Environment" by Brian Kernighan and Rob Pike. Cheers, Jerry Hicks jhix@mindspring.com (who never met a recursive descent parser weenie that knew Yacc :) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message