Skip to content

pavponn/parser-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚙️ Parser Generator

MIT license Java CI with Maven

Summary

This program generates parser's sources from file with the LL(1) grammar for some language. Project's goal is to gain more understanding of how parser generators (like ANLTR, Bison, Happy) work.

It accepts file with LL(1) written in the format that is quite close to the one used in ANLTR (.g4 files).

Usage

Run Main providing location of the grammar file as an argument via console or you may simply place it into this source file.

Input grammar format is specified here.

Examples

Example Grammar File Generated Sources
Calculator calculator grammar calculator sources
Regular Expressions regex grammar regex sources
Pascal pascal grammar pascal sources

Test

Tested using JUnit 4.

Copyright

Pavel Ponomarev, 2020 (pavponn@gmail.com)

MIT License