Re: [PHP-DEV] Re: EBNF

2011-01-04 Thread Rune Kaagaard
> 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 ed

Re: [PHP-DEV] Re: EBNF

2011-01-02 Thread 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 parsing >> that require bunches of extra parser rules. An example from above is the >> difference between using "statement" and "inner-statement" for

Re: [PHP-DEV] Re: EBNF

2011-01-02 Thread Rune Kaagaard
Hi Guilherme You wrote that Java spec? Cool! Also very nice example of the PHP EBNF! I think PHP needs a canonical one of those and that the parser should be rewritten to represent said EBNF. Thats what I'm dreaming of at least :) Cheers Rune On Sat, Jan 1, 2011 at 5:23 PM, guilhermebla...@gmail

Re: [PHP-DEV] Re: EBNF

2011-01-01 Thread guilhermebla...@gmail.com
As a final note, I'd like to mention that even PHP grammar being quite simple, it is light-years more complex (due to the lack of standardization) than other languages. You can compare this initial description I wrote to the Java Specification and get your own conclusions: http://java.sun.com/docs

Re: [PHP-DEV] Re: EBNF

2011-01-01 Thread guilhermebla...@gmail.com
Hi all, PHP grammar is far from being complex. It is possible to describe most of the syntax with a simple explanation. Example: * We can separate a program into several statements. * There're a couple of items that cannot be declared into different places (namespace, use), so consider them as to

[PHP-DEV] Re: EBNF

2011-01-01 Thread Rune Kaagaard
> There has never been a language grammar, so there's been nothing to refer to > at all. As for why no one's made one more recently, for fun I snagged the .l > and .y files from trunk and W3C's version of EBNF from XML. In two hours of > hacking away, I managed to come up with this sort-of begin

Re: [PHP-DEV] Re: EBNF

2011-01-01 Thread Gwynne Raskind
On Dec 31, 2010, at 6:54 AM, Enrico Weigelt wrote: >> After enviously looking at pythons grammar >> (http://docs.python.org/dev/reference/grammar.html) I keep feeling >> that PHP is missing out on a lot of interesting meta projects by not >> having an official EBNF. > ACK. PHP also misses a lot of

Re: [PHP-DEV] Re: EBNF

2010-12-31 Thread Stas Malyshev
Hi! But still I have to ask if I'm the only one thinking about this or is there something I'm being completely ignorant about? You're not the only one thinking about it. But so far nobody moved from thinking about it to actually doing it :) -- Stanislav Malyshev, Software Architect SugarCRM

Re: [PHP-DEV] Re: EBNF

2010-12-31 Thread Enrico Weigelt
* Rune Kaagaard wrote: > Dear internals > > After enviously looking at pythons grammar > (http://docs.python.org/dev/reference/grammar.html) I keep feeling > that PHP is missing out on a lot of interesting meta projects by not > having an official EBNF. ACK. PHP also misses a lot of other fundam

[PHP-DEV] Re: EBNF

2010-12-31 Thread Rune Kaagaard
Dear internals After enviously looking at pythons grammar (http://docs.python.org/dev/reference/grammar.html) I keep feeling that PHP is missing out on a lot of interesting meta projects by not having an official EBNF. Building your own PHP parser is _very_ hard and is PhD (Paul Biggar:) level st