apophis.Lexer 1.1.1

The lexer was exactracted from the simple arithmetic parser.

Install-Package apophis.Lexer -Version 1.1.1
dotnet add package apophis.Lexer --version 1.1.1
<PackageReference Include="apophis.Lexer" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add apophis.Lexer --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ArithmeticParser

Very Simple Proof of Concept Parser for Simple Arithmetic Expressions.

Build Status NuGet package

This is an example of Recursive Descent Parser which builds an Abstract Syntax Tree.

It also illustrates the usage of the Visitor Pattern to traverse the Syntax Tree.

Supported Operations:

  • Binary Operations
    • Addition
    • Subtraction
    • Multiplication
    • Division
    • Modula
    • Power
  • Function Calls
  • Variables
    • Constants

Sample Vistors include:

  • CalculateVisitor: calculates the result of the arithmetic expression as a double.
  • Parenthesizer: Several Visitors to create infix notation from a syntax tree.
  • RPN: Output as a postfix syntax tree also known as reverse polish notation
  • GraphViz: Visualize parse tree with GraphViz

Example 1

Some Simple Tests are included, but no exhaustive test suite, the Parser is intendet only as an academic example with a well designed architecture.

ArithmeticParser

Very Simple Proof of Concept Parser for Simple Arithmetic Expressions.

Build Status NuGet package

This is an example of Recursive Descent Parser which builds an Abstract Syntax Tree.

It also illustrates the usage of the Visitor Pattern to traverse the Syntax Tree.

Supported Operations:

  • Binary Operations
    • Addition
    • Subtraction
    • Multiplication
    • Division
    • Modula
    • Power
  • Function Calls
  • Variables
    • Constants

Sample Vistors include:

  • CalculateVisitor: calculates the result of the arithmetic expression as a double.
  • Parenthesizer: Several Visitors to create infix notation from a syntax tree.
  • RPN: Output as a postfix syntax tree also known as reverse polish notation
  • GraphViz: Visualize parse tree with GraphViz

Example 1

Some Simple Tests are included, but no exhaustive test suite, the Parser is intendet only as an academic example with a well designed architecture.

  • .NETStandard 2.1

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.1 70 7/24/2019
1.1.0 55 7/24/2019
1.0.1 63 7/19/2019
1.0.0 58 7/19/2019