The undcoumented scanner class in the regex module may interest you:
http://code.activestate.com/recipes/457664/

Alex

On Sun, Dec 6, 2009 at 3:32 AM, SmileyChris <smileych...@gmail.com> wrote:
> Because that link intrigued me, I challenged myself to write my own
> generic lexer & parser based on what I had read:
> http://gist.github.com/250128
>
>
>
> On Dec 6, 2:07 pm, Luke Plant <l.plant...@cantab.net> wrote:
>> On Saturday 05 December 2009 20:09:21 Luke Plant wrote:
>>
>> > I'm not likely to able to look at this before Tuesday.  If anyone
>> > wants to look at it, I think the right approach is something like
>> >  the following:
>> >http://effbot.org/zone/simple-top-down-parsing.htm
>> > (without the globals, obviously, they can be converted to instance
>> > variables/methods).
>>
>> Cancel that - I unexpectedly had free time this evening, and I
>> implemented this.  It's a nice replacement I think (credit to Vaughan
>> Pratt and Fredrik Lundh for the basic approach and Python
>> implementation respectively).  The new implementation is pretty much
>> the same length as the old one, and hopefully easier to read, with a
>> much smaller core parser.  Precedence is specified directly, rather
>> than implicitly, so it's much easier to check that it's the same as
>> Python's.
>>
>> Latest patch attached to this e-mail.
>>
>> Regards,
>>
>> Luke
>>
>> --
>> "Idiocy: Never underestimate the power of stupid people in large
>> groups." (despair.com)
>>
>> Luke Plant ||http://lukeplant.me.uk/
>>
>>  smartif_8.diff
>> 27KViewDownload
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-developers?hl=en.
>
>
>



-- 
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.


Reply via email to