C-Programming-Tools Fourth Lecture: 6th June 2019, noon, LT308


d.white@imperial.ac.uk

I 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):


d.white@imperial.ac.uk
Updated: 5th June 2019 
Back to my C Tools Lectures Pages.