About tokens, grammar and code generation

This season is about some calculator that I implemented. However, it is not about how amazing this software is 9it is not), it is about how the calculator does its job. Basically it has the same structure as the ULM assembler. It has a lexer, parser and code generator.

This is the actual purpose of this session:

  • Using this toy example prepares you for how I will describe the assembly language for the ULM assembler (and later the ULM C compiler).

  • And it prepares you for understanding the description of the programming language C (And yes, one should be able to use this documentation. At some point just doing programming by “let's see if the compiler knows what I mean” will be a dead end).

  • But it also should help you to understand and appreciate error messages!

Using the tools in this session requires to work on theon, and furthermore, your path has to contain /home/numerik/pub/bin. You can check the later one with:

theon$ echo $PATH
.:/home/numerik/lehn/bin:/opt/ulm/ballinrobe/cmd:/opt/ulm/ballinrobe/bin:/usr/bin:/usr/perl5/5.12/bin:/home/numerik/lehn/DocTool/Executables:/home/numerik/pub/bin/
theon$ 

Note that the PATH variable contains a lists of paths that are separated by a colon. These are the directories where the shell searches for an executable when you type in a command (also have a look at the Unix tutorials about that). The above output shows the value of my PATH variable. It contains /home/numerik/pub/bin at the end of this string. Also, you don't need to have exactly the same value, and neither would that make sense. My path contains directories to which you don't have access.