Usage

Compile racc grammer file

To compile racc grammer file, simply type:


$ racc parse.y

This create ruby script file "parse.tab.y". -o option changes this.

Write racc grammer file

If you want your own parser, you have to write grammer file. A grammer file contains name of parser class, grammer the parser can parse, user code, and any.
When writing grammer file, yacc's knowledge is helpful. If you have not use yacc, also racc is too difficult.

grammer file is like this:


class Calcparser

rule
  target: exp { print val[0] }
        ;
  exp: exp '+' exp
     | exp '*' exp
     | '(' exp ')'
     | NUMBER
     ;
end

Racc grammer file is resembles to yacc file. (continue)
Copyright(c) 1998-1999 Minero Aoki <aamine@dp.u-netsurf.ne.jp>