main.anubis 2.61 KB
/**************************************************   
 * Project*    The 伝作 (Densaku) project                       
 *   
 * *Title*      Generating type and Muscle message with Anubis
 *   
 * *Copyright*  Copyright © David RENÉ 2017. 
 *
 *   
 * *Overview*  
 *  
 *  
 */   

/*
 * 
 * Created by PyramIDE.
 * User: フランスのトトロ aka (David RENÉ) 
 * Date: 15/01/2017
 * Time: 23:30
 * © Calexium 
 */

read densaku_lib/types/densaku.anubis
read generation/files.anubis

public define List(DS_Type) the_types_list =
  [
    ds_type("User_Account", [  
      alternative("account", [
        component(string, "first_name"),
        component(string, "last_name"),
        component(int,    "extension")
      ]),
      alternative("account_ext", [
        component(string, "first_name"),
        component(string, "last_name"),
        component(list,   int,    "extension_list")
      ]),      
      alternative("account_super_extended", [
        component(string, "first_name"),
        component(string, "last_name"),
        component(list,   int, "extension_list"),
        component(extern_type("DB_id", "calexium_lib/model/db_types.anubis"), "db_id")
      ])        
    ]),
    
    ds_type("Trunk_SIP", [  
      alternative("account", [
        component(string, "login"),
        component(string, "password"),
        component(string, "host")
      ])       
    ]),
    
    ds_type("HK_App", [
      alternative("hk_app", [
        component(string,                   "app_name",   comment("Name of the application")),
        component(ds_type("HK_Icon"),       "icon",       comment("Icon description")),
        component(ds_type("HK_Help_Text"),  "help"),
        component(list, ds_type("HK_Table"),"hk_tables")
      ])
    ]),
    ds_type("HK_Help_Text", [
      enum("no_help_text", comment("no help text available")),
      alternative("help_text_TAG",  [component(string, "tag_name", comment("TAG use with Anubis translation tool /locale/L3.anubis"))]),
      alternative("help_text",      [component(string, "help_text", comment("pure text to show"))])
    ]),
    ds_type("HK_Icon", [
      enum("no_icon"),
      alternative("icon16", [component(string, "name")])
    ]),    
  ].
  
 global define One 
  takaden
  (
    List(String) args        
  ) =
  if load_tk_generator is
  {
    failure         then  println("Takaden generator can't be load"),
    success(hk_gen) then  forget(tk_gen.generate_type_msg_files(the_type_msg_description, ""))
  }.

global define One
  densaku
  (
    List(String) args
  )=
  //print(dump_TK_Type_list(the_types_list)).
  forget(generate_message_files(the_types_list, "")).