IC Compiler

Synopsis: The IC Compiler accepts an input file which characterizes an application and generates the customized source code of the IC Manager. The default input file is ic.dat produced by IC Builder. The IC Compiler can be recompiled using the make file "makefile.icc".
   Usage: icc [-d] input_file
        
     -d          generate source codes with embedded debugging messages
     input_file  characteristics of the application (default ic.dat)

   Output of icc:

     app.h, fuzzy.h, db_def.h, actions.c, ic_func2.c, and ic_func3.c.

   Format of the input_file: 

     Each definition type header must be prefixed by "$".
     All definition lines follow their definition type header without prefixed
     by any special character.
     A definition types must be ended with "%".
     A comment line must begin with "//".
     A space line is allowed.

     Supported definition types:

     1. Header "$MESSAGE" defines input and output messages of IC with
        definition format:
           message_name/message_id

        This definition type is to generate message definitions in "app.h",
        message array msg[] in "fuzzy.h", and function decode_msg()
        in "ic_func3.c".

     2. Header "$INCLUDE_FILE" allows the user to adds including files
        to app.h with definition format:
           file_name

     3. Header "$ACTION/AUTO_GEN:YES|NO" defines actions of IC with
        definition format:
           action_name/action_id[/function_name[/file_name]]

        This definition type is to generate action definitions in "app.h",
        function do_actions() and all action functions in "actions.c".
        If "actions.c" exists, the old "actions.c" will be moved to a backup
        file "actions.b*", for example, actions.b0, actions.b1....

        If AUTO_GEN equals YES, actions.c will be automatically generated
        by collecting specified file_names; otherwise, all the file_names
        will be ignored and the user has to provide an actions.c by himself.
        If AUTO_GEN equals YES but the file_name is not specified,
        a default template of the corresponding function will be
        inserted into the actions.c in stead.

     4. Header "$IC_ID" defines IC_IDs with definition format:
           name_of_ic_id/number

        This definition type is to generate ic_id definitions in "app.h"
        and function decode_ic() in "ic_func3.c".

        Note: ic_id EXTERNAL has been defined as -1 in "ic.h".

     5. Header "$MUST_FUNC/AUTO_GEN:YES|NO" defines functions that are
        necessary in IC Manager with definition format:
           func_group_name[/file_name]

        This definition type is to generate all functions of file "ic_func2.c".
        If "ic_func2.c" exists, the old "ic_func2.c" will be moved to a backup
        file "ic_func2.b*", for example, ic_func2.b0, ic_func2.b1....

        If AUTO_GEN equals YES, ic_func2.c will be automatically generated
        by collecting all functions in specified file_names; otherwise,
        all the file_names will be ignored and the user has to provide an
        ic_func2.c by himself.  If AUTO_GEN equals YES but file_name is not
        specified, a default template of the corresponding functions will be
        inserted into ic_func2.c in stead.

     6. *.tpl are the templates for  $MUST_FUNC.
        out_msg.tpl, predicat.tpl, inter_mm.tpl, and func_var.tpl are
        default templates for functional groups FILL_OUTPUT_MSG_GROUP,
        PREDICATE_GROUP, INTERNAL_MM_GROUP, and USER_DEFINE_FUNC_VAR_GROUP,
        respectively.  The customized functions should be called
        out_msg.c, predicat.c, inter_mm.c, and func_var.c.

        A default template for each group contains
           FILL_OUTPUT_MSG_GROUP: fill_content(), fill_itype()
           PREDICATE_GROUP: pred_match()
           INTERNAL_MM_GROUP: dump_internal_mm(), init_mm(),
                              save_mm(), restore_mm()
           USER_DEFINE_FUNC_VAR_GROUP: userdef_f(), userdef_v()
           FILL_OUTPUT_IC_GROUP: find_ic()

        It is recommended to copy and modify the default template functions for 
        each function group.

     7. action.tpl is the template for user-supplied action functions,
        one for each action.  The customized actions are stored
        in separate files such as a1.c, ..., a5.c.

     8. Header "$THRESHOLD" defines thresholds for fuzzy computation with
        definition format:
           ic_type/fuzzy_number

        Two arrays ic_type and threshold will be generated in "fuzzy.h".

        Note: Definition type "$THRESHOLD" is necessary for fuzzy IC.

     9. Header "DB_ACCESS" defined the access of database with definition format:
              view_name/database/tables/attributes/condition
              where tables = table [,table]*
                    attributes = attribute [,attribute]* 
                    conition is a predicate. 

        If database is "DEFAULT", it means to access the default database
        which is defined in the program.
        If attributes is "*", it is all attributes of the specified tables.
        If condition is "NULL", it means that the generated SQL has no condition.

        The definition will create a SQL command for the specified database:
 
           SELECT attributes
           FROM tables
           WHEN condition 

        File db_def.h will be generated.

    10. Use makefile.icc to compile the IC Compiler.  Usage:
        make -f makefile.icc

     Note: All definition types must be always specified except $IC_ID.