https://github.com/felipebz/flr
A lightweight Java library which provides everything required to analyse any piece of source code.
https://github.com/felipebz/flr
lexer parser static-analysis
Last synced: 5 months ago
JSON representation
A lightweight Java library which provides everything required to analyse any piece of source code.
- Host: GitHub
- URL: https://github.com/felipebz/flr
- Owner: felipebz
- License: lgpl-3.0
- Created: 2021-06-19T20:00:46.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-12-31T19:47:01.000Z (6 months ago)
- Last Synced: 2026-01-05T06:27:20.593Z (6 months ago)
- Topics: lexer, parser, static-analysis
- Language: Kotlin
- Homepage:
- Size: 7.23 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FLR
[](https://github.com/felipebz/flr/actions/workflows/build.yml)
[](https://sonarqube.felipebz.com/dashboard?id=com.felipebz.flr%3Aflr)
FLR is a lightweight Java library which provides everything required to analyse any piece of source code. Using FLR, you can quickly create a lexer, a parser, and some AST visitors to implement quality rules or compute measures.
FLR is a fork of [SonarSource Language Recognizer](https://github.com/SonarSource/sslr/).
## Features
Here are the main features of FLR:
* Easy integration and use
* Just add a dependency on a jar file (or several jars, according to what you want to use: lexer/parser, toolkit...)
* No special step to add to the build process
* No "untouchable" generated code
* Everything in Java
* Definition of grammar and lexer directly in code, using Java or Kotlin
* No break in IDE support (syntax highlighting, code navigation, refactoring, etc)
### FLR in action
If you want to start working with FLR, you must be familiar with the following standard concepts: Lexical Analysis, Parsing Expression Grammar and AST (Abstract Syntax Tree).
FLR also comes with a MiniC language which has been created to easily and simply test all FLR features. This MiniC language can be a good starting point for a beginner to understand how to implement/define the different mandatory layers to analyse a language:
* [Lexer](https://github.com/felipebz/flr/blob/main/flr-testing-harness/src/main/kotlin/com/felipebz/flr/test/minic/MiniCLexer.kt)
* [Grammar](https://github.com/felipebz/flr/blob/main/flr-testing-harness/src/main/kotlin/com/felipebz/flr/test/minic/MiniCGrammar.kt)
* [Parser](https://github.com/felipebz/flr/blob/main/flr-testing-harness/src/main/kotlin/com/felipebz/flr/test/minic/MiniCParser.kt)
* [Toolkit](https://github.com/felipebz/flr/blob/main/flr-testing-harness/src/main/kotlin/com/felipebz/flr/test/minic/MiniCToolkit.kt)