I have a rather clunky perl script for this, but in learning ruby I thought
I might see if there is an elegant way to parse this string using tokens.
Thank you for any help you might have.
You can build a lexer (what you want) and/or a parser with ruby
syntax that looks kind of like BNF.
But keep in mind the above is only the first release. I'm
building a ruby parser/lexer right now and doing this is
revealing various holes and inconsistencies in the API. The
basics of the API will remain unchanged though: "+" create a
sequence (from 2 grammars) and "|" will create an alternation
(from 2 grammars). The basic idea is that you start with base
grammar objects and you build more complex grammar objects
using various methods to combine or morph them.
···
--- Michael Zanis <mzanis@purdue.edu> wrote:
Hi,
I am new to ruby but have an okay background in perl. I am
trying to parse
a string into an array.
I have a rather clunky perl script for this, but in learning
ruby I thought
I might see if there is an elegant way to parse this string
using tokens.
Thank you for any help you might have.
-M
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005