Chapter 5. How to use generated code in Kermeta programs

Once your templates have been properly compiled into Kermeta files, you can call the generate(...) method into your main Kermeta code to generate the text.

package root_package;
require kermeta
require "templates/generator.kmt"
using kermeta::standard
using kermeta::utils
using hello_world
class Main{
operation main() : Void is do
	// Generator initialization
	var gen : Hello_World init Hello_World.new

	// Displays text generated on the console output
	stdio.writeln(gen.generate())
end
}