Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51186 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10328 invoked from network); 2 Jan 2011 22:21:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2011 22:21:57 -0000 Authentication-Results: pb1.pair.com header.from=jond3k@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=jond3k@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: jond3k@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-gw0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:32852] helo=mail-gw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/78-48048-48AF02D4 for ; Sun, 02 Jan 2011 17:21:57 -0500 Received: by gwb20 with SMTP id 20so6166726gwb.29 for ; Sun, 02 Jan 2011 14:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=s7MpfDQ8DuHUFxwESLQy7+AkC1W5r3UkQLng3CG4ej4=; b=t7c+b0Bz1/kO8q6yktSTGMHxcs1HXYfnbIY92kFIZo8dvkcvGPXQhbneTQd7LsFBKf EtpQkLHEHd/7GClQ+n1P1SzxECdgyvj6e5ctamTnRPvKytGRQi+TVyJRtAONEyxSxnoU 5lU0mVBE9oW5hJMM+dbLUKDgsrWK7NivTSMuY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=WevZwOSrAPpKptyARv4Qc7+co+qwdtcCh1OEUIE7R7KOqt9AGqC0BbyMeTKiTCBfpc kJ3gLR7E6SKaH8Iijg34p9i86gQPLlV4TxYxO24qvd9lA72lgsFQW3Y05/KRejryuwG4 dxGu71TwcLlsXi/RblIz2vxDkaEMb2lWUBmHo= MIME-Version: 1.0 Received: by 10.100.136.14 with SMTP id j14mr6985736and.262.1294006914425; Sun, 02 Jan 2011 14:21:54 -0800 (PST) Received: by 10.100.248.15 with HTTP; Sun, 2 Jan 2011 14:21:54 -0800 (PST) In-Reply-To: References: <20101231115408.GD18520@nibiru.local> <542423FA-1522-4AEC-8CC3-4AFF2DC4B453@darkrainfall.org> Date: Sun, 2 Jan 2011 22:21:54 +0000 Message-ID: To: Rune Kaagaard Cc: internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: EBNF From: jond3k@gmail.com (Jon Davey) >> Nonetheless, it's a significant undertaking to deal with the complexity = of the language. There are dozens of tiny little edge cases in PHP's parsin= g that require bunches of extra parser rules. An example from above is the = difference between using "statement" and "inner-statement" for the two diff= erent forms of "if". Because "statement" includes basic blocks and labels, = the rule disallows writing "if: { xyz; } endif;", since apparently Zend doe= sn't support arbitrary basic blocks. All those cases wreak havoc on the gra= mmar. In its present form, it will never reduce down to something nearly as= small as Python's. > > Just to have a solid, complete maintained EBNF would be a _major_ leap fo= rward! > Having an EBNF would be useful in cases where we want to write something like Ruby's CoffeeScript. After looking at PHP's grammar file, it's about 1,000 lines long. Since this is used to generate the parser, isn't it possible to strip out the C macros to create an EBNF that catches all edge cases? Jon