Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

664 Commits

Repository files navigation

Silverfly

CodeFactorNuGet VersionNuGet DownloadsLicense: MITDiscordLibraries.io SourceRank

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:

dotnet add package Silverfly

Usage

usingSilverfly;namespaceSample;publicclassProgram{publicstaticvoidMain(string[]args){while(true){Console.Write("> ");varinput=Console.ReadLine();varparsed=newExpressionGrammar().Parse(input);varcontext=newEvaluationContext();EvaluationListener.Listener.Listen(context,parsed.Tree);Console.WriteLine("> "+evaluated);}}}

For more detailed instructions and advanced usage, please refer to the wiki. A great example can be found here

Silverfly uses the brilliant library from MrKWatkins to build an AST.

Contributing

We welcome contributions! Please see our contributing guidelines for more details on how to get involved.

Releases

Sponsor this project

Used by

Contributors

Languages