Ramble – a Ruby sentence generator

There was an interesting problem at work recently, where I basically wanted to generate a whole lot of C language expressions for testing purposes. Rather than generating them by hand, I wondered if I could somehow feed the C language grammar into a program and get most, if not all, possible valid expressions out of it. Of course, I knew that a syntactically valid program might not necessarily by semantically valid, but I figured that I could eliminate or transform those cases manually. So off I went, using this problem as an opportunity to write some Ruby code. The end … Continue reading Ramble – a Ruby sentence generator