Friday, February 5, 2010

Tooling to help you starting a code generator from an example - To go Further...

Few weeks ago Cedric Brun announced a new way to create in a few minutes a pragmatic code generator with Acceleo. He said that Acceleo provides a specific tooling to help you starting a code generator from an example :
  • the new file wizard with the option to initialize it with an existing file content
  • the search & replace smart completion to quickly transform the example to a real template we can apply on a model
  • the "for" closing brace completion auto-magically find a coherent place

Since his message, we have added several menu items to go further :
  • "Refactor > Extract As Template..." to create a new template with the selected text
  • "Source > As Protected Area..." to define a protected area where we can regenerate target files without losing any modification
  • "Quickfix" when an operation call doesn't compile, you can create a new template or a new query that make the compilation work

New Acceleo naming conventions

Acceleo 3.0 is coming soon... For your information, we will change the way we name everything to follow the new naming conventions of the MTL OMG standard. The main change is that the code generation file will be named "Module". To help you understand how to use the new Acceleo wizards, you have to know the following mappings :
  • An Acceleo 2.6 module will become an Acceleo 3.0 project
  • An Acceleo 2.6 template will become an Acceleo 3.0 module file
  • An Acceleo 2.6 script will become an Acceleo 3.0 template block