From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32068 invoked by alias); 26 Oct 2004 11:42:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 32060 invoked from network); 26 Oct 2004 11:42:05 -0000 Received: from unknown (HELO wproxy.gmail.com) (64.233.184.202) by sourceware.org with SMTP; 26 Oct 2004 11:42:05 -0000 Received: by wproxy.gmail.com with SMTP id 65so177416wri for ; Tue, 26 Oct 2004 04:42:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=cUS/W8Qnf9/pRVHOeGUCEKZx+J4oN8ytgGjkI3KEQoLr15H/4OtvE7Av31jqywNEHCovdHIbu6Q/kZVlcxWHma9jZbPyEpUF4zWgKl0PrIbhX7jhB8t89l3qjX9xWxhFifHEuj1S1I7unsdXnHALvMjUdHoqMTd8GR+hU/aAz0c= Received: by 10.54.3.65 with SMTP id 65mr167697wrc; Tue, 26 Oct 2004 04:42:02 -0700 (PDT) Received: by 10.54.3.29 with HTTP; Tue, 26 Oct 2004 04:42:02 -0700 (PDT) Message-ID: <2116058a04102604421a21c068@mail.gmail.com> Date: Tue, 26 Oct 2004 12:21:00 -0000 From: Kyuupi Reply-To: Kyuupi To: "Joseph S. Myers" Subject: Re: New C parser [patch] Cc: Zack Weinberg , gcc-patches@gcc.gnu.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <873c02e46k.fsf@codesourcery.com> X-SW-Source: 2004-10/txt/msg02174.txt.bz2 On Tue, 26 Oct 2004 00:37:21 +0000 (UTC), Joseph S. Myers wrote: > On Mon, 25 Oct 2004, Zack Weinberg wrote: > > > I'm generally quite happy with this patch. Could you enumerate all > > the places where 2-token lookahead is needed, and give an opinion as > > to how many of those could be eliminated through future cleanups? > > Distinguishing array declarators [*] and [*foo]. > > Distinguishing whether an identifier where a statement is expected is a > label or starts an expression. Those are the only two in standard C that I don't believe can be reasonably avoided in a recursive descent parser. > Distinguishing whether '(' in an expression starts a parenthesised > subexpression, a statement expression or is followed by a type name. > (Also after sizeof and alignof.) This wasn't necessary in the parser I have written. > Distinguishing whether an identifier in an expression is followed by '(' > and so could be an implicit function declaration. I don't believe this is either. Neil.