Skip to content

An operator precedence climbing parser for a simple arithmetic grammar.

Notifications You must be signed in to change notification settings

ajkimberley/LogicPoint.PrecedenceClimbingParser

Repository files navigation

LogicPoint.PrecedenceClimbingParser

An operator precedence climbing parser for a simple arithmetic grammar.

This library demonstrates an implementation of the Precedence Climbing algorithm in C# for a basic grammar of arithmetic (supporting positive integers, brackets, addition, subtraction, multiplication, division and exponentiation). The two main aritlces which inspired and informed this demonstration were Parsing Expressions by Recursive Descent by Theodore Norvell (which is an excellent read for anyone interested how to deal with precedence and associativity in recursive descent parsers) and Parsing Expressions by Precedence Climbing by Eli Bendersky (which is an excellent primer and explanation on the precedence climbing algorithm).

I plan to expand this library handle a larger subset of arithmetic grammar (e.g., decimals and negative numbers) and also to eventually provide support for logical grammars.

About

An operator precedence climbing parser for a simple arithmetic grammar.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages