next up previous
Next: Copyright notice Up: Compilers and Interpreters Previous: Reference Material

Subsections


Programming resources

The officially recommended environment for this course is Linux as provided by the Johnson 118 lab. Mac OS is also supported, but in order to use this environment make sure that you install the developer tools (both Xcode and the command line tools). Any other Unix environment should work as long as it provides GCC, GNU make, Flex, and Bison.

I have limited knowledge of Windows, but I have had reports that it is relatively easy to set up a suitable environment under Windows using Cygwin. The installation process is a bit arcane when it comes to dependencies, but contact me and I should be able to offer some advice on the matter.

Manual pages

The handouts will contain references of ``the manual page'' of some function or data structure. These manual pages can be obtained in any Unix-like environment (including Linux and Mac OS) using the command man. For example, to obtain the manual page of the function strtod open a terminal and type

man strtod
In some cases you may obtain the wrong manual page. For example, typing
man printf
will give you the manual page of the command printf rather than the documentation of the C function with the same name. That is because the manual pages are organized into sections, with Section 1 containing commands while most of the C functions that you will be using are in Section 3 (though some may be in Section 2). When the man command does not specify explicitly a section, the manual page of the first occurrence of the argument (starting with Section 1) will be displayed. In such cases an explicit section number can be specified as first argument. For example, the following command will reach the manual page of the C function printf (which resides in Section 3):
man 3 printf

For more details see the...manual page of man by typing in the following command:

man man

Flex resources

The Flex manual is normally maintained using GNU info rather than a manual page. This documentation can be obtained locally by typing in the following command in a terminal on a Linux system:

info flex
Alternatively, check out the on-line flex manual.

Flex is not exactly user friendly. If you put a space or newline in the wrong place, it will often just print ``syntax error'' with no line number or hint of what the true problem is. It may take some incursions into the manual, a little experimentation, and some patience to learn its shortcomings. Here are a few suggestions to help keep you sane:

Bison resources

The following brief introduction to Bison from Stanford should be more than enough to complete this assignment. If more information is needed then you should take a look at the official GNU Bison manual.

Miscellaneous resources


next up previous
Next: Copyright notice Up: Compilers and Interpreters Previous: Reference Material
Stefan Bruda 2016-04-24