whatisgithub

What is racc?

rubys/racc — explained in plain English

Analysis updated 2026-07-16 · repo last pushed 2021-04-01

Audience · developerComplexity · 3/5DormantLicenseSetup · easy

In one sentence

Racc is a Ruby tool that generates parsers for custom languages. You write grammar rules describing how your text should be structured, and Racc creates a Ruby program that reads and interprets that text for you.

Mindmap

mindmap
  root((repo))
    What it does
      Generates parsers
      Reads grammar rules
      Outputs Ruby code
    Tech stack
      Pure Ruby
      No C dependency
    Use cases
      Custom query languages
      Config file readers
      Formula engines
    Audience
      Language designers
      Parser builders
    Licensing
      Output is unencumbered
      Pure Ruby install

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a custom search query language that parses user input into structured commands.

USE CASE 2

Create a configuration file reader that validates and interprets custom file formats.

USE CASE 3

Generate a parser for a domain-specific language like a spreadsheet formula engine.

USE CASE 4

Parse complex structured text input so your program can act on it reliably.

What is it built with?

Ruby

How does it compare?

rubys/racc0verflowme/alarm-clock0xhassaan/nn-from-scratch
Stars0
LanguageCSSPython
Last pushed2021-04-012022-10-03
MaintenanceDormantDormant
Setup difficultyeasyeasymoderate
Complexity3/52/54/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Pure Ruby with no C dependencies makes installation straightforward, but you need to learn Racc's grammar syntax to write a working parser.

Parsers generated by Racc can be distributed under any license you choose, so Racc's own licensing does not restrict the code it produces.

So what is it?

Racc is a tool for Ruby programmers who need to teach their code how to understand structured text. If you're building something like a custom search query language, a configuration file reader, or even a programming language, you need a way to reliably break down the text a user types in and turn it into something your program can act on. Racc automates the hardest part of that process. At a high level, you write a file describing the rules of your language, what a valid "sentence" looks like, what pieces it's made of, and how those pieces fit together. Racc takes that description and writes a Ruby program for you that can read and interpret text according to those rules. It handles the tricky bookkeeping of figuring out which rule applies when, so you don't have to hand-code that logic yourself. The people who'd reach for this are developers building domain-specific languages, file format parsers, or tools that need to reliably parse complex input. For example, if you're creating a custom formula engine for a spreadsheet app, you'd define how arithmetic expressions, parentheses, and functions fit together, and Racc would generate the parser that actually evaluates user formulas. The project is written entirely in Ruby, which is somewhat notable, parser generators are often written in C for speed. The README doesn't go into detail about performance tradeoffs, but the fact that it's pure Ruby makes it easier to install and inspect. One practical detail worth noting: any parser Racc generates can be distributed under whatever license you choose, so you're not restricted by Racc's own licensing when you ship the code it produces.

Copy-paste prompts

Prompt 1
I want to use Racc to build a parser for a simple arithmetic formula language. Write me a Racc grammar file that handles addition, subtraction, multiplication, division, parentheses, and function calls like SUM(1, 2, 3).
Prompt 2
Help me set up a Racc grammar file for a custom search query language that supports field:value filters, AND/OR operators, and quoted strings. Show me the grammar rules and how to run Racc to generate the parser.
Prompt 3
I have a Racc grammar file ready. Walk me through the command to generate the Ruby parser from it and show me a minimal example of how to feed text into the generated parser and get back the parsed result.
Prompt 4
Using Racc, help me write a grammar for a simple configuration file format with key-value pairs, sections denoted by brackets, and comments starting with hash. Include the Racc grammar and a Ruby script to use the generated parser.

Frequently asked questions

What is racc?

Racc is a Ruby tool that generates parsers for custom languages. You write grammar rules describing how your text should be structured, and Racc creates a Ruby program that reads and interprets that text for you.

Is racc actively maintained?

Dormant — no commits in 2+ years (last push 2021-04-01).

What license does racc use?

Parsers generated by Racc can be distributed under any license you choose, so Racc's own licensing does not restrict the code it produces.

How hard is racc to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is racc for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.