Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 457 Bytes

README.md

File metadata and controls

29 lines (26 loc) · 457 Bytes

recursive-descent-parser

A recursive-descent parser in C, that evaluates arithmetic expressions

$ gcc parser.c -o parser
$ parser
> 3+9
12
> 10 * 4  * 2 * 3 / 8
30
> 5 - - - + - (3 + 4) - +2
10
> 2^10
1024

what does it do?

  • addition
  • subtraction
  • single-digit numbers
  • multi-digit numbers
  • multiplication
  • division
  • negation
  • parentheses
  • exponentiation
  • floating point
  • error handling