Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

un-tone/HtnCalc

Repository files navigation

Calculator application

Test

How to use

Run htncalc.exe and input expressions for calculation. For exit input "q" or "quit" command.

Supported features

  • Integer and decimal positive numbers
  • Arithmetic operations +, -, *, /
  • Brackets
  • abs() function

How it works

  1. ExpressionParser performs lexical analysis of an input string expression.
  2. PermutationsBuilder builds a terms tree considering sub-expressions priority with different "permutations services" which implements ITermPermuter interface. The order is important:
    1. BracketTermPermuter - distinguishes brackets
    2. FunctionTermPermuter - works with functions like abs(...)
    3. MulDivTermPermuter - for multiplication and division operations
    4. AddSubTermPermuter - for addition and subtraction operations
  3. ExpressionTreeBuilder builds an expression tree, consists of IExpressionNode elements which can calculate their own value.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages