Child pages
  • Code Generation with Xtend

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As in the previous tutorial, add a menu contribution to the ...compiler.ui plug-in to make the code generation available in the interface. Since your code generation implementation is expected to work for arbitrary (valid) instances of the programming language model, your menu contribution should be available for all programming language models and their textual representations. (".imperative" and ".pseudo" files) As in the previous tutorial, your handler should create a new file in the same directory as the input file and refresh the folder afterwards to have the file show up in the project explorer.

Note
titleFile Names
When working on your menu contribution, think about how to name the files the generated code will be stored in. If your target language is C, the file name doesn't matter much (as long as it has the .c file extension). If your target language happens to be Java, however, the file name makes quite a bit of a difference...

Testing Your Implementation

...