echo off
REM This is the ANT-variant of generating XMI from some headers.
REM The advantage of ANT is: This file is shortenly and clearly in respect to the handled files, no algorithmus is interferingly.
REM But you can't see how does it work. You must study the called and used scripts if you want to know somewhat about it.
REM The usage of ANT is recommended, if other aspects of generation are also present.
REM An important feature of ANT is the testability if a file is newer or existing.
REM The algorithm is not executed if it is not necessary because the actual output is already present.

REM The princip of work is:
REM * ZmakeStd.bat converts the input file to an ANT.xml-script and starts ANT.
REM * The conversion of the input to ANT.xml use ZBNF parsing using zbnfjax/zbnf/ZmakeStd.zbnf.
REM   This script is independent of the concret problem Header2XMI.
REM * Because here zbnfCheader and genXmiFromZbnfCheader are used, the appropriate algorithm for ANT
REM   in zbnfjax/xsl/ZmakeStd.xslp are used.
REM * That algorithms are transported to the generated tmp/ant.xml
REM * You can visit the generated tmp/ant.xml to realize how does if work, in ANT syntax.

REM All script files are placed in a dir tree accessed via the environment variable ZBNFJAX_HOME.
REM Please install the zbnfjax toos, follow the zbnfjax/readme.html

set TMP_ZBNFJAX="tmp"
call zbnfjax zmake testHeader2XMI_Ant.bat
pause
exit

************************************************************************************************************
The own content is following now. Note that the file content from here is used not as batch file but as ZBNF input file.
Therefore after the keyword ZMAKE_RULES there is an other comment notation:

ZMAKE_RULES:
[?NOTE: this is a comment block. The /*...*/ is not useable because confusion with pathes. ?]
//NOTE: This is a comment to end-of-line.

//fileset as a variable. It will be transformed to a XML node.
$HeaderfilesForXmi = fileset
( Mystruct.h
);

//parsing all headerfiles using the named fileset. 
//The result is written to tmp/ with the source file name and the shown extension.
tmp/*.h.xml := zbnfCheader(target="CheaderXml", $HeaderfilesForXmi);

//XMI-Modell from all parsed headerfiles. The target which produces the xml from header have to be determined here.
test_ant.xmi := CHeaderXML2XMI
(srcpath="tmp"          //add this path to the files in the fileset
, srcext=".xml"         //add this extension to the file in the fileset
, $HeaderfilesForXmi    //use the fileset
);
