@@ -10,13 +10,16 @@ similar, please let me know, so I can give credit where credit is due --
...
@@ -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).
or disavow knowledge of that source (as the case may be).
You are in the following subdirectory
You are in the following subdirectory
**`interpret++`
**`halfBakedCompiler`
This code take mathematical expressions and evaluates them,
This code take mathematical expressions and builds an abstract syntax tree,
i.e. it outputs numbers. It is the same as its sister folder `interpreter`
a.k.a. an AST. It then dumps this AST as text.
as far as recursive descent parsing goes, but uses more C++ features and
The parsing is equivalent to that in `interpreter` and `interpret++`
is set up so as to support growing up to be a larger project.
(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
Building and Running
====================
====================
...
@@ -30,7 +33,7 @@ In case of doubt, use the voodo command `make clean` and then repeat `make`.
...
@@ -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.
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).
It will tell you how it wants to be run (Hint: there are two usages).
Contents (Manifest)
Contents (Manifest)
...
@@ -38,6 +41,9 @@ Contents (Manifest)
...
@@ -38,6 +41,9 @@ Contents (Manifest)
You should find here:
You should find here:
*`ast.cpp` and `ast.h`
Source code for the AST classes -- the data structures built by the parser.