Cactus example notes

From the 13 lines of code on the previous slice, Cactus generates

Haskell back-endC back-end
  • A Happy parser
  • An Alex lexer
  • Data types for the abstract syntax
  • A main program for testing
  • A Yacc parser
  • A flex lexer
  • Data types for the abstract syntax (.c and .h files)
  • A main program for testing
  • A Makefile
Cactus also supplies a generic show for abstract syntax trees.

The user needs to supply a function for converting the number strings to Int.