Rockit problem

Ruby + Rockit gurus,

I am using ruby 1.7.2 (2002-07-02) [i386-mswin32]

Downloaded and installed Rockit (rockit-0-3-8.tar.gz) and Memoize
(memoize-0-1-2.tar.gz).

Ran the example Expression Grammar given at http://rockit.sourceforge.net/
(see code below)

Got the following errors:

     C:\tst_rockit.rb:35: warning: parenthesize argument(s) for future

version
C:/ruby/lib/ruby/site_ruby/resultcache.rb:5: warning: already
initialized constant BoundedLruCache
C:/ruby/lib/ruby/site_ruby/rockit/rockit.rb:24:in
generate_parser': undefined local variable or methodrockit_grammars_parser’ for Parse:Module (NameError) from
C:\tst_rockit.rb:3

What did I miss?

TIA,

– Shanko

#-------------------- tst_rockit.rb ---------------------------------

Example of using the rockit lib in Ruby code

require ‘rockit/rockit’

parser = Parse.generate_parser <<-'END_OF_GRAMMAR’
Grammar ExampleGrammar
Tokens
Blank = /\s+/ [:Skip]
Number = /\d+/
Productions
Expr -> Number [^]
> Expr ‘+’ Expr [Plus: left,,right]
> Expr ‘-’ Expr [Minus: left,
,right]
> Expr ‘*’ Expr [Mul: left,,right]
> Expr ‘/’ Expr [Div: left,
,right]
> ‘(’ Expr ‘)’ [^: ,expr,]
Priorities
left(Plus), left(Minus), left(Mul), left(Div)
Div = Mul > Plus = Minus
END_OF_GRAMMAR

def calc_eval(ast)
case ast.name
when "Plus"
calc_eval(ast.left) + calc_eval(ast.right)
when "Minus"
calc_eval(ast.left) - calc_eval(ast.right)
when "Mul"
calc_eval(ast.left) * calc_eval(ast.right)
when "Div"
calc_eval(ast.left) / calc_eval(ast.right)
when "Number"
ast.lexeme.to_i
end
end

calc_eval(parser.parse ‘(4*((2+6)-3))/2’) # => 10

···

#-------------------------------------------------------

Ok, after digging deeper I found out:

     C:/ruby/lib/ruby/site_ruby/resultcache.rb:5: warning: already
         initialized constant BoundedLruCache

This is due to two conflicting class definitions:

class BoundedLruCache # in rockit/bounded_lru_cache.rb
required by rockit
class BoundedLruCache < Hash # in site_ruby/resultcache.rb required
by Memoize

So how do I overcome this problem ?

Again, any help will be highly appreciated.
TIA,
– Shanko