Re: [SMARTY] Smarty TAL Compiler

From: Date: Wed, 07 Aug 2002 21:15:52 +0000
Subject: Re: [SMARTY] Smarty TAL Compiler
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5617@lists.php.net to get a copy of this message
--- Raymond Penners <raymond@dotsphinx.com> wrote: > > ...but to recap, my dream is to create a smarty > > compiler that recognises TAL / TALES. My first > attempt > > used the php expat libraries for parsing the > template. > > I would like to see TAL for PHP as well. I tinkered > with it, and took a > different approach. I started looking into the > original Python code, and > thought of replacing python code with php code, > line by line. To me, > this seems like the easiest way to create a 100% > compatible TAL for PHP. > However, I ran into some difficulties. Python's > regular expressions seem > more powerful. They can be precompiled to byte code, > and it is possible > to retrieve the offset of the match. At the time, I > could not find a PHP > replacement for this, and stopped my experiment. I've only just started using Python and didn't know about the match offset stuff. Sounds like it might help. Another Python RE feature is that you can give names to subpatterns and refer to them by name rather than by number in backreferences. If have any other ideas about the tal parsing... -RichardW. ps Sorry to anyone who thinks this is off topic. __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com

« previous php.smarty.general (#5617) next »