Skip to content

cjohansson/emacs-parser-generator

Repository files navigation

Emacs Parser Generator

License GPL 3 Build Status

The idea of this plugin is to provide functions for various kinds of context-free grammar parser generations with support for syntax-directed-translations (SDT) and semantic actions (SA) and the possibility of exporting parsers and translators (as generated stand-alone elisp code) to enable Emacs plugin-agnostic usage. This project is also about implementing algorithms described in the book The Theory of Parsing, Translation and Compiling (Volume 1) by Alfred V. Aho and Jeffrey D. Ullman (1972). Additional this project is about me learning how to parse programming languages.

At the moment it is possible to generate canonical LR(k) parsers using this library for complex languages like PHP 8.1.

Lexical Analysis

We use a regular-language based lexical analyzer that can be implemented by a finite-state-machine (FSM) that supports states. Read more here.

Syntax Analysis / Parser

We use deterministic push down transducer (DPDT) based algorithms. Read more here.

Test

Run in terminal make clean && make tests && make compile

TODO / Roadmap / Issues

Look here here.

About

A parser-generator library for Emacs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published