>> First, you seem to try to lex the PHP code yourself too. Why don't you
>> use PHP's internal lexing capabilities?
>
> I can't. This is documented in the README.
I should definitely have read your README first before answering ;)
But I don't quite get your argument in the README that the internal
lexer drops information. I just quick tried a
`var_dump(token_get_all("<?php ECHO"))` and it gave me the T_ECHO
token in exactly the case I wrote it (not lowercased). But okay, if
you want to support parsing of all version of PHP regardless of the
one you're running you will obviously need to write your own lexer,
you're right there.

>> For example you already
>> have at least one error in the little grammar you have: The opening
>> and closing tags should be filtered away before being passed to the
>> parser
>
> It's a feature, and it's documented in the README. There will be flags to
> instruct it to skip those tokens if desired - it's documented in the code.
That wasn't exactly what I meant. I meant to say that the opening and
closing tags can occur everywhere not just before and after a
statement list. They shouldn't be part of the grammar.

> Just as a side note: we do have a PHP grammar parser already in the
> Drupal community:
>
>  http://drupal.org/project/grammar_parser
>
> It has serialization and deserialization capabilities. It is
> independent of Drupal.
I just tried to use that parser, but running it against the Symfony
codebase seemed to crash the Apache process :(

Nikita

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

Reply via email to