From RTSC-Pedia

Jump to: navigation, search
revision tip
—— LANDSCAPE orientation
[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 UTC

XDCspec - @Template

This module contributes configuration C code

Contents

Synopsis

 
@Template("templateFile")

Description

Modules that want to generate C code that is included in application can specify a template that is expanded in the context of the configuration model and its results are directly inserted into the configuration's generated .c file.

The template file is located using the same search algorithm as xdc.findFile(). So, templates can be located in other packages and will be found along the package path.

The template is expanded in the context of the configuration model as part of the generation phase and, as a result, has access to a fully populated and validated xdc.cfg.Program object. In addition, the following global variables are set:

this
the module object associated with this the template
$args
an array of length 1, where $args[0] is an absolute path to the template file itself
$out 
a java.io.PrintStream where all output is written; i.e., the output stream of the generated configuration .c output file

See also

XDCscript - Template-Body Contents of the template file
XDCscript - Template-Object.genFile Generate textual output file from a template
XDCscript - Template-Object.genStream Generate textual output stream from a template

[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 UTC
Copyright © 2008 The Eclipse Foundation. All Rights Reserved


Views
Personal tools
package reference