From owner-freebsd-hackers Fri Nov 29 06:28:54 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA19627 for hackers-outgoing; Fri, 29 Nov 1996 06:28:54 -0800 (PST) Received: from ami.tom.computerworks.net (AMI.RES.CMU.EDU [128.2.95.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id GAA19622 for ; Fri, 29 Nov 1996 06:28:52 -0800 (PST) Received: from bonkers.taronga.com by ami.tom.computerworks.net with smtp (Smail3.1.29.1 #1) id m0vTTvr-0021VaC; Fri, 29 Nov 96 09:28 EST Received: (from peter@localhost) by bonkers.taronga.com (8.6.11/8.6.9) id IAA15151; Fri, 29 Nov 1996 08:26:08 -0600 Date: Fri, 29 Nov 1996 08:26:08 -0600 From: peter@taronga.com (Peter da Silva) Message-Id: <199611291426.IAA15151@bonkers.taronga.com> To: hackers@freebsd.org Subject: Re: Lex/Yacc question Newsgroups: taronga.freebsd.hackers In-Reply-To: Organization: none Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In article you write: >>I've written a number of parsers, too. Nonen of them needed: >> >> KEYWORD rest of stuff to end of line > >Ever heard of Ada? > > -- and the rest of the line is a comment # sh does it too. // And C++ % And Postscript ; And a number of assemblers ! And X resource files XCOMM And Imakefiles I just don't get it. Why use a formal grammer to parse 821 anyway, not to mention that KEYWORD\ .* { foo(yytext+sizeof "KEYWORD"); } works fine. Did you see the disgusting trick I pulled there?