3

I am writing a simple parser (in JavaScript, and, later, in Swift) to evaluate basic arithmetic expressions such as 1+2*3 and 3*(4+5).

I have a working version, but I would like to test whether it is reliable.

Is there a test suite of arithmetic expressions to run through my parser?

By way of context, I am writing my own parser rather than looking for a library or using built-in functionality such as eval. This is for the following reasons:

  • Experience
  • It allows me to parse expressions not normally acceptable in parsers such as 3(4+5), 2×3, √16 and , as well as the use of special variables
  • Experience
Manngo
  • 14,066
  • 10
  • 88
  • 110
  • I suppose if you intend to accept "expressions not normally acceptable in parsers", then you are unlikely to find an appropriate​ standard test suite :-) – rici Apr 04 '17 at 01:48

0 Answers0