Skip to content
Snippets Groups Projects
README.md 1.99 KiB
Newer Older
  • Learn to ignore specific revisions
  • Ronald Charles Moore's avatar
    Ronald Charles Moore committed
    ========
    
    Everything here is taken from the slides for the "Compiler Construction"
    course, i.e. it is directly from Prof. Ronald C. Moore.
    
    Or at least, after all this time, I really don't remember having stolen
    this code from somewhere else, but if you find an older copy that looks
    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 
      ** `interpreter`  
         This code take mathematical expressions and evaluates them,
         i.e. it outputs numbers.
         
    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).
    
    
    Building and Running
    ====================
    
    Build the program by running `make`.
    
    In case of doubt, use the voodo command `make clean` and then repeat `make`.
    
    To test the program, run `make test`. This also illustrates how the intepreter is used.
    
    Alternatively, just run the program with *no* parameters (i.e. simply `./intepreter`). 
    It will tell you how it wants to be run.
    
    (Actually not quite true -- it doesn't tell you that you can run `./interpreter -`, 
    i.e. use a minus sign for an input file name. If you do that, the intepreter reads 
    its input from stdin. Useful for piping input to the program. Confusing when used 
    in the terminal interactively, because output is delayed until you least expect it).
    
    Contents (Manifest)
    ====================
    
    You should find here:
    
    * `interpreter.cpp`  
      The interpreter, all in one file. Bad style perhaps, but there it is!
          
    * `Makefile`
      Used to run make (obviously?).
          
    * `testInput.txt` and `testOutput.txt` 
      If you run `.interpreter testInput.txt` and get other output than 
      what you find in `testOutput.txt`, then something is wrong.
      This is exactly what `make test` does.
          
    * `README.md`  
      This file.
          
    
    Ronald Charles Moore's avatar
    Ronald Charles Moore committed
    Ronald Moore  
    https://fbi.h-da.de/personen/ronald-moore/  
    ronald.moore@h-da.de
     
    
    30 April 2020