<?
include("config.php");

$text = "<H1>" . NAME . " Specifications</H1>
<a name=\"data\"><H2>1. Data class generator specifications</H2></a>
<p>
This " . NAME ." File is constitued of 3 parts :

<H3>1.1 Options</H3>
<b>%class name</b> : where name represents the Class name to generate<br>
<b>%herit father</b> : class name herit from father<br>
<b>%namespace father</b> : give class namespace (for example : Test::Marmot)<br>
<b>%language name</b> : name can be one one the following : c++/java/eiffel<br>
<b>%debug</b> : when given, marmot give a verbose output<br>
<b>%assert</b> : add assert on vector and list (check bounds)<br>
<b>%template &lt;details&gt;</b> : details represents the template type, for example 
<b>%template &lt;Type, Type2&gt;</b><br>
</p>
<H3>1.2 C++/Java/... user code</H3> 
this code is added to generated file, it can contains include,
methods, variables...

<H3>1.3 Class Variable</H3>
you can add severals kind of variable : <br><br>
<b>%var type name(init_val)</b> : type represents the varible type 
(int, float, std::string, ...)<br>
This will generate a protected variable (<b>type _name</b>) and three
 public methods (example for C++) :<br><br>
<li>const type& get_name() const { return _name; }</li>
<li>type& get_name() { return _name; }</li>
<li>void set_name(const type& name) { _name = name; }</li>
<br>

<b>%var_list type name</b> : type represents the list type 
(int, float, std::string, ...)<br>
This will generate a protected variable (<b>std::list<type> _name</b>)
and four public methods (example for C++) :<br><br>
<li>const std::list<type>& get_name() const { return _name; }</li>
<li>std::list<type>& get_name() { return _name; }</li>
<li>void set_name(const std::list<type>& name) { _name = name; }</li>
<li>void add_name(const type& name) { _name.push_back(name); }</li>
<br>

<b>%var_vect type name</b> : type represents the vector type
(int, float, std::string, ...)<br>
This will generate a protected variable
(<b>std::vector<type> _name</b>) and six public methods (example for C++) :
<br><br>
<li>const std::vector<type>& get_name() const { return _name; }</li>
<li>std::vector<type>& get_name() { return _name; }</li>
<li>const type& get_name(unsigned int pos) const { return _name[pos]; }</li>
<li>type& get_name(unsigned int pos) { return _name[pos]; }</li>
<li>void set_name(const std::vector<type>& name) { _name = name; }</li>
<li>void add_name(const type& name) { _name.push_back(name); }</li>


<a name=\"xml\"><H2>2. XML parser generator specifications</H2></a>
This " . NAME ." File is constitued of 3 parts :

<H3>2.1 Options</H3>
<b>%backend type</b> : where type can be one of the following : 
(xerces-dom, xerces-sax, expat, libxml)<br>
<b>%dtd \"file\"</b> : file represent a dtd file for xml check<br>
<b>%gen_data file1 file2</b> : file1 and file2 are data file to generate, this
does not need to lauch " . NAME . " many times<br>
<b>%language name</b> : name can be one one the following : c++/java/eiffel<br>
<b>%debug</b> : output verbose information<br>
<H3>2.2 C++/Java/... user code</H3> 
this code is added to generated file, it can contains include,
methods, variables...

<H3>2.3 XML parser details</H3>
A " . NAME . " file has four main sections, show here with the appropriate
delimiters:
<pre>
OPTIONS

%{
  PROLOGUE
%}

TYPES

XML RULES
</pre>
Comments enclosed in `/* ... */' may appear in any of the sections.

<H4>2.3.1 PROLOGUE</H4>
The PROLOGUE section contains macro definitions and declarations of
functions and variables that are used in the actions in the XML 
rules.  These are copied to the beginning of the parser file so that
they precede the definition of rules.  You can use `#include' to
get the declarations from a header file.  If you don't need any C
declarations, you may omit the `%{' and `%}' delimiters that bracket
this section.

<H4>2.3.2 TYPES</H4>
The TYPES section contains node type. In some simple xml rules, you may
not need any declarations.<br><br>
Synthax of Type is :<br>
<b>%type type_name node_name</b><br>

<H4>2.3.3 XML RULES</H4>
A XML rule has the following general form:<br>
<pre>
result{1} : components ...
@read@
{ code statements }
@write@
{ code statements }
</pre>
where result is the name of the node, and components are various sub nodes 
name that are associates with this node.<br>
{a} is the number of node 'result' than can be found as child of a father.<br>
'a' can contains symbols : '&gt;', '&lt;', '&gt;=', '&lt;=', '||', '&&'<br>
For example '{5 || 10}', '{>=2}', '{<=10}'<br>
<li>@read@ code statements are executed when entering in 'result' node 
in a read XML parser</li>
<li>@write@ c++ statements are executed when entering in 'result' node 
in a write XML parser</li>

This blocs(@...@ {...}) are needed(at least one), you can have 
nodes with only @read@ or @write@.
<br><br>
sometimes, write blocs need a loop (many node to write), you can add a loop
between the '@write@' and the '{', For example :<br>
<pre>
example_node:
@write@
@for(unsigned int i = 0; i < \$father->get_vars().size(); i++)@
{
  //Code in this loop
}
</pre>

<H5>2.3.3.1 Read/Write node data and attributs</H5>

you can read/write atrtibut of a node with <b>@attribut_name@</b><br>
you can read/write node data with <b>\$data</b><br>
you can use father node (when there is a %type on father) 
with <b>\$father</b><br>
you can call Method of objet associted with current node with 
<b>\$\$</b><br><br>

<H3>2.4 Toolbox functions</H3>
" . NAME . " contains many functions to simply convertions : <br><br>
<li>int marmot::toInt(const std::string str);</li>
<li>float marmot::toFloat(const std::string str);</li>
<li>double marmot::toDouble(const std::string str);</li>
<li>bool marmot::toBool(const std::string str);</li>
<li>std::string marmot::toString(const float);</li>
<li>std::string marmot::toString(const int);</li>
<li>std::string marmot::toString(const double);</li>
<li>std::string marmot::toString(const bool);</li>
";
include("template.php");
?>
