@@-- This template is intended as a model of how to generate an Ada package @@-- describing all the variables used in a set of AWS templates. @@-- These Ada packages can then be used in your application to avoid @@-- hard-coded strings, and help maintain the templates and the code to @@-- parse them in sync. @@-- @@-- This template contains two possible behaviors, chosen through the @@-- following variable: @@SET@@ SINGLE_FILE = False @@-- If you set it to True, then a single Ada package with its nested @@-- packages is generated. If you set it to False, then the file generated @@-- should be further processed through gnatchop, to generate several @@-- Ada files organized into several files. This latter organization @@-- avoids recompiling all your source files every time at least one @@-- template changes. @@-- @@-- The following variable should be changed to set the name of the @@-- generated packages. @@SET@@ PACKAGE = Templates @@-- @@-- @@-- When designing your own template for Ada packages, you should take @@-- into account that the variables in your templates might not necessarily @@-- be valid Ada identifier names, and you should therefore update the calls @@-- to @_REPLACE:..._@ below. @@-- @@-- This template example also assumes a convention for Lazy_Tags. If you @@-- are using such types, they are generally shared among templates, and @@-- the Ada package should reflect that fact. Assuming all such tags start @@-- with the prefix LAZY_, we generate one special package for them, and @@-- omit them in all the other packages. @@-- @@-- Likewise, the templates2ada tool will not generate tag entries for tags @@-- that are set through a @@SET@@ statement, since these are purely internal @@-- to your template file and have no impact on your source code. @@-- @@-- For the best use of this tool, it is recommended that your template not @@-- use @@INCLUDE@@ statements, but instead use a tag, set in the Ada code @@-- to the preprocessed result of the same template file. This allows you to @@-- better control unset tags. For instance, instead of using: @@-- @@INCLUDE@@ foo.thtml @@-- use something like: @@-- @_BLOCK_FOO_@ @@-- and in your Ada code set BLOCK_FOO to the result of Parse ("foo.thtml"). @@-- @@-- The templates2ada tool is able to generate constants for the HTTP @@-- parameters set in your page, so that you can process them in your Ada @@-- code. A few conventions must be followed, however: @@-- - The name should be on a single line, preceded by "name=", as in @@-- name="FOO" @@-- - The name should use only letters, underscores and digits, unless you @@-- enhance the regular expressions below to also remove other special @@-- characters. @@-- - In some cases, you must use a AWS tag in the name of an HTTP param, @@-- for instance for checkboxes for which names should be unique (or you @@-- won't know when the parameter is set to false). In this case, the @@-- tag must be at the beginning or end of the name, not in the middle. @@-- If there are multiple tags, they should be separated by non-letters, @@-- as in: @@-- name="PN_@_TAG1_@:@_TAG2_" @@-- In this case, the following constant is generated: @@-- PN_Prefix : constant String := "PN"; @@-- - The name mustn't be only an AWS tag. The following is invalid: @@-- name="@_TAG_@" @@-- To avoid generating constants for , you must put the name @@-- attribute right after the "