ROSE Tutorial:
A Tool for Building
Source-to-Source Translators
Draft Tutorial
(version 0.9.4a)
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)
November 1, 2009ii
November 1, 2009Contents
1 Introduction 1
1.1 Why you should be interested in ROSE . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Problems that ROSE can address . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Examples in this ROSE Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 ROSE Documentation and Where To Find It . . . . . . . . . . . . . . . . . . . . 9
1.5 Using the Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.6 Required Makefile for Tutorial Examples . . . . . . . . . . . . . . . . . . . . . . . 10
I Working with the ROSE AST 13
2 Identity Translator 15
3 Scopes of Declarations 17
3.1 Input For Examples Showing Scope Information . . . . . . . . . . . . . . . . . . 17
3.2 Generating the code ...