C-Programming-Tools Fourth Lecture: 14th June 2018, noon, LT308
d.white@imperial.ac.ukI have just given the fourth and final lecture of my first year lectures on C Tools, building a toolbox of useful tools, and the craft skills to use them effectively, in order to make C programming easier.
This final lecture covers the following single topic: Making Code Generator Tools easier - autogenerating parser and lexers.
- Building little languages easily by using parser generator and lexer generator tools (eg. the combination of Yacc/Bison, Lex/Flex, and datadec for Abstract Syntax Trees).
- Worked example of a tiny Haskell Subset.
- Code generator spits out C, so without noticing it we end up writing a compiler that translates a tiny subset of Haskell to C, along the way.
- Better yet, we only write 16% of the code and our tools write the rest.
- New thoughts on an alternative parsing technique.
- Conclusions: use tools as much as you can. choose ones you like; become expert in their use. build a toolkit of trusted tools. Build your own tools where necessary. Define your own little languages, use parser generator tools to help.
- Fourth Lecture Materials Here
Here are the lecture materials (slides and associated examples - of which there are many):
- Here are the full size lecture notes (PDF), ie. with one slide per page.
- Here are the 4-up lecture notes (PDF), ie. with 4 slides per page.
- And here's the C Tools tarball, as a gzipped tar file:
- Download this into your home directory,
- Then extract the contents via:
tar xzf c-tools-lecture4.tgz
- This creates a directory called
c-tools-lecture4
- Explore the
c-tools-lecture4
directory, I suggest you start with the top level README and Makefile.
d.white@imperial.ac.uk
Updated: June 2018Back to my C Tools Lectures Pages. ![]()
![]()