Racc is an LALR(1) parser generator. It is written in Ruby itself, and generates ruby programs.
Ruby HTML Yacc Other
Latest commit 1188016 Dec 1, 2016 @alexdowad alexdowad Pass through encoding comment from input to generated parser file
Ruby source files with funny weird characters may require an encoding
comment to run correctly. Since Racc grammar files contain embedded
Ruby code, encoding comments are just as important to them as to ordinary
Ruby source files.

So: respect any encoding comment which appears at the beginning of a
Racc grammar file. It must be the *first* line in the file.

Fixes GitHub issue #20.




Racc is a LALR(1) parser generator.
It is written in Ruby itself, and generates Ruby programs.

NOTE: Ruby 1.8+ comes with the Racc runtime module. You
can run your parsers generated by racc 1.4.x out of the


 *  Ruby 1.8+
(*) make and C compiler.


gem install:

  $ gem install racc

Testing Racc

Racc comes with a simple calculator. To compile this at the shell:

    $ racc -o calc sample/calc.y

This process takes few seconds (or less). Then type:

    $ ruby calc

... Does it work?

For details about Racc, see the HTML documents under 'doc.en/'
and sample grammar files under 'sample/'.


Racc is distributed under the terms of the GNU Lesser General
Public License version 2. Note that you do NOT need to follow
LGPL for your own parser (racc outputs). You can distribute those
files under any licenses you want.

Bug Reports

Any kind of bug reports are welcome.
If you find a bug in Racc, please email me. Your grammar file,
and debug output generated by "racc -g", will be helpful.

                                                    Minero Aoki