Skip to content

A simple demo app for Pratt parsing. Originally written in Java, ported into Go.

Notifications You must be signed in to change notification settings

obzva/bantam-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bantam-go

This is my little learn-by-doing project to demonstrate and understand the basic concept of Pratt parsing.

This app is a Go port of Bantam, originally written in Java.

If you want to see the full explanation, check out this awesome blog post by Bob Nystrom.

Making my Go version here, I tried to:

  • keep the original structure of the project
  • change some code to fit into idiomatic way of Go programming

Usage

Run the tests:

go run main.go

Project Structure

bantam-go/
├── tokentype/     # Token type definitions
├── token/         # Token structure
├── parser/        # Core parsing logic
├── parselet/      # Parsing rules for different expressions
├── lexer/         # Lexical analyzer
├── expression/    # Expression AST nodes
├── bantamparser/  # Bantam-specific parser configuration
└── main.go        # Test runner

Learning Resources

About

A simple demo app for Pratt parsing. Originally written in Java, ported into Go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages