On 5/30/05, Eric Mahurin <eric_mahurin / yahoo.com> wrote:
> --- Simon Strandgaard <neoneye / gmail.com> 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 ?


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

--
Simon Strandgaard