September 2017
Intermediate to advanced
240 pages
5h 57m
English
This challenge is to create a simple algebraic calculator using everything you’ve learned about parsing. You’ll need to devise a language for doing basic math with variables, create an ABNF for the language, and write the scanner, parser, analyzer, and interpreter for it. This may actually be overkill for a simple calculator language since there won’t be any nested structures like functions, but do it anyway to understand the full process.
A simple algebraic language can mean many things to different people, so I want you to play with the Unix command bc. Here’s an example of me running the bc command:
$ bc bc 1.06 Copyright 1991—1994, 1997, 1998, 2000 Free Software ...
Read now
Unlock full access