Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: Generate te...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 6 Topic 2369 of 2472
Post > Topic >>

Re: Generate text, given a regex

by "Russ Cox" <rsc@[EMAIL PROTECTED] > Apr 11, 2008 at 04:59 PM

> Nonetheless, it's an interesting exercise.  Will probably use it in a
> data structures course some time in the future.  If you want to
> implement the "obvious" recursive solution and still generate every
> possible string, you effectively need coroutines to do alternation.

Or lazy evaluation (same thing).  Doug McIlroy's functional pearl
"Enumerating the strings of regular languages" in JFP (preprint at
http://www.cs.dartmouth.edu/~doug/nfa.ps.gz)
gives elegant Haskell
code to generate texts both directly from the regular expression (the
grammar route) and from the equivalent automaton.

Russ
 




 6 Posts in Topic:
Generate text, given a regex
Midhat <midhatali@[EMA  2008-03-23 23:48:39 
Re: Generate text, given a regex
m.helvensteijn@[EMAIL PRO  2008-03-27 00:49:58 
Generate text, given a regex
Domenico Bianculli <do  2008-03-27 23:56:04 
Re: Generate text, given a regex
Gene <gene.ressler@[EM  2008-03-26 21:15:45 
Re: Generate text, given a regex
Gene <gene.ressler@[EM  2008-04-11 13:23:32 
Re: Generate text, given a regex
"Russ Cox" <  2008-04-11 16:59:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 2:54:27 CDT 2008.