https://github.com/furesoft/Silverfly
Build parsers easily
https://github.com/furesoft/Silverfly
dsl dsl-syntax help-wanted parser parser-library parsing pratt pratt-parser pratt-parsing syntax syntax-tree
Last synced: about 2 months ago
JSON representation
Build parsers easily
- Host: GitHub
- URL: https://github.com/furesoft/Silverfly
- Owner: furesoft
- License: mit
- Created: 2023-05-11T07:23:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-14T18:35:48.000Z (about 2 months ago)
- Last Synced: 2025-11-15T16:25:29.889Z (about 2 months ago)
- Topics: dsl, dsl-syntax, help-wanted, parser, parser-library, parsing, pratt, pratt-parser, pratt-parsing, syntax, syntax-tree
- Language: C#
- Homepage: https://furesoft.gitbook.io/silverfly
- Size: 909 KB
- Stars: 23
- Watchers: 1
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-dotnet - Silverfly - A pratt parser library. (Parser Library / GUI - other)
- awesome-dotnet - Silverfly - A pratt parser library. (Parser Library / GUI - other)
- awesome-dotnet - Silverfly
README
# Silverfly
[](https://www.codefactor.io/repository/github/furesoft/silverfly)


[](https://opensource.org/licenses/MIT)


[](https://github.com/furesoft/Silverfly)
Silverfly is a versatile parsing framework that provides extensive support for building custom parsers with ease. It
supports Pratt parsing, a powerful method for parsing expressions and statements in a flexible manner.
## Features
- **Flexible Parsing**: Supports Pratt parsing for complex expression handling.
- **Extensible**: Easily extend the parser and lexer with custom rules.
- **Documentation**: Comprehensive instructions available in the wiki.
## Installation
To install Silverfly, you can use NuGet:
```bash
dotnet add package Silverfly
```
## Usage
```csharp
using Silverfly;
namespace Sample;
public class Program
{
public static void Main(string[] args)
{
while (true)
{
Console.Write("> ");
var input = Console.ReadLine();
var parsed = new ExpressionGrammar().Parse(input);
var context = new EvaluationContext();
EvaluationListener.Listener.Listen(context, parsed.Tree);
Console.WriteLine("> " + evaluated);
}
}
}
```
For more detailed instructions and advanced usage, please refer to
the [wiki](https://furesoft.gitbook.io/silverfly).
A great example can be found [here](https://github.com/furesoft/Silverfly/blob/main/Source/Samples/Sample.FuncLanguage/ExpressionGrammar.cs)
Silverfly uses the brilliant library from [MrKWatkins](https://github.com/MrKWatkins/Ast/) to build an AST.
## Contributing
We welcome contributions! Please see our contributing guidelines for more details on how to get involved.