|
From: | Pascal J. Bourguignon |
Subject: | Re: Sample functions for String Parsers in Lisp |
Date: | Tue, 13 Oct 2009 14:47:40 +0200 |
User-agent: | Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) |
Nordlöw <per.nordlow@gmail.com> writes: > Has anybody any good sample code in elisp that shows how to > conveniently do parsing of code contained in a string? > > Reason: I am writing a parser that converts Emacs regexps (back) into > rx expressions. I need this for my file magic pattern matcher in order > to read as little data as possible from the file (locality) and do > several matchings in parallel. > > I think the main loop should be string-iteration-driven using while() > and aref() and length() I presume. > > Any suggestions?, 1- Read the Dragon Book. http://www.amazon.com/Compilers-Principles-Techniques-Alfred-Aho/dp/0201100886 2- Use a parser generator. http://cedet.sourceforge.net/info/semantic.html -- __Pascal Bourguignon__
[Prev in Thread] | Current Thread | [Next in Thread] |