From achambers.home at googlemail.com Mon Feb 25 21:50:44 2008 From: achambers.home at googlemail.com (Andy Chambers) Date: Mon, 25 Feb 2008 21:50:44 +0000 Subject: [cl-ppcre-devel] alternative to parse-string Message-ID: Hi Edi, I'm trying to write a lexer where one can use previously defined classes in subsequent regular expressions. For example you'd be able to do something like this.... (deflexer my-lexer (ws "[ \t\n]") (letter "[a-zA-Z]") (word (:greedy-repetition 0 nil letter))) To make this work, the deflexer macro substitutes letter for the parse-tree resulting from (parse-string "[a-zA-Z]"). I wrote this before realizing that parse-string was not exported. Is there another (more future-proof) way to get at the parse-tree for a regex in a way that it can be combined with other trees? Cheers, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Thu Feb 28 23:09:43 2008 From: edi at agharta.de (Edi Weitz) Date: Fri, 29 Feb 2008 00:09:43 +0100 Subject: [cl-ppcre-devel] alternative to parse-string In-Reply-To: (Andy Chambers's message of "Mon, 25 Feb 2008 21:50:44 +0000") References: Message-ID: On Mon, 25 Feb 2008 21:50:44 +0000, "Andy Chambers" wrote: > I'm trying to write a lexer where one can use previously defined > classes in subsequent regular expressions. For example you'd be > able to do something like this.... > > (deflexer my-lexer > (ws "[ \t\n]") > (letter "[a-zA-Z]") > (word (:greedy-repetition 0 nil letter))) > > To make this work, the deflexer macro substitutes letter for the > parse-tree resulting from (parse-string "[a-zA-Z]"). I wrote this > before realizing that parse-string was not exported. Is there > another (more future-proof) way to get at the parse-tree for a regex > in a way that it can be combined with other trees? I think it is pretty safe to assume that PARSE-STRING will remain as it is. I'll probably just export it in the next release. Cheers, Edi.