Programming language: Go
License: GNU General Public License v3.0 or later

gocc alternatives and similar packages

Based on the "Other Software" category.
Alternatively, view gocc alternatives based on common mentions on social networks and blogs.

  • hugo

    The world’s fastest framework for building websites.
  • syncthing

    Open Source Continuous File Synchronization
  • Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
    Promo www.influxdata.com
    InfluxDB Logo
  • restic

    Fast, secure, efficient backup program
  • croc

    Easily and securely send things from one computer to another :crocodile: :package:
  • Gor

    GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
  • Seaweed File System

    DISCONTINUED. SeaweedFS is a fast distributed storage system for blobs, objects, files, and data lake, for billions of files! Blob store has O(1) disk seek, cloud tiering. Filer supports Cloud Drive, cross-DC active-active replication, Kubernetes, POSIX FUSE mount, S3 API, S3 Gateway, Hadoop, WebDAV, encryption, Erasure Coding. [Moved to: https://github.com/seaweedfs/seaweedfs]
  • limetext

    Open source API-compatible alternative to the text editor Sublime Text
  • rkt

    DISCONTINUED. An App Container runtime that integrates with init systems, is compatible with other container formats like Docker, and supports alternative execution engines like KVM.
  • toxiproxy

    :alarm_clock: :fire: A TCP proxy to simulate network and system conditions for chaos and resiliency testing
  • Comcast

    Simulating shitty network connections so you can build better systems.
  • LiteIDE

    LiteIDE is a simple, open source, cross-platform Go IDE.
  • confd

    Manage local application configuration files using templates and data from etcd or consul
  • drive

    Google Drive client for the commandline
  • nes

    NES emulator written in Go.
  • scc

    Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
  • Duplicacy

    A new generation cloud backup tool
  • heka

    DISCONTINUED. DEPRECATED: Data collection and processing made easy.
  • blocky

    Fast and lightweight DNS proxy as ad-blocker for local network with many features
  • fleet

    DISCONTINUED. A Distributed init System.
  • Docker

    Notary is a project that allows anyone to have trust over arbitrary collections of data
  • myLG

    Network Diagnostic Tool
  • Juju

    Orchestration engine that enables the deployment, integration and lifecycle management of applications at any scale, on any infrastructure (Kubernetes or otherwise).
  • snap

    DISCONTINUED. The open telemetry framework
  • Stack Up

    Super simple deployment tool - think of it like 'make' for a network of servers
  • GoBoy

    Multi-platform Nintendo Game Boy Color emulator written in Go
  • Documize

    Modern Confluence alternative designed for internal & external docs, built with Go + EmberJS
  • lgo

    Interactive Go programming with Jupyter
  • Circuit

    Circuit: Dynamic cloud orchestration http://gocircuit.org
  • GoDNS

    A dynamic DNS client tool that supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
  • borg

    Search and save shell snippets without leaving your terminal
  • vFlow

    Enterprise Network Flow Collector (IPFIX, sFlow, Netflow)
  • Plik

    Plik is a temporary file upload system (Wetransfer like) in Go.
  • shell2http

    Executing shell commands via HTTP server
  • peg

    Peg, Parsing Expression Grammar, is an implementation of a Packrat parser generator.
  • portal

    Portal is a quick and easy command-line file transfer utility from any computer to another.
  • Gokapi

    Lightweight selfhosted Firefox Send alternative without public upload. AWS S3 supported.
  • Go Package Store

    An app that displays updates for the Go packages in your GOPATH.
  • Postman

    CLI tool for batch-sending email via any SMTP server.
  • Leaps

    A pair programming service using operational transforms
  • Guora

    🖖🏻 A self-hosted Quora like web application written in Go 基于 Golang 类似知乎的私有部署问答应用 包含问答、评论、点赞、管理后台等功能
  • gfile

    Direct file transfer over WebRTC
  • sake

    :robot: sake is a task runner for local and remote hosts
  • Gebug

    Debug Dockerized Go applications better
  • mockingjay

    Fake server, Consumer Driven Contracts and help with testing performance from one configuration file with zero system dependencies and no coding whatsoever
  • ipe

    DISCONTINUED. An open source Pusher server implementation compatible with Pusher client libraries written in GO
  • yai

    Your AI powered terminal assistant.
  • woke

    Detect non-inclusive language in your source code.
  • GoNB

    GoNB, a Go Notebook Kernel for Jupyter
  • ide

    A Go code editor. With debugging and Autocomplete. 一个 Go 代码编辑器,具有 DEBUGGING 和 AUTOCOMPLETE
  • tcpprobe

    Modern TCP tool and service for network performance observability.

Do you think we are missing an alternative of gocc or a related project?

Add another 'Other Software' Package



Have a look at https://github.com/goccmack/gogll for scannerless GLL parser generation.


Build Status


Gocc is a compiler kit for Go written in Go.

Gocc generates lexers and parsers or stand-alone DFAs or parsers from a BNF.

Lexers are DFAs, which recognise regular languages. Gocc lexers accept UTF-8 input.

Gocc parsers are PDAs, which recognise LR-1 languages. Optional LR1 conflict handling automatically resolves shift / reduce and reduce / reduce conflicts.

Generating a lexer and parser starts with creating a bnf file. Action expressions embedded in the BNF allows the user to specify semantic actions for syntax productions.

For complex applications the user typically uses an abstract syntax tree (AST) to represent the derivation of the input. The user provides a set of functions to construct the AST, which are called from the action expressions specified in the BNF.

See the [README](example/bools/README) for an included example.

User Guide (PDF): Learn You a gocc for Great Good (gocc3 user guide will be published shortly)


  • First download and Install Go From http://golang.org/
  • Setup your GOPATH environment variable.
  • Next in your command line run: go get github.com/goccmack/gocc (go get will git clone gocc into GOPATH/src/github.com/goccmack/gocc and run go install)
  • Alternatively clone the source: https://github.com/goccmack/gocc . Followed by go install github.com/goccmack/gocc
  • Finally make sure that the bin folder where the gocc binary is located is in your PATH environment variable.

Getting Started

Once installed start by creating your BNF in a package folder.

For example GOPATH/src/foo/bar.bnf:

/* Lexical Part */

id : 'a'-'z' {'a'-'z'} ;

!whitespace : ' ' | '\t' | '\n' | '\r' ;

/* Syntax Part */

<< import "foo/ast" >>

Hello:  "hello" id << ast.NewWorld($1) >> ;

Next to use gocc, run:

cd $GOPATH/src/foo
gocc bar.bnf

This will generate a scanner, parser and token package inside GOPATH/src/foo Following times you might only want to run gocc without the scanner flag, since you might want to start making the scanner your own. Gocc is after all only a parser generator even if the default scanner is quite useful.

Next create ast.go file at $GOPATH/src/foo/ast with the following contents:

package ast

import (

type Attrib interface {}

type World struct {
    Name string

func NewWorld(id Attrib) (*World, error) {
    return &World{string(id.(*token.Token).Lit)}, nil

func (this *World) String() string {
    return "hello " + this.Name

Finally we want to parse a string into the ast, so let us write a test at $GOPATH/src/foo/test/parse_test.go with the following contents:

package test

import (

func TestWorld(t *testing.T) {
    input := []byte(`hello gocc`)
    lex := lexer.NewLexer(input)
    p := parser.NewParser()
    st, err := p.Parse(lex)
    if err != nil {
    w, ok := st.(*ast.World)
    if !ok {
        t.Fatalf("This is not a world")
    if w.Name != `gocc` {
        t.Fatalf("Wrong world %v", w.Name)

Finally run the test:

cd $GOPATH/src/foo/test
go test -v

You have now created your first grammar with gocc. This should now be relatively easy to change into the grammar you actually want to create or an existing LR1 grammar you would like to parse.


The Gocc BNF is specified [here](spec/gocc2.ebnf)

An example bnf with action expressions can be found [here](example/bools/example.bnf)

Action Expressions and AST

An action expression is specified as "<", "<", goccExpressionList , ">", ">" . The goccExpressionList is equivalent to a goExpressionList. This expression list should return an Attrib and an error. Where Attrib is:

type Attrib interface {}

Also, parsed elements of the corresponding bnf rule can be represented in the expressionList as "$", digit.

Some action expression examples:

<< $0, nil >>
<< ast.NewFoo($1) >>
<< ast.NewBar($3, $1) >>
<< ast.TRUE, nil >>

Contants, functions, etc. that are returned or called should be programmed by the user in his ast (Abstract Syntax Tree) package. The ast package requires that you define your own Attrib interface as shown above. All parameters passed to functions will be of this type.

For raw elements that you know to be a *token.Token, you can use the short-hand: $T0 etc, leading the following expressions to produce identical results:

<< $3.(*token.Token), nil >>
<< $T3, nil >>

Some example of functions:

func NewFoo(a Attrib) (*Foo, error) { ... }
func NewBar(a, b Attrib) (*Bar, error) { ... }

An example of an ast can be found [here](example/bools/ast/ast.go)

Release Notes for gocc 2.1


  1. no_lexer option added to suppress generation of lexer. See the user guide.

  2. Unreachable code removed from generated code.

Bugs fixed:

  1. gocc 2.1 does not support string_lit symbols with the same value as production names of the BNF. E.g. (t2.bnf):
A : "a" | "A" ;

string_lit "A" is not allowed.

Previously gocc silently ignored the conflicting string_lit. Now it generates an ugly panic:

$ gocc t2.bnf
panic: string_lit "A" conflicts with production name A

This issue will be properly resolved in a future release.


These projects use gocc: