ROSE Tutorial:
A Tool for Building
Source-to-Source Translators
Draft Tutorial
(version 0.9.5a)
Daniel Quinlan, Markus Schordan, Richard Vuduc, Qing Yi
Thomas Panas, Chunhua Liao, and Jeremiah J. Willcock
Lawrence Livermore National Laboratory
Livermore, CA 94550
925-423-2668 (office)
925-422-6278 (fax)
{dquinlan,panas2,liao6}@llnl.gov
markus@complang.tuwien.ac.at
qingyi@cs.utsa.edu
richie@cc.gatech.edu
jewillco@osl.iu.edu
Project Web Page: www.rosecompiler.org
UCRL Number for ROSE User Manual: UCRL-SM-210137-DRAFT
UCRL Number for ROSE Tutorial: UCRL-SM-210032-DRAFT Number for ROSE Source Code: UCRL-CODE-155962
ROSE User Manual (pdf)
ROSE Tutorial (pdf)
ROSE HTML Reference (html only)
May 2, 2011ii
May 2, 2011Contents
1 Introduction 1
1.1 What is ROSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Why you should be interested in ROSE . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Problems that ROSE can address . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Examples in this ROSE Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 ROSE Documentation and Where To Find It . . . . . . . . . . . . . . . . . . . . 10
1.6 Using the Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.7 Required Makefile for Tutorial Examples . . . . . . . . . . . . . . . . . . . . . . . 11
I Working with the ROSE AST 13
2 Identity Translator 15
3 Simple AST Graph Generator 19
4 AST Whole Graph 23
5 ...