Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ef55/tfl
A Terrible Front-end Library
https://github.com/ef55/tfl
dfa lexer lexing nfa parser parsing
Last synced: 8 days ago
JSON representation
A Terrible Front-end Library
- Host: GitHub
- URL: https://github.com/ef55/tfl
- Owner: Ef55
- License: bsl-1.0
- Created: 2021-08-04T22:47:59.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-16T20:56:31.000Z (over 3 years ago)
- Last Synced: 2024-11-13T06:42:56.664Z (about 2 months ago)
- Topics: dfa, lexer, lexing, nfa, parser, parsing
- Language: C++
- Homepage:
- Size: 438 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# TFL - A Terrible Front-end Library
TFL is a a lexing and parsing library which was meant to be as concise and simple as possible (thus terribly inefficient, hence the name), but outgrew its scope.
## Features
- Lexers using extended regexes for tokens specification:
- Derivative-based lexer, which is simple, but terribly slow;
- DFA-based lexer, which is fast, but needs some time to be built;
- Parser with a parser-combinator-like interface:
- "Brute force" recursive descent parser, which is terrible but accepts almost all Context-free grammars;
- Extras:
- DFA/NFA creation interface;
- Regex/DFA/NFA graph generation.## Documentation
The documentation can be generated using
`cmake --target Doc`
(requires [doxygen](https://www.doxygen.nl/index.html)).## Examples
This repository contains some examples showing how to use TFL:
- *Calculator*: a simple 1 file, < 150 lines example;
- *Graphs*: shows how dot graphs can be outputed and then made into pictures;
- *Json*: a "real world" use case;
- *Kaleidoscope*: is a more complex example taken from the [llvm tutorial](https://llvm.org/docs/tutorial/).