ROSE Compiler Framework/Sandbox

< ROSE Compiler Framework

Some common tricks to write things on wikibooks/wikipedia (both are using the mediawiki software).

How to create a new pageEdit

Usually you have to start a new page from an existing wikipage.

Go to the wiki page you want to have a link to the new page you want to create

  • click the edit tab the existing page
  • at the place you want to have a link to the new page, use
     [[ROSE_Compiler_Framework/name of the page]]
  • If there is already a page with the desired name. It will become a link to the page.
  • If not, the link is red so you can click the red link to enter editing model to add content to the page.

Please link the new page to the print version of this wikibook so it can be visible in the print out.

How to do XYZ in wiki?Edit

The best way is to goto and find a page with the output you want. Then pretend to edit the page (by clicking edit) to see the source used to generate the output.

For example, you want to know how C++ syntax highlighting is obtained in wikibook. Go to and find the page for C++. There must be sample code snippet.

Then you pretend to edit it to see the source:

You will see the source code generating the syntax highlighting:

<source lang="cpp">

# include <iostream>

int main()
   std::cout << "Hello, world!\n";

How to add comments which are only visible to editor, not readers of a page?Edit

Use the HTML comments: for example, the following comment will not show up in the paper rendered. But it is visible to editor to reminder why things are done in certain way.

<!-- Please keep the pixel size to 400 so they are clean in the pdf version, Thanks!  -->
[[File:Rose-compiler-code-review-1.png|thumb|400px|Code review using]]

Syntax highlightingEdit

Copied from

<source lang="cpp">

# include <iostream>

int main()
   std::cout << "Hello, world!\n";

Can generate the following highlighted code:

# include <iostream>

int main()
   std::cout << "Hello, world!\n";

Math formulaEdit

You can pretend to edit this section to see how math formula are written.

More resources are at

\sum_{j=1}^N (Si,j) =1

 \log_2(n!) & = & \log_2(n) + \log_2(n-1) + \log_2(n-2) + ... + \log_2(1) \\
            &  &  \qquad \ \ \ \ \log_2(n) + \log_2(n) + \log_2(n) + ... + \log_2(n) \\
            &  &  \qquad \ \ \ \ \qquad \ \ \ \ \qquad \ \ \ \ \qquad \ \ \ \ \qquad \ \ \ \ \ \ \ n log_2(n)

\log_2(n!) &= \log_2(n) + \log_2(n-1) + \log_2(n-2) + ... + \log_2(1) \\
&< \log_2(n) + \log_2(n) + \log_2(n) + ... + \log_2(n) \\
&= n log_2(n)

  z        & = & a \\
  f(x,y,z) & = & x + y + z     

  \operatorname{erfc}(x) =
  \frac{2}{\sqrt{\pi}} \int_x^{\infty} e^{-t^2}\,dt =
  \frac{e^{-x^2}}{x\sqrt{\pi}}\sum_{n=0}^\infty (-1)^n \frac{(2n)!}{n!(2x)^{2n}}