From: Eric Mahurin Date: 2005-05-31T06:06:00+09:00 Subject: Re: cursor-0.6 --- Simon Strandgaard wrote: > On 5/30/05, Eric Mahurin wrote: > > --- Simon Strandgaard wrote: > [snip] > > > A grammar class sounds interesting.. > > > Any examples of usage ? > > > > I still don't have a first release of grammar. But, you > can > > look at the predecessor: > > > > > http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/138450 > > > > I changed the name from syntax to grammar because there is > > already a syntax package for syntax hilighting. > > > > The usage for the Grammar classes will be very similar. > Each > > type of Grammar is a derived class - Sequence, Alternation, > > Repeat, etc. === is used to match a Grammar against a > Cursor. > > And I also put stuff in String and Range to make creating a > > Grammar even easier. > > Have you any unittests for your syntax/grammar code ? Not yet. > Your === operator reminds me of my own #match methods, in > this file. > > http://rubyforge.org/cgi-bin/viewcvs.cgi/projects/regexp_engine/source/scanner_nodes.rb?rev=1.22&cvsroot=aeditor&content-type=text/vnd.viewcvs-markup Yes, this is quite similar. You, Caleb, and I look to have very similar code and needs - external iterators and pattern matches/parsers. __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/