This image is for Programming Assignment of CS143 Compilers course from Stanford. You can find the course in edX and the website for this course. To get this image, run:
docker pull gkzhb/cs143-pa
Notice: This image does not contain the project files but provides the running environment.
You need to mount your cool project root (full path) to the path
/usr/class/cool
of this image:docker run -it -v <your-cool-path>:/usr/class/cool gkzhb/cs143-pa /bin/bashIn this way, you can use your preferred editors on your host machine to code.
Click here to download PA tarball
This image contains latest bison from Ubuntu 16.04 and compiled flex 2.5.39.
If you encounters the problem Undefined reference to 'yylex()'
in PA2, you need to add %option noyywrap
in Definition Section of cool.flex
.
You can find more info in g++ - Undefined reference to 'yylex()' - Stack Overflow
Besides, if you use flex 2.6, the solution at the beginning may be of no use. Remove the value of variable LIB
in Makefile
, in other words, remove -lfl
to solve this compiling error (also reference to Stack Overflow link above). But there is no guarantee that this will produce the correct program you want.