@ tefigel ########################################################################## # # 25 October 2004 - Copyright (c) so.mus.ar. s.a.s. - www.somusar.com # # Main tefigel script for this somusar/sopromach[tm] POC. # # This proof-of-concept is based on Giuseppe Naccarato's article # "Implement an IOM-Based Code Generator" (see # http://www.ftponline.com/javapro/2004_03/online/j2ee_gnaccarato_03_10_04/default.aspx # ) # ########################################################################## # Initialization: macro directories... set XML_MODEL=model.xml set MACRODIR=xml_jgen set XML_PARSEDIR=MACRODIR/xml_parse library MACRODIR # ...string concatenation operator... dash & # ...delimiters of hand-editable sections. set SAFE_AREA_BEGIN=// Editable-section-begin - set SAFE_AREA_END=// Editable-section-end # Read XML model and build a list of class associations new_list(association) set TARGET_TAG_PATH=/Association/ tag_file_process(XML_MODEL,XML_PARSEDIR) msg [ Association list contains: ~list_contents(association) ] # Read XML model and build a list of class descriptors new_list(class) set TARGET_TAG_PATH=/Class tag_file_process(XML_MODEL,XML_PARSEDIR) msg [ Class list contains: ~list_contents(class) ] msg # Generate code, one class at a time. Merge hand-modified .java file # with new .jgen generated file. for CLASS_ID=~list_contents(class) msg Generating class "CLASS_ID"... output CLASS_ID.jgen gen_class(CLASS_ID) file_merge/merge_file(CLASS_ID.java,CLASS_ID.jgen,SAFE_AREA_BEGIN,SAFE_AREA_END) msg endfor