TAAFT
Free mode
100% free
Freemium
Free Trial
Deals

C Recursive-Descent Parser

BaseMax / CRecursive-DescentParser

A simple recursive-descent parser for evaluating mathematical formulae using pure C.

3 0 Language: C License: GPL-3.0 Updated: 2y ago

README

C Recursive-Descent Parser

A simple recursive-descent parser for evaluating mathematical formulae using pure C.

Using

gcc main.c -o calc
./calc

Examples

calc> 5+4
9.000000
calc> 5-4
1.000000
calc> 5*4
20.000000
calc> 5/2
2.500000
calc> 5/0
runtime math error: cannot divide by zero
5.000000
calc> (5+4)
9.000000
calc> 5*(4-2)
10.000000
0 AIs selected
Clear selection
#
Name
Task