>> 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 the two 
>> different forms of "if". Because "statement" includes basic blocks and 
>> labels, the rule disallows writing "if: { xyz; } endif;", since apparently 
>> Zend doesn't support arbitrary basic blocks. All those cases wreak havoc on 
>> the grammar. 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 
> forward!
>

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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to