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.
- 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.
To install Silverfly, you can use NuGet:
dotnet add package Silverfly
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 evaluated = parsed.Tree.Accept(new EvaluationVisitor());
Console.WriteLine("> " + evaluated);
}
}
}
For more detailed instructions and advanced usage, please refer to the Docs. A great example can be found here
We welcome contributions! Please see our contributing guidelines for more details on how to get involved.