[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-dev
Subject:    [PEAR-DEV] [PEPr] Comment on PHP::Lexer
From:       "Louis Mullie" <louis () mulliemedia ! com>
Date:       2005-02-25 0:31:35
Message-ID: 20050225003135.25683.qmail () pb12 ! pair ! com
[Download RAW message or body]


Louis Mullie (http://pear.php.net/user/louism) has commented on the proposal for PHP::Lexer.

Comment:

Hello,
Thanks for your comment. The new version I just released also allows
callbacks, but optionally, and still returns a token stack at the end --
as for the naming, if you read the "about" section of the homepage, you'll
see that it is much more pertinent to call it "Lexer", now. 
How were nested tags handled in the  Simple Test lexer ? Or were they
handled at all ? I think it would be as good to do :
$grammar = new Lexer_Grammar;
$grammar->addRule("PRE", "<pre>.*?</pre>");
than do deal with states : the goal of the regex lexer is to be as simple
as possible.
> Now no other rules will be applied while inside the <pre /> tags
With this new version, the above regexp will match the most text, so the
<pre> will have priority and nothing else will be matched inside them.

I'm a total newbie to encodings -- is UTF-8 widely used in things
susceptible of being parsed by this lexer ?

>Does it support users providing regexes
>that contain parenthesis? I wonder 
>because the version I know escapes 
>these, to disable subpatterns and 
>prevent conflicts with the internal 
>regex subpatterns (had to hack it so I 
>could use lookbehinds / lookaheads and 
>setting regex options from inside the 
>expression).
The substr_count calls do just this - they calculate the number of
parentheses and an array that maps preg_match_all() key to token type is
created.

Regards,
Louis Mullie

Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=197

-- 
Sent by PEPr, the automatic proposal system at http://pear.php.net

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic