Chapter 3. Code generation tools

3.1 Building generators with Ruby
3.2 Parsing XML with Rexml
3.3 ERb: a great tool for templates
3.4 Building the language parser toolkit
3.5 Summary

This chapter discusses the tools used in this book for developing code generators. Like any application, a code generator uses a set of generic tools to perform its function. In this chapter we examine the Ruby programming language itself, as well as a utility for reading XML, a text-template library, and a parsing toolkit for computer languages (C, C++, Java, and SQL). All of these tools will be used in the generators presented in this book. ...

Get Code Generation in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.