@@ -10,13 +10,16 @@ similar, please let me know, so I can give credit where credit is due --
or disavow knowledge of that source (as the case may be).
You are in the following subdirectory
**`interpret++`
This code take mathematical expressions and evaluates them,
i.e. it outputs numbers. It is the same as its sister folder `interpreter`
as far as recursive descent parsing goes, but uses more C++ features and
is set up so as to support growing up to be a larger project.
**`halfBakedCompiler`
This code take mathematical expressions and builds an abstract syntax tree,
a.k.a. an AST. It then dumps this AST as text.
The parsing is equivalent to that in `interpreter` and `interpret++`
(neighboring directories and predecessor programs).
This version builds on `interpreter++` (and also requires C++17).
See **Chapter 1 Front End Construction**, Slides 21 and 22 (and please let me know when the inevitable day comes that these slide numbers are no longer correct).
See **Chapter 1 Front End Construction**, Slides 22-24
(and please let me know when the inevitable day comes
when these slide numbers are no longer correct).
Building and Running
====================
...
...
@@ -30,7 +33,7 @@ In case of doubt, use the voodo command `make clean` and then repeat `make`.
To test the program, run `make tests`. This also illustrates how the intepreter is used.
Alternatively, just run the program with *no* parameters (i.e. simply `./intepret++`).
Alternatively, just run the program with *no* parameters (i.e. simply `./halfbaker`).
It will tell you how it wants to be run (Hint: there are two usages).
Contents (Manifest)
...
...
@@ -38,6 +41,9 @@ Contents (Manifest)
You should find here:
*`ast.cpp` and `ast.h`
Source code for the AST classes -- the data structures built by the parser.