Ignore:
Timestamp:
Jul 3, 2020, 7:19:17 PM (4 years ago)
Author:
coas-nagasima
Message:

ASP3, TINET, mbed を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/asp3_dcre/tecsgen/tecslib/core/generate.rb

    r321 r429  
    44#      Generator for TOPPERS Embedded Component System
    55
    6 #   Copyright (C) 2008-2016 by TOPPERS Project
     6#   Copyright (C) 2008-2019 by TOPPERS Project
    77#--
    88#   上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
     
    122122
    123123class Namespace
     124  @@domain_gen_factory_list = nil
    124125  def generate
    125126
     
    135136          return
    136137        end
     138        if instance_of? Region then
     139          @@domain_gen_factory_list = {}   # create hash
     140        end
    137141      end
    138142
     
    141145      gen_global_header
    142146
     147      if ( instance_of? Region ) && get_domain_type != nil then
     148        # p "*******************  domain_type: #{get_domain_type.get_name}  ****************"
     149        domain_type = get_domain_type
     150        if @@domain_gen_factory_list[ domain_type ] == nil then
     151          @@domain_gen_factory_list[ domain_type ] = self
     152          domain_type.gen_factory
     153        end
     154      end
     155     
    143156      # signature のコードを生成
    144157      @signature_list.each { |s|
     
    262275
    263276      f.print( "/* Descriptor for dynamic join */\n" )
    264       f.print( "#define Descriptor( signature_global_name )  DynDesc__ ## signature_global_name\n\n" )
     277      f.print( "#define Descriptor( signature_global_name )  DynDesc__ ## signature_global_name\n" )
     278      f.print( "#define is_descriptor_unjoined( desc )  ((desc).vdes==NULL)\n\n" )
    265279      endif_macro_only f
    266280    end
     
    454468      }
    455469    end
    456         f.print "       rm -f $(CELLTYPE_COBJS) $(TECSGEN_COBJS) $(PLUGIN_COBJS) $(OTHER_OBJS) $(TARGET) #{timestamp}\n"
     470          f.print "     rm -f $(CELLTYPE_COBJS) $(TECSGEN_COBJS) $(PLUGIN_COBJS) $(OTHER_OBJS) $(TARGET) #{timestamp}\n"
    457471    if $generating_region == @@root_namespace then
    458472      f.print " rm -rf $(GEN_DIR)\n"
     
    464478      f.print "tecs : $(PRE_TECSGEN_TARGET) $(TIMESTAMP) $(POST_TECSGEN_TARGET)\n\n"
    465479      f.print "$(TIMESTAMP) : $(TECS_IMPORTS)\n"
    466       f.print " $(TECSGEN) #{TECSGEN.subst_tecspath( $arguments, true )}\n"
     480      f.print " $(TECSGEN) #{TECSGEN.subst_tecspath( $arguments, true )}\n\n"
    467481      # f.print "       touch $(TIMESTAMP)\n\n"
    468 
    469482    else
    470483      f.print "tecs:\n"
     
    472485    end
    473486
     487    # tecsflow:, tcflow ターゲット
     488    if $generating_region.get_n_cells != 0 || $generating_region == @@root_namespace then
     489      f.print "#####  TECSFlow targets  #####\n"
     490    end
     491
     492    if Region.get_link_roots.length > 1 && $generating_region == @@root_namespace then
     493      tecsflow_target = "tecsflow_sub"
     494      if $generating_region.get_n_cells > 0 then
     495        f.print "tecsflow: tecs tecsflow_sub\n"
     496      else
     497        f.print "tecsflow:\n"
     498      end
     499      Region.get_link_roots.each {|region|
     500        if region.get_n_cells > 0 then
     501          f.print "\tcd #{region.get_global_name}; make tecsflow\n"
     502        end
     503      }
     504      f.print "\n"
     505    else
     506      tecsflow_target = "tecsflow"
     507    end
     508
     509    if $generating_region.get_n_cells != 0 then
     510      f.print "#{tecsflow_target} : $(GEN_DIR)/tecsgen.rbdmp tcflow\n"
     511      f.print "\ttecsflow -g $(GEN_DIR)\n\n"
     512      f.print "tecsflow_u : $(GEN_DIR)/tecsgen.rbdmp tcflow\n"
     513      f.print "\ttecsflow -g $(GEN_DIR) -U\n\n"
     514      f.print "$(GEN_DIR)/tecsgen.rbdmp : tecs\n\n"
     515      f.print "tcflow : tecs\n"
     516      f.print "\tmake tcflow_exec\n\n"
     517      f.print "tcflow_exec : $(GEN_DIR)/tcflow.rbdmp\n"
     518      f.print "$(GEN_DIR)/tcflow.rbdmp : $(CELLTYPE_SRCS) $(PLUGIN_CELLTYPE_SRCS)\n"
     519      f.print "\ttcflow -g $(GEN_DIR) -c '$(CC) -E -DTECSFLOW -DTECSGEN $(CFLAGS) -I ./' $^\n"
     520    end
     521
     522    if $generating_region.get_n_cells != 0 || $generating_region == @@root_namespace then
     523      f.print "#####  end TECSFlow targets  #####\n\n"
     524    end
     525
     526    # generic %.o : %.c
    474527    f.print "# generic target for objs\n"
    475528    f.print "$(_TECS_OBJ_DIR)%.o : %.#{$c_suffix}\n"
     
    491544    ### Makefile.tecsgen の生成
    492545    f = AppFile.open( "#{$gen}/Makefile.tecsgen" )
     546
     547    f.print <<EOT
     548# generated automatically by tecsgen.
     549# This file is not intended to modify.
     550#
     551# Makefile variables below are defined.
     552#  TECS_IMPORT_CDLS          .cdl files improted by import statement
     553#  SIGNATURE_HEADERS         .h files of signature
     554#  CELLTYPE_TECSGEN_HEADERS  .h files of celltype
     555#  CELLTYPE_FACTORY_HEADERS  .h files of celltype's factory
     556#  TECS_HEADERS              summary of .h files above
     557#  TECS_INLINE_HEADERS       .h files of celltype inline header
     558#  PLUGIN_INLINE_HEADERS     .h files of plugin generated inline header
     559#
     560#  TECS_COBJS                .o files of TECS
     561#                            = $(TECSGEN_COBJS)+$(PLUGIN_COBJS)+$(CELLTYPE_COBJS)
     562#                            = $(TECS_KERNEL_COBJS)+$(TECS_KERNEL_COBJS)+$(TECS_OUTOFDOMAIN_COBJS)
     563#                            = $(TECSGEN_domain_COBJS)+$(PLUGIN_domain_COBJS)+$(CELLTYPE_domain_COBJS) for each domain
     564#
     565#  TECSGEN_COBJS             .o files of celltype_tecsgen.c
     566#  CELLTYPE_COBJS            .o files of celltype.c (celltype code)
     567#  PLUGIN_COBJS              .o files of plugin generated .c files
     568#
     569#  TECSGEN_SRCS              .c files of celltype_tecsgen.c
     570#  CELLTYPE_SRCS             .c files of celltype.c (celltype code)
     571#  PLUGIN_SRCS               .c files of plugin generated
     572#  PLUGIN_CELLTYPE_SRCS      .c files of plugin generated celltype.c (celltype code)
     573#  PLUGIN_TECSGEN_SRCS       .c files of plugin generated celltype_tecsgen.c
     574#
     575# Variables for domain
     576#  TECS_DOMAINS             domain names
     577#  TECS_KERNEL_COBJS        .o files of kernel domain (tecsgen, celltype, plugin)
     578#  TECS_USER_COBJS          .o files of user domain (tecsgen, celltype, plugin)
     579#  TECS_OUTOFDOMAIN_COBJS   .o files of OutOfDomain (tecsgen, celltype, plugin)
     580#  TECSGEN_domain_COBJS     .o files of celltype_tecsgen.c files for each domain
     581#  PLUGIN_domain_COBJS      .o files of plugin generated .c files for each domain
     582#  CELLTYPE_domain_COBJS    .o files of celltype.c files for each domain
     583#  TECSGEN_domain_SRCS      .c files of celltype_domain_tecsgen.c
     584#  PLUGIN_domain_SRCS       .c files of plugin generated .c files for each domain
     585#  CELLTYPE_domain_SRCS     .c files of celltype.c files for each domain
     586
     587EOT
    493588
    494589    f.print( "TECS_IMPORT_CDLS =" )
     
    545640    DomainType.get_domain_regions.each{ |dt, regions|
    546641      # domain_type は一つのノードには、一つしかないので、このループは、必ず一回しか回らない
     642        ###   mikan 複数のノードがあり、異なる domain_type が指定される可能性はある
    547643      domain_regions = regions
    548644      domain_type = dt
     
    587683      f.print( "\n\n" )
    588684
    589       f.print( "# TECS_COBJS: objects from sources which are automatically generated by tecsgen\n" )
     685      f.print( "# TECS_KERNEL_COBJS: objects belong to kernel domain\n" )
     686      f.print( "TECS_KERNEL_COBJS = \\\n" )
     687      domain_regions.each{ |r|
     688        if r.get_domain_type.get_kind == :kernel then
     689          f.print( "    $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     690          f.print( "    $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     691          f.print( "    $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
     692        end
     693      }
     694      f.print( "# TECS_KERNEL_COBJS terminator\n\n" )
     695
     696      f.print( "# TECS_USER_COBJS: objects belong to user domain\n" )
     697      f.print( "TECS_USER_COBJS = \\\n" )
     698      domain_regions.each{ |r|
     699        if r.get_domain_type.get_kind == :user then
     700          f.print( "    $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     701          f.print( "    $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     702          f.print( "    $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
     703        end
     704      }
     705      f.print( "# TECS_USER_COBJS terminator\n\n" )
     706
     707      f.print( "# TECS_OUTOFDOMAIN_COBJS: objects belong to OutOfDomain\n" )
     708      f.print( "TECS_OUTOFDOMAIN_COBJS = \\\n" )
     709      domain_regions.each{ |r|
     710        if r.get_domain_type.get_kind == :OutOfDomain then
     711          f.print( "    $(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     712          f.print( "    $(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
     713          f.print( "    $(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
     714        end
     715      }
     716      f.print( "# TECS_OUTOFDOMAIN_COBJS terminator\n\n" )
     717     
     718      f.print( "# TECSGEN_COBJS: objects from sources which are automatically generated by tecsgen\n" )
    590719      f.print( "TECSGEN_COBJS = \\\n" )
    591720      domain_regions.each{ |r|
     
    621750
    622751    ###
    623     f.print( "# TECS_COBJS: objects from sources which are automatically generated by tecsgen\n" )
     752    f.print( "# TECSGEN_COBJS: objects from sources which are automatically generated by tecsgen\n" )
    624753    domain_regions.each{ |r|
    625754      nsp = decideDomainNameProc.call( r )
     
    655784
    656785    f.print( "# PLUGIN_SRCS: sources automatically generated by plugin\n" )
     786    f.print( "PLUGIN_CELLTYPE_SRCS = \\\n" )
    657787    domain_regions.each{ |r|
    658788      nsp = decideDomainNameProc.call( r )
    659       f.print( "PLUGIN#{nsp}_SRCS = \\\n" )
    660       gen_celltype_names_domain( f, "   $(GEN_DIR)/", "_tecsgen.#{$c_suffix} \\\n", domain_type, r, true )
    661       gen_celltype_names_domain2( f, "  $(GEN_DIR)/", ".#{$c_suffix} \\\n", domain_type, r, true, false )
    662       f.print( "# PLUGIN#{nsp}_SRCS terminator\n\n" )
    663     }
    664 
     789      f.print( "  $(PLUGIN#{nsp}_CELLTYPE_SRCS)\\\n" )
     790    }
     791    f.print( "# PLUGIN_CELLTYPE_SRCS terminator\n\n" )
     792    f.print( "PLUGIN_TECSGEN_SRCS = \\\n" )
     793    domain_regions.each{ |r|
     794      nsp = decideDomainNameProc.call( r )
     795      f.print( "  $(PLUGIN#{nsp}_TECSGEN_SRCS)\\\n" )
     796    }
     797    f.print( "# PLUGIN_TECSGEN_SRCS terminator\n\n" )
     798    domain_regions.each{ |r|
     799      nsp = decideDomainNameProc.call( r )
     800      f.print( "PLUGIN#{nsp}_SRCS = $(PLUGIN#{nsp}_CELLTYPE_SRCS) $(PLUGIN#{nsp}_TECSGEN_SRCS)\n\n" )
     801      f.print( "PLUGIN#{nsp}_CELLTYPE_SRCS = \\\n" )
     802      gen_celltype_names_domain2( f, "", ".#{$c_suffix} \\\n", domain_type, r, true, false )
     803      f.print( "# PLUGIN#{nsp}_CELLTYPE_SRCS terminator\n\n" )
     804      nsp = decideDomainNameProc.call( r )
     805      f.print( "PLUGIN#{nsp}_TECSGEN_SRCS = \\\n" )
     806      gen_celltype_names_domain( f, "", "_tecsgen.#{$c_suffix} \\\n", domain_type, r, true )
     807      f.print( "# PLUGIN#{nsp}_TECSGEN_SRCS terminator\n\n" )
     808    }
     809
     810    f.print( "# CELLTYPE_SRCS: sources of celltype code written by user\n" )
     811     f.print( "CELLTYPE_SRCS = \\\n" )
     812     gen_celltype_names( f, "   ", ".#{$c_suffix} \\\n", false, false )
     813      f.print( "# CELLTYPE_SRCS terminator\n\n" )
    665814    f.close
    666815
     
    762911  end
    763912
     913  #=== Namespace#すべてのシグニチャをたどる
     914  def travers_all_signature # ブロック引数 { |signature|  }
     915    proc = Proc.new    # このメソッドのブロック引数
     916    @signature_list.each{ |sig|
     917      proc.call sig
     918    }
     919    @namespace_list.each{ |ns|
     920      ns.travers_all_signature_proc proc
     921    }
     922  end
     923  def travers_all_signature_proc proc
     924    @signature_list.each{ |sig|
     925      proc.call sig
     926    }
     927    @namespace_list.each{ |ns|
     928      ns.travers_all_signature_proc proc
     929    }
     930  end
     931
     932  #=== Namespace#すべてのセルタイプをたどる
     933  def travers_all_celltype # ブロック引数 { |celltype|  }
     934    proc = Proc.new    # このメソッドのブロック引数
     935    @celltype_list.each{ |ct|
     936      proc.call ct
     937    }
     938    @namespace_list.each{ |ns|
     939      ns.travers_all_celltype_proc proc
     940    }
     941  end
     942  def travers_all_celltype_proc proc
     943    @celltype_list.each{ |ct|
     944      proc.call ct
     945    }
     946    @namespace_list.each{ |ns|
     947      ns.travers_all_celltype_proc proc
     948    }
     949  end
    764950end
    765951
     
    8541040      f.printf TECSMsg.get(:SDI_comment), "#_SDI_#"
    8551041      dl.each{ |dt,param|
    856         f.print "#include \"#{dt.get_signature.get_global_name}_tecsgen.#{$h_suffix}\"\n"
     1042        f.print <<EOT
     1043/* pre-typedef incomplete-type to avoid error in case of mutual or cyclic reference */
     1044#ifndef Descriptor_of_#{dt.get_global_name}_Defined
     1045#define  Descriptor_of_#{dt.get_global_name}_Defined
     1046typedef struct { struct tag_#{dt.get_global_name}_VDES *vdes; } Descriptor( #{dt.get_global_name} );
     1047#endif
     1048EOT
     1049#        f.print "#include \"#{dt.get_global_name}_tecsgen.#{$h_suffix}\"\n"
    8571050      }
    8581051      f.print "\n"
     
    9041097    end
    9051098
    906     f.print "};\n"
    907     f.printf "\n"
     1099    f.print "};\n\n"
    9081100    f.printf TECSMsg.get(:SDES_comment), "#_SDES_#"
    909     f.print( "typedef struct { struct tag_#{@global_name}_VDES *vdes; } Descriptor( #{@global_name} );\n" )
     1101    f.print <<EOT
     1102#ifndef Descriptor_of_#{@global_name}_Defined
     1103#define  Descriptor_of_#{@global_name}_Defined
     1104typedef struct { struct tag_#{@global_name}_VDES *vdes; } Descriptor( #{@global_name} );
     1105#endif
     1106EOT
    9101107  end
    9111108
     
    9931190    gen_ph_get_cellcb f
    9941191    gen_ph_attr_access f          if @n_attribute_rw > 0 || @n_attribute_ro > 0 || @n_var > 0
    995     gen_ph_cp_fun_macro f         if @n_call_port > 0
     1192    f.print "#ifndef TECSFLOW\n"
     1193    gen_ph_cp_fun_macro f, false  if @n_call_port > 0
     1194    f.print "#else  /* TECSFLOW */\n"
     1195    gen_ph_cp_fun_macro f, true   if @n_call_port > 0
     1196    f.print "#endif /* TECSFLOW */\n"
    9961197#    gen_ph_abstract_ep_des_type f
    9971198
     
    10081209#    gen_ph_ep_fun_prototype f
    10091210    gen_ph_ep_skel_prototype f
     1211
     1212    #--- CB_TYPE_ONLY の場合、ref_desc, set_desc 関数は含めない (マクロ参照するため)
     1213    if @n_entry_port_inline == 0 then
     1214      ifndef_cb_type_only f
     1215    end
     1216    gen_ph_ref_desc_func f
     1217    gen_ph_set_desc_func f
     1218    if @n_entry_port_inline == 0 then
     1219      endif_cb_type_only f
     1220    end
    10101221    end_extern_C f
    10111222    endif_macro_only f
     
    10191230    gen_ph_attr_access_abbrev f   if @n_attribute_rw > 0 || @n_attribute_ro > 0 || @n_var > 0
    10201231    gen_ph_cp_fun_macro_abbrev f  if @n_call_port > 0
     1232    gen_ph_ref_desc_macro_abbrev f
     1233    gen_ph_set_desc_macro_abbrev f
    10211234    gen_ph_test_optional_call_port_abbrev f
    10221235    gen_ph_ep_fun_macro f         if @n_entry_port > 0
     
    10841297          end
    10851298        }
     1299        if p.is_dynamic? then
     1300          f.print( "#undef #{p.get_name}_set_descriptor\n" )
     1301          if p.is_optional? then
     1302            f.print( "#undef #{p.get_name}_unjoin\n" )
     1303          end
     1304        elsif p.is_ref_desc? then
     1305          f.print( "#undef #{p.get_name}_refer_to_descriptor\n" )
     1306          f.print( "#undef #{p.get_name}_ref_desc\n" )
     1307        end
    10861308      }
    10871309      @port.each { |p|
     
    11961418  def gen_ph_info f
    11971419
     1420    yn_multi_domain = "no"
     1421    yn_multi_domain = "yes" if multi_domain?
    11981422    yn_idx_is_id = "no"
    11991423    yn_idx_is_id = "yes"  if @idx_is_id
     
    12041428    yn_rom       = "no"
    12051429    yn_rom       = "yes"  if $rom
     1430    yn_has_CB    = "no"
     1431    yn_has_CB    = "yes"  if has_CB?
     1432    yn_has_INIB  = "no"
     1433    yn_has_INIB  = "yes"  if has_INIB?
    12061434    yn_cb_init   = "no"
    12071435    yn_cb_init   = "yes"  if need_CB_initializer?
     
    12121440 * celltype          :  #{@name}
    12131441 * global name       :  #{@global_name}
     1442 * multi-domain      :  #{yn_multi_domain}
    12141443 * idx_is_id(actual) :  #{yn_idx_is_id}(#{yn_idx_is_id_act})
    12151444 * singleton         :  #{yn_singleton}
    1216  * has_CB            :  #{has_CB?}
    1217  * has_INIB          :  #{has_INIB?}
     1445 * has_CB            :  #{yn_has_CB}
     1446 * has_INIB          :  #{yn_has_INIB}
    12181447 * rom               :  #{yn_rom}
    12191448 * CB initializer    :  #{yn_cb_init}
     
    14381667      end
    14391668
    1440       if p.get_array_size == nil then
    1441         f.print( "#define #{@global_name}_is_#{p.get_name}_joined(p_that) \\\n" )
    1442       else
    1443         f.print( "#define #{@global_name}_is_#{p.get_name}_joined(p_that,subscript) \\\n" )
    1444       end
     1669      if @singleton then
     1670        param = ""
     1671        delim = ""
     1672      else
     1673        param = "p_that"
     1674        delim = ","
     1675      end
     1676      if p.get_array_size != nil then
     1677        param = param + delim + "subscript"
     1678      end
     1679      f.print( "#define #{@global_name}_is_#{p.get_name}_joined(#{param}) \\\n" )
    14451680
    14461681      if p.is_omit? then
     
    14521687      # mikan  全部つながっているかどうかで (1) を判定する
    14531688      if ! p.is_VMT_useless? then
     1689        if p.is_dynamic? then
     1690          if @singleton then
     1691            inib_tmp = "CB"
     1692          else
     1693            inib_tmp = ""
     1694          end
     1695        else
     1696          inib_tmp = inib
     1697        end
     1698
    14541699        # 標準コード
    14551700        if p.get_array_size == nil then
    14561701          if @singleton then
    1457             f.print( "\t  (#{@global_name}_SINGLE_CELL_#{inib}.#{p.get_name}!=0)\n" )
     1702            f.print( "\t  (#{@global_name}_SINGLE_CELL_#{inib_tmp}.#{p.get_name}!=0)\n" )
    14581703          else
    1459             f.print( "\t  ((p_that)#{inib}->#{p.get_name}!=0)\n" )
     1704            f.print( "\t  ((p_that)#{inib_tmp}->#{p.get_name}!=0)\n" )
    14601705          end
    14611706        else
    14621707          # 配列の場合
    14631708          if @singleton then
    1464             f.print( "\t  ((#{@global_name}_SINGLE_CELL_#{inib}.#{p.get_name}!=0) \\\n" )
    1465             f.print( "\t  &&(#{@global_name}_SINGLE_CELL_#{inib}.#{p.get_name}[subscript]!=0))\n" )
     1709            f.print( "\t  ((#{@global_name}_SINGLE_CELL_#{inib_tmp}.#{p.get_name}!=0) \\\n" )
     1710            f.print( "\t  &&(#{@global_name}_SINGLE_CELL_#{inib_tmp}.#{p.get_name}[subscript]!=0))\n" )
    14661711          else
    1467             f.print( "\t  (((p_that)#{inib}->#{p.get_name}!=0)\\\n" )
    1468             f.print( "\t  &&((p_that)#{inib}->#{p.get_name}[subscript]!=0))\n" )
     1712            f.print( "\t  (((p_that)#{inib_tmp}->#{p.get_name}!=0)\\\n" )
     1713            f.print( "\t  &&((p_that)#{inib_tmp}->#{p.get_name}[subscript]!=0))\n" )
    14691714          end
    14701715        end
     
    15031748      end
    15041749
     1750      if @singleton then
     1751        param = ""
     1752        delim = ""
     1753      else
     1754        param = "p_cellcb"
     1755        delim = ","
     1756      end
     1757
    15051758      if p.get_array_size == nil then
    1506         f.print( "#define is_#{p.get_name}_joined()\\\n\t\t#{@global_name}_is_#{p.get_name}_joined(p_cellcb)\n" )
    1507       else
    1508         f.print( "#define is_#{p.get_name}_joined(subscript)\\\n" )
    1509         f.print( "\t\t#{@global_name}_is_#{p.get_name}_joined(p_cellcb,subscript)\n" )
    1510       end
     1759        subscript = ""
     1760      else
     1761        subscript = "subscript"
     1762        param = param + delim + subscript
     1763      end
     1764      f.print( "#define is_#{p.get_name}_joined(#{subscript})\\\n\t\t#{@global_name}_is_#{p.get_name}_joined(#{param})\n" )
    15111765    }
    15121766  end
     
    15191773      f.print( "#define #{@global_name}_GET_CELLCB(idx) ((void *)0)\n" )
    15201774    elsif @idx_is_id_act then   # mikan 単一のセルの場合の最適化, idx_is_id でない場合
    1521       f.print( "#define #{@global_name}_GET_CELLCB(idx) (#{@global_name}_CB_tab[(idx) - #{@global_name}_ID_BASE])\n" )
     1775      f.print( "#define #{@global_name}_GET_CELLCB(idx) (#{@global_name}_CB_ptab[(idx) - #{@global_name}_ID_BASE])\n" )
    15221776    else
    15231777      f.print( "#define #{@global_name}_GET_CELLCB(idx) (idx)\n" )
     
    17231977  end
    17241978
    1725   def gen_ph_cp_fun_macro f
    1726     if @n_call_port >0 then
     1979  def gen_ph_cp_fun_macro f, b_flow
     1980    if @n_call_port >0 && b_flow == false then
    17271981      f.printf( TECSMsg.get( :CPM_comment ) , "#_CPM_#" )
    1728     end
    1729 
    1730     if @singleton then
    1731       if has_INIB? then
    1732         inib = "INIB"
    1733       else
    1734         inib = "CB"
    1735       end
    1736     else
    1737       if has_CB? && has_INIB? then
    1738         inib = "->_inib"
    1739       else
    1740         inib = ""
    1741       end
    17421982    end
    17431983
     
    17471987
    17481988      p.get_signature.get_function_head_array.each{ |fun|
     1989        if @singleton then
     1990          if has_INIB? then
     1991            inib = "INIB"
     1992          else
     1993            inib = "CB"
     1994          end
     1995          if p.is_dynamic? && p.get_array_size == nil then
     1996            # dynamic call port (not array)
     1997            inib = "CB"
     1998          end
     1999        else
     2000          if has_CB? && has_INIB? then
     2001            inib = "->_inib"
     2002          else
     2003            inib = ""
     2004          end
     2005          if p.is_dynamic? && p.get_array_size == nil then
     2006            # dynamic call port (not array)
     2007            inib = ""
     2008          end
     2009        end
     2010
    17492011        f.print( "#define #{@global_name}_#{p.get_name}_#{fun.get_name}(" )
    17502012        ft = fun.get_declarator.get_type
     
    17722034
    17732035        # 関数名の出力(標準:受け口ディスクリプタから VMT の関数名、最適化:受け口関数 or 受け口ディスクリプタ)
    1774         if ! p.is_VMT_useless? then
     2036        if b_flow then
     2037          f.print( "\t  (p_that)->#{p.get_name}#{subsc}.#{fun.get_name}__T( \\\n" )
     2038        elsif ! p.is_VMT_useless? then
    17752039          # 標準コード
    17762040          if @singleton then
     
    18072071
    18082072        # 受け口情報の出力(標準:受け口ディスクリプタ、最適化:IDX など)
    1809         if ! p.is_skelton_useless? && ! p.is_cell_unique? then
     2073        if b_flow then
     2074        elsif ! p.is_skelton_useless? && ! p.is_cell_unique? then
    18102075          # 標準コード
    18112076          if @singleton then
     
    18572122  end
    18582123
     2124  #=== ref_desc 指定された呼び口に対するディスクリプタ参照関数の生成
     2125  def gen_ph_ref_desc_func f
     2126    if @n_call_port_ref_desc >0 then
     2127      f.printf( TECSMsg.get( :CRD_comment ), "#_CRD_#" )
     2128    end
     2129
     2130    if has_CB? && has_INIB? then
     2131      inib = "->_inib"
     2132    else
     2133      inib = ""
     2134    end
     2135    @port.each { |p|
     2136      next if p.get_port_type != :CALL
     2137      next if ! p.is_ref_desc?
     2138
     2139      if @singleton then
     2140        p_that = ""
     2141        p_cellcb = ""
     2142        delim = ""
     2143        if has_INIB? then
     2144          cb = "#{@global_name}_SINGLE_CELL_INIB."
     2145        else
     2146          cb = "#{@global_name}_SINGLE_CELL_CB."
     2147        end
     2148      else
     2149        p_that = "#{@global_name}_CB  *p_that"
     2150        p_cellcb = "    #{@global_name}_CB *p_cellcb = p_that;\n"
     2151        delim = ", "
     2152        cb = "p_cellcb#{inib}->"
     2153      end
     2154
     2155      if p.get_array_size
     2156        array = "#{delim}int_t  i "
     2157        array2 = "[ i ]"
     2158        assert = "    assert( 0 <= i && i < NCP_#{p.get_name} );\n"
     2159      else
     2160        array = ""
     2161        array2 = ""
     2162        assert = ""
     2163      end
     2164      f.print <<EOT
     2165/* [ref_desc] #{p.get_name} */
     2166Inline Descriptor( #{p.get_signature.get_global_name} )
     2167#{@global_name}_#{p.get_name}_refer_to_descriptor( #{p_that}#{array} )
     2168{
     2169    Descriptor( #{p.get_signature.get_global_name} )  des;
     2170#{p_cellcb}    /* cast is ncecessary for removing 'const'  */
     2171#{assert}    des.vdes = (struct tag_#{p.get_signature.get_global_name}_VDES *)#{cb}#{p.get_name}#{array2};
     2172    return des;
     2173}
     2174
     2175EOT
     2176    }
     2177  end
     2178
     2179  #=== dynamic 指定された呼び口に対するディスクリプタ設定関数の生成
     2180  def gen_ph_set_desc_func f
     2181    if @n_call_port_dynamic >0 then
     2182      f.printf( TECSMsg.get( :SDF_comment ), "#_SDF_#" )
     2183    end
     2184
     2185    @port.each { |p|
     2186      next if p.get_port_type != :CALL
     2187      next if ! p.is_dynamic?
     2188      if has_CB? && has_INIB? && p.get_array_size then
     2189        inib = "->_inib"
     2190      else
     2191        inib = ""
     2192      end
     2193      if @singleton then
     2194        # p "main== #{@global_name} #{p.get_name} #{p.get_array_size}"
     2195        p_that = ""
     2196        p_that2 = ""
     2197        p_cellcb = ""
     2198        if p.get_array_size && $rom then
     2199          cb = "#{@global_name}_SINGLE_CELL_INIB."
     2200        else
     2201          cb = "#{@global_name}_SINGLE_CELL_CB."
     2202        end
     2203      else
     2204        p_that = "#{@global_name}_CB  *p_that, "
     2205        p_that2 = "#{@global_name}_CB  *p_that "
     2206        p_cellcb = "    #{@global_name}_CB *p_cellcb = p_that;\n"
     2207        cb = "(p_cellcb)->#{inib}"
     2208      end
     2209
     2210      if p.get_array_size then
     2211        array = "int_t  i, "
     2212        array2 = "[ i ]"
     2213        array3 = " int_t  i "
     2214        assert2 = "    assert( 0 <= i && i < NCP_#{p.get_name} );\n"
     2215      else
     2216        array = ""
     2217        array2 = ""
     2218        array3 = ""
     2219        assert2 = ""
     2220      end
     2221      f.print <<EOT
     2222/* [dynamic] #{p.get_name} */
     2223Inline void
     2224#{@global_name}_#{p.get_name}_set_descriptor( #{p_that}#{array}Descriptor( #{p.get_signature.get_global_name} ) des )
     2225{
     2226#{p_cellcb}    assert( des.vdes != NULL );
     2227#{assert2}    #{cb}#{p.get_name}#{array2} = des.vdes;
     2228}
     2229
     2230EOT
     2231
     2232      if p.is_optional? then
     2233        if p_that2 != "" && array3 != "" then
     2234          delim = ", "
     2235        else
     2236          delim = ""
     2237        end
     2238        f.print <<EOT
     2239/* [dynamic,optional] #{p.get_name} */
     2240Inline void
     2241#{@global_name}_#{p.get_name}_unjoin( #{p_that2}#{delim}#{array3} )
     2242{
     2243#{p_cellcb}    #{cb}#{p.get_name}#{array2} = NULL;
     2244}
     2245
     2246EOT
     2247      end
     2248    }
     2249  end
     2250
    18592251  #=== send/receive で受け取ったメモリ領域を dealloc するマクロコード
    18602252  #f:: File
     
    19582350
    19592351        if p.is_omit? then
    1960           f.print( "                      #{dummy_p_cell_access_pre}omitted #{p.get_name}_#{fun.get_name}(" )
    1961         else
    1962           f.print( "                      #{dummy_p_cell_access_pre}#{@global_name}_#{p.get_name}_#{fun.get_name}(" )
     2352          f.print( "          #{dummy_p_cell_access_pre}omitted #{p.get_name}_#{fun.get_name}(" )
     2353        else
     2354          f.print( "          #{dummy_p_cell_access_pre}#{@global_name}_#{p.get_name}_#{fun.get_name}(" )
    19632355        end
    19642356        ft = fun.get_declarator.get_type
     
    19812373        f.print( " )#{dummy_p_cell_access_post}\n" )
    19822374      }
     2375    }
     2376    f.print( "\n" )
     2377  end
     2378
     2379  def gen_ph_ref_desc_macro_abbrev f
     2380    if @n_call_port_ref_desc >0 then
     2381      f.printf( TECSMsg.get( :CRDA_comment ), "#_CRDA_#" )
     2382    end
     2383
     2384    @port.each { |p|
     2385      next if p.get_port_type != :CALL
     2386      next if ! p.is_ref_desc?
     2387
     2388      if @singleton then
     2389        p_cellcb = ""
     2390        delim = ""
     2391      else
     2392        p_cellcb = "p_cellcb"
     2393        delim = ", "
     2394      end
     2395
     2396      if p.get_array_size then
     2397        array = " i "
     2398        array2 = "#{delim}i"
     2399      else
     2400        array = ""
     2401        array2 = ""
     2402      end
     2403
     2404      f.printf( "#define %s_refer_to_descriptor(#{array})\\\n          %s_refer_to_descriptor( #{p_cellcb}#{array2} )\n",
     2405                "#{p.get_name}",
     2406                "#{@global_name}_#{p.get_name}" )
     2407      f.printf( "#define %s_ref_desc(#{array})\\\n          %s_refer_to_descriptor(#{array})\n",   
     2408                "#{p.get_name}",
     2409                "#{p.get_name}" )
     2410    }
     2411    f.print( "\n" )
     2412  end
     2413
     2414  def gen_ph_set_desc_macro_abbrev f
     2415    if @n_call_port_dynamic >0 then
     2416      f.printf( TECSMsg.get( :SDMA_comment ), "#_SDMA_#" )
     2417    end
     2418
     2419    if @singleton then
     2420      p_cellcb = ""
     2421      delim = ""
     2422    else
     2423      p_cellcb = "p_cellcb"
     2424      delim = ", "
     2425    end
     2426    @port.each { |p|
     2427      next if p.get_port_type != :CALL
     2428      next if ! p.is_dynamic?
     2429
     2430      if p.get_array_size then
     2431        subsc = "i, "
     2432        subsc2 = "i"
     2433        subsc3 = delim + subsc2
     2434      else
     2435        subsc = ""
     2436        subsc2 = ""
     2437        subsc3 = ""
     2438      end
     2439      f.printf( "#define %s_set_descriptor( #{subsc}desc )\\\n          %s_set_descriptor( #{p_cellcb}#{delim}#{subsc}desc )\n",
     2440                "#{p.get_name}",
     2441                "#{@global_name}_#{p.get_name}" )
     2442      f.printf( "#define %s_unjoin( #{subsc2} )\\\n          %s_unjoin( #{p_cellcb}#{subsc3} )\n",
     2443                "#{p.get_name}",
     2444                "#{@global_name}_#{p.get_name}" )
    19832445    }
    19842446    f.print( "\n" )
     
    21492611        f.print( "typedef const struct tag_#{@global_name}_INIB {\n" )
    21502612
    2151         gen_cell_cb_type_port f
     2613        gen_cell_cb_type_port( f, :INIB )
    21522614        gen_cell_cb_type_attribute( f, :INIB )
    21532615
     
    21622624          f.print "    #{@global_name}_INIB  *_inib;\n"
    21632625        end
     2626        gen_cell_cb_type_port( f, :CB_DYNAMIC )
    21642627        gen_cell_cb_type_attribute( f, :CB )
    21652628        gen_cell_cb_type_var f
     
    21802643      f.print( "typedef struct tag_#{@global_name}_CB {\n" )
    21812644
    2182       gen_cell_cb_type_port f
     2645      gen_cell_cb_type_port( f, :CB )
    21832646      gen_cell_cb_type_attribute( f, :CB )
    21842647      gen_cell_cb_type_var f
     
    22482711  end
    22492712
    2250   def gen_cell_cb_type_port f
    2251     gen_cell_cb_type_call_port f
    2252     gen_cell_cb_type_entry_port f
    2253   end
    2254 
    2255   def gen_cell_cb_type_call_port f
     2713  def gen_cell_cb_type_port( f, inib_cb )
     2714    gen_cell_cb_type_call_port( f, inib_cb )
     2715    gen_cell_cb_type_entry_port( f, inib_cb )
     2716  end
     2717
     2718  def gen_cell_cb_type_call_port( f, inib_cb )
    22562719    # 呼び口
    22572720    if @n_call_port >0 then
    2258       f.print "    /* call port #_TCP_# */ \n"
     2721      f.print "    /* call port #_TCP_# */\n"
    22592722    end
    22602723
     
    22622725      next if p.get_port_type != :CALL
    22632726      next if p.is_omit?
    2264       ptr = ''
    2265       ptr = '*' if p.get_array_size
     2727      next if inib_cb == :INIB && p.is_dynamic? && p.get_array_size == nil && ! $ram_initializer
     2728      next if inib_cb == :CB_DYNAMIC && ( ! p.is_dynamic? || p.get_array_size != nil )
     2729      # bprint "cb_type #{inib_cb} #{p.get_name} dynamic=#{p.is_dynamic?}\n"
     2730
     2731      ptr = p.get_array_size ? '*' : ''
    22662732
    22672733      if ! p.is_cell_unique? then
     2734        const = p.is_dynamic?  ? '' : 'const'
     2735        if inib_cb == :INIB && p.is_dynamic? && p.get_array_size == nil && $ram_initializer then
     2736          init = '_init_'
     2737          const2 = 'const'
     2738        else
     2739          init = ''
     2740          const2 = 'const'
     2741        end
     2742
    22682743        if ! p.is_skelton_useless? then
    22692744          # 標準形
    2270           f.print( "    struct tag_#{p.get_signature.get_global_name}_VDES #{ptr}const*#{p.get_name;};\n" )
     2745          if inib_cb == :INIB && p.is_dynamic? && p.get_array_size != nil && $ram_initializer then
     2746            f.print( "    struct tag_#{p.get_signature.get_global_name}_VDES #{ptr}#{const2}*#{p.get_name;}_init_;\n" )
     2747          end
     2748          f.print( "    struct tag_#{p.get_signature.get_global_name}_VDES #{ptr}#{const}*#{p.get_name;}#{init};\n" )
     2749#          f.print( "    struct tag_#{p.get_signature.get_global_name}_VDES #{ptr}*#{p.get_name;};\n" )
    22712750          if p.get_array_size == "[]" then
    22722751            f.print( "    int_t n_#{p.get_name};\n" )
     
    22952774
    22962775  #=== Celltype#受け口配列添数を記憶する変数の定義
    2297   def gen_cell_cb_type_entry_port f
     2776  def gen_cell_cb_type_entry_port( f, inib_cb )
    22982777    # 呼び口
    22992778    if @n_entry_port >0 then
     
    23182797        f.print "extern  #{@global_name}_INIB  #{@global_name}_SINGLE_CELL_INIB;\n"
    23192798      end
    2320 
    2321 #     @ordered_cell_list.each{ |c|
    2322 #        f.print "extern  #{@global_name}_CB  #{@global_name}_#{c.get_name}_CB;\n"
    2323 #      }
    2324 
    23252799      f.print "\n"
    2326     elsif @idx_is_id_act then
    2327       f.print "extern #{@global_name}_CB  *#{@global_name}_CB_tab[];\n"
     2800    elsif @b_need_ptab then
     2801      f.printf( TECSMsg.get( :SCP_comment ),  "#_MCPP_#" )
     2802      if has_CB? then
     2803        f.print "extern #{@global_name}_CB  *const #{@global_name}_CB_ptab[];\n"
     2804        @ordered_cell_list.each{ |c|
     2805          if c.is_generate? then                           # 生成対象か?
     2806            name_array = get_name_array c
     2807            f.print "extern #{@global_name}_CB  #{name_array[4]};\n"
     2808          end
     2809        }
     2810      elsif has_INIB?
     2811        f.print "extern #{@global_name}_INIB  *const #{@global_name}_INIB_ptab[];\n"
     2812        @ordered_cell_list.each{ |c|
     2813          if c.is_generate? then                           # 生成対象か?
     2814            name_array = get_name_array c
     2815            f.print "extern #{@global_name}_INIB  #{name_array[11]};\n"
     2816          end
     2817        }
     2818      end
    23282819    else
    2329       f.print "extern #{@global_name}_CB  #{@global_name}_CB_tab[];\n"
     2820      f.printf( TECSMsg.get( :SCP_comment ),  "#_MCPB_#" )
     2821      if has_CB? then
     2822        f.print "extern #{@global_name}_CB  #{@global_name}_CB_tab[];\n"
     2823      elsif has_INIB?
     2824        f.print "extern #{@global_name}_INIB  #{@global_name}_INIB_tab[];\n"
     2825      end
    23302826    end
    23312827  end
    23322828
    23332829  def gen_ph_INIB_as_CB f
    2334 
     2830    # ここは、手抜きである。本来なら INIB を出力すべき
    23352831    if ! has_CB? && has_INIB? then
    23362832      f.printf( TECSMsg.get( :DCI_comment ),  "#_DCI_#" )
    2337       f.print "#define #{@global_name}_CB_tab           #{@global_name}_INIB_tab\n"
    2338       f.print "#define #{@global_name}_SINGLE_CELL_CB   #{@global_name}_SINGLE_CELL_INIB\n"
     2833      if @singleton then
     2834        f.print "#define #{@global_name}_SINGLE_CELL_CB   #{@global_name}_SINGLE_CELL_INIB\n"
     2835      elsif @b_need_ptab then
     2836        f.print "#define #{@global_name}_CB_ptab           #{@global_name}_INIB_ptab\n"
     2837      else
     2838        f.print "#define #{@global_name}_CB_tab           #{@global_name}_INIB_tab\n"
     2839      end
    23392840      f.print "#define #{@global_name}_CB               #{@global_name}_INIB\n"
    23402841      f.print "#define tag_#{@global_name}_CB           tag_#{@global_name}_INIB\n"
     
    23602861      f.printf( TECSMsg.get( :FEC_comment ), "#_FEC_#" )
    23612862
    2362       if @idx_is_id_act then
     2863      if @b_need_ptab then
    23632864        amp = ''
     2865        tab = 'ptab'
    23642866      else
    23652867        amp = '&'
     2868        tab = 'tab'
    23662869      end
    23672870      f.print <<EOT
    23682871#define FOREACH_CELL(i,p_cb)   \\
    23692872    for( (i) = 0; (i) < #{@global_name}_N_CELL; (i)++ ){ \\
    2370        #{necessity}(p_cb) = #{amp}#{@global_name}_CB_tab[i];
     2873       #{necessity}(p_cb) = #{amp}#{@global_name}_CB_#{tab}[i];
    23712874
    23722875#define END_FOREACH_CELL   }
     
    24182921
    24192922    if @n_cell_gen > 0 && need_CB_initializer? then
     2923      b_var_init = false
    24202924      f.print "#define INITIALIZE_CB#{arg}"
    24212925      @var.each { |v|
     
    24232927        next if init == nil
    24242928
     2929        b_var_init = true
    24252930        type = v.get_type.get_original_type
    24262931        f.print "\\\n"
     
    24382943#            post = ""
    24392944          end
    2440           f.print "\tmemcpy((void*)#{pre}#{@global_name}_VAR_#{v.get_name}#{p_that}#{post}, (void*)#{pre}#{@global_name}_#{v.get_name}_VAR_INIT#{post}, sizeof(#{@global_name}_#{v.get_name}_VAR_INIT));"
     2945          f.print "\tmemcpy((void*)#{pre}#{@global_name}_VAR_#{v.get_name}#{p_that}#{post}, "
     2946          f.print "(void*)#{pre}#{@global_name}_#{v.get_name}_VAR_INIT#{post}, sizeof(#{@global_name}_#{v.get_name}_VAR_INIT));"
    24412947        elsif init.instance_of? C_EXP then
    24422948          f.print "\t#{that}#{v.get_name} = #{init.get_c_exp_string};"
     
    24512957        end
    24522958      }
     2959
     2960      # dynamic call port の初期化コード
     2961      b_dyn_port = false
     2962      @port.each{ |p|
     2963        next if p.get_port_type != :CALL
     2964        if p.is_dynamic? && $ram_initializer then
     2965          if p.get_array_size == nil then
     2966            f.print "\\\n\t#{that}#{p.get_name} = #{that}_inib->#{p.get_name}_init_;"
     2967          else
     2968            if @singleton || p.get_array_size != "[]" then
     2969              p_that = ""
     2970            else
     2971              p_that = "(p_that)"
     2972            end
     2973            if @singleton then
     2974              that = "#{@global_name}_SINGLE_CELL_INIB."
     2975            else
     2976              that = "(p_that)->"
     2977            end
     2978            if has_CB? then
     2979              init = '_init->'
     2980            else
     2981              init = ''
     2982            end
     2983            f.printf( "\\\n%-80s\\\n", '     {' )
     2984            f.printf( "%-80s\\\n", '        int_t   j;' )
     2985            f.printf( "%-80s\\\n", "        for( j = 0; j < N_CP_#{p.get_name}#{p_that}; j++ ){" )
     2986            f.printf( "%-80s\\\n", "            #{that}#{p.get_name}[j] = #{that}#{init}#{p.get_name}_init_[j];" )
     2987            f.printf( "%-80s\\\n", '        }' )
     2988            f.printf( "%-80s", '       }' )
     2989          end
     2990          b_dyn_port = true
     2991        end
     2992      }
     2993      if b_dyn_port then
     2994        f.print( "\n" )
     2995      end
     2996     
     2997      if b_var_init == false && b_dyn_port == false && ! @singleton then
     2998        f.print "\t(void)(p_that);"
     2999      end
    24533000      f.print "\n"
    24543001
     
    24573004        if @singleton then
    24583005          f.print "\t#{that}_inib = &#{@global_name}_SINGLE_CELL_INIB;\n\n"
    2459         elsif @idx_is_id_act
    2460           f.print "\t#{that}_inib = #{@global_name}_INIB_tab[(i)];\n\n"
     3006        elsif @b_need_ptab then
     3007          f.print "\t#{that}_inib = #{@global_name}_INIB_ptab[(i)];\n\n"
    24613008        else
    24623009          f.print "\t#{that}_inib = &#{@global_name}_INIB_tab[(i)];\n\n"
     
    26973244              j = am[i]
    26983245              if j then
    2699                 if am[i].get_cell.get_celltype == self then
     3246                if am[i].get_rhs_cell.get_celltype == self then
    27003247                  # 同じセルタイプへ結合している場合(VDES では type conflict になる)
    27013248                  p = am[i].get_rhs_port
     
    27263273            end
    27273274          else
    2728             if j.get_cell.get_celltype == self then
     3275            dbgPrint "me=#{@name} callee=#{j.get_rhs_cell.get_celltype.get_name} #{j.get_cell.get_celltype.get_name} \n"
     3276            if j.get_rhs_cell.get_celltype == self then
    27293277              # 同じセルタイプへ結合している場合(VDES では type conflict になる)
    27303278              p = j.get_rhs_port
     
    27653313
    27663314        jl = c.get_join_list
    2767         jl.get_items.each{ |j|
    2768           definition = j.get_definition
    2769           next unless definition.instance_of? Port
     3315        # ループを回す変数を jl から @port に変更
     3316        # dynamic, optional
     3317#        jl.get_items.each{ |j|
     3318        @port.each { |port|
     3319          next if port.get_port_type != :CALL
     3320          dbgPrint( "gen_cell_ep_vdes_array: #{c.get_name}.#{port.get_name}\n" )
     3321
     3322#          definition = j.get_definition
     3323#          next unless definition.instance_of? Port
     3324          j = jl.get_item( port.get_name )
     3325
    27703326          # port = definition    # definition は composite の Port が得られることがある
    2771           port = find j.get_name # celltype の Port (こちらに最適化情報がある)
     3327          # port = find j.get_name # celltype の Port (こちらに最適化情報がある)
    27723328          next if port.is_cell_unique?
    27733329          next if port.is_omit?
    27743330
    2775           am = j.get_array_member2
    2776           if am  then
     3331          b_array = false
     3332          am = nil
     3333          if j then
     3334            am = j.get_array_member2
     3335            if am then
     3336              b_array = true
     3337            end
     3338          else
     3339            if port.get_array_size == "[]" then
     3340              # this case is dynamic optional and nothing joined
     3341              next
     3342            elsif port.get_array_size then
     3343              b_array = true
     3344            end
     3345          end
     3346          if b_array  then
     3347#          if am then
    27773348            # 左辺は配列
     3349            const = ( port.is_dynamic? && ! $ram_initializer ) ? '' : 'const '
     3350            init = ( port.is_dynamic? && $ram_initializer ) ? '_init_' : ''
    27783351
    27793352            if ! port.is_skelton_useless? then
    2780               f.printf( "struct %s * const %s_%s[] = {\n",
     3353              f.printf( "struct %s * #{const}%s_%s[] = {\n",
    27813354                        "tag_#{port.get_signature.get_global_name}_VDES",
    27823355                        "#{c.get_global_name}",
    2783                         "#{j.get_name}" )
     3356                        "#{port.get_name}" + init )
    27843357            else
    27853358
    27863359#              スケルトン関数不要最適化の場合、この配列は参照されない
    27873360              # mikan このケースがテストされていない
    2788               f.printf( "const %s_IDX  %s_%s[] = {\n",
     3361              f.printf( "#{const}%s_IDX  %s_%s[] = {\n",
    27893362#                        "#{j.get_celltype.get_global_name}",   # 右辺 composite に対応できない
    27903363                        "#{j.get_rhs_cell.get_celltype.get_global_name}",
     
    28003373            i = 0
    28013374            while i < length
     3375              if am == nil then
     3376                f.print( "    0,\n" )
     3377                i += 1
     3378                next
     3379              end
    28023380              j = am[i]
    28033381              i += 1
     
    28413419            # mikan   cell の namespace 未対応、Join で Cell オブジェクトを引当ておく必要あり
    28423420            f.print "};\n"
     3421            # dynamic の呼び口配列
     3422            if port.is_dynamic? && $ram_initializer then
     3423              f.printf( "struct %s * %s_%s[ #{length} ];\n",
     3424                        "tag_#{port.get_signature.get_global_name}_VDES",
     3425                        "#{c.get_global_name}",
     3426                        "#{port.get_name}" )
     3427            end
    28433428          end
    28443429        }
     
    29673552        init = v.get_initializer
    29683553        if init && init.instance_of?( Array ) then
    2969           type = v.get_type.get_original_type
    2970 
    2971           if( type.kind_of? PtrType )then
     3554          type = v.get_type
     3555          org_type = v.get_type.get_original_type
     3556
     3557          if( org_type.kind_of? PtrType )then
    29723558            # PtrType は ArrayType にすり替える
    29733559
     
    29763562            t2.set_type( type.get_type )
    29773563            type = t2
     3564            org_type = t2
    29783565          end
    29793566
     
    29823569          # f.print "const #{type0.get_type_str}\t#{@global_name}_#{v.get_name}_VAR_INIT#{type0.get_type_str_post} = "
    29833570          f.print "const #{type.get_type_str}\t#{@global_name}_#{v.get_name}_VAR_INIT#{type.get_type_str_post} = "
    2984           if type.kind_of? StructType then
     3571          if org_type.kind_of? StructType then
    29853572            # celltype の default の初期値あり
    29863573            str = gen_cell_cb_init( f, c, name_array, type, init, v.get_identifier, 1, true )
    2987           elsif( type.kind_of?( PtrType ) || type.kind_of?( ArrayType ) ) then
     3574          elsif( org_type.kind_of?( PtrType ) || org_type.kind_of?( ArrayType ) ) then
    29883575            str = "{ "
    2989             type = type.get_type
     3576            type = org_type.get_type
    29903577            # mikan ポインタではなく、配列型としないと、ポインタ変数の領域の分、損する
    29913578            init.each { |i|
     
    30153602        fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_SINGLE_CELL_INIB = \n" }
    30163603        indent = 0
    3017       elsif ! @idx_is_id_act then
     3604      elsif ! @b_need_ptab then
    30183605        fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_INIB_tab[] = {\n" }
    30193606        indent = 1
     
    30363623
    30373624        print_indent( f, indent )
    3038         if @idx_is_id_act then
     3625        if @b_need_ptab then
    30393626          f.print "const #{@global_name}_INIB #{name_array[5]} = "
    30403627        end
    30413628        f.print "{\n"
    30423629
    3043         gen_cell_cb_port( c, indent, f, name_array )
     3630        gen_cell_cb_port( c, indent, f, name_array, :INIB )
    30443631        gen_cell_cb_attribute( c, indent, f, name_array, :INIB )
    30453632
    30463633        unless @singleton then
    30473634          # 1 つの cell INIB の終わり
    3048           if @idx_is_id_act then
     3635          if @b_need_ptab then
    30493636            f.print( "};\n\n" )
    30503637          else
     
    30533640        end
    30543641      }
    3055       if ! @idx_is_id_act then
     3642      if ! @b_need_ptab then
    30563643        fs.each{ |r, f| f.print( "};\n\n" ) }
    30573644      end
     
    30683655          fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB = \n" }
    30693656          indent = 0
    3070         elsif ! @idx_is_id_act then
     3657        elsif ! @b_need_ptab then
    30713658          fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_CB_tab[] = {\n" }
    30723659          indent = 1
     3660        else
     3661          indent = 0
    30733662        end
    30743663
     
    30873676
    30883677          print_indent( f, indent )
    3089           if @idx_is_id_act then
     3678          if @b_need_ptab then
    30903679            f.print "#{@global_name}_CB #{name_array[2]} = "
    30913680          end
     
    30973686          end
    30983687
    3099           if ! has_INIB? then
    3100             gen_cell_cb_port( c, indent, f, name_array )
     3688          #if ! has_INIB? then
     3689          if $rom == false then
     3690            gen_cell_cb_port( c, indent, f, name_array, :CB_ALL )
     3691          else
     3692            gen_cell_cb_port( c, indent, f, name_array, :CB_DYNAMIC )
    31013693          end
    31023694
     
    31063698          unless @singleton then
    31073699            # 1 つの cell CB の終わり
    3108             if @idx_is_id_act then
     3700            if @b_need_ptab then
    31093701              f.print( "};\n\n" )
    31103702            else
     
    31133705          end
    31143706        }
    3115         if ! @idx_is_id_act then
     3707        if ! @b_need_ptab then
    31163708          fs.each{ |r, f| f.print( "};\n\n" ) }
    31173709        end
     
    31203712          fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB;\n" }
    31213713          indent = 0
    3122         elsif @idx_is_id_act then
     3714        elsif @b_need_ptab then
    31233715          @ordered_cell_list.each{ |c|
    31243716            next if ! c.is_generate?
     
    31393731  def gen_cell_cb_tab f
    31403732    indent = 0
    3141     if @idx_is_id_act then
     3733    if @b_need_ptab then
    31423734      if has_INIB? && ( $ram_initializer || ! has_CB? ) then
    31433735        f.print "/* ID to INIB table #_INTAB_# */\n"
     
    31503742        }
    31513743
    3152         f.print "#{@global_name}_INIB *#{@global_name}_INIB_tab[] ={\n"
     3744        f.print "#{@global_name}_INIB *const #{@global_name}_INIB_ptab[] ={\n"
    31533745        @ordered_cell_list.each{ |c|
    31543746          if c.is_generate? then                           # 生成対象か?
     
    31703762        }
    31713763
    3172         f.print "#{@global_name}_CB *#{@global_name}_CB_tab[] ={\n"
     3764        f.print "#{@global_name}_CB *const #{@global_name}_CB_ptab[] ={\n"
    31733765        @ordered_cell_list.each{ |c|
    31743766          if c.is_generate? then                           # 生成対象か?
     
    31993791  #   name_array[9] = @global_name    # celltype global name
    32003792  #   name_array[10] = cell.get_global_name # cell global name
     3793  #   name_array[11] = cell_INIB_proto #INIB name for proto type
    32013794 
    32023795  def get_name_array( cell )
     
    32073800      cell_CB_proto = "#{@global_name}_SINGLE_CELL_CB"
    32083801      cell_INIB_name = "#{@global_name}_SINGLE_CELL_INIB"
     3802      cell_INIB_proto = cell_INIB_name
    32093803      cell_ID = 0
    32103804    else
    3211       if ! @idx_is_id_act then
     3805      if ! @b_need_ptab then
    32123806        index = cell.get_id - cell.get_celltype.get_id_base
    32133807        cell_CB_name = "#{@global_name}_CB_tab[#{index}]"
     
    32153809        cell_CB_proto = "#{@global_name}_CB_tab[]"
    32163810        cell_INIB_name = "#{@global_name}_INIB_tab[#{index}]"
     3811        cell_INIB_proto = "#{@global_name}_INIB_tab[]"
    32173812      else
    32183813        cell_CB_name = "#{cell.get_global_name}_CB"
     
    32203815        cell_CB_proto = cell_CB_name
    32213816        cell_INIB_name = "#{cell.get_global_name}_INIB"
     3817        cell_INIB_proto = cell_INIB_name
    32223818      end
    32233819      cell_ID = cell.get_id
    32243820    end
     3821
     3822    if has_CB? then
     3823      cell_CBP = "&#{cell_CB_name}"
     3824    elsif has_INIB? then
     3825      cell_CBP = "&#{cell_INIB_name}"
     3826    else
     3827      cell_CBP = "NULL"    # CB も INIB もなければ NULL に置換
     3828    end
     3829
    32253830    if @idx_is_id_act then
    32263831      cell_IDX = cell_ID
    32273832    else
    3228       cell_IDX = "&#{cell_CB_name}"
    3229     end
    3230 
    3231     if ! has_CB? && ! has_INIB? then
    3232       cell_CBP = "NULL"    # CB も INIB もなければ NULL に置換
    3233     else
    3234       cell_CBP = "&#{cell_CB_name}"
     3833      cell_IDX = cell_CBP
    32353834    end
    32363835
     
    32473846    name_array[9] = @global_name    # celltype global name
    32483847    name_array[10] = cell.get_global_name # cell global name
     3848    name_array[11] = cell_INIB_proto # INIB name for prototype
    32493849
    32503850    return name_array
     
    33313931  end
    33323932
    3333   def gen_cell_cb_port( cell, indent, f, name_array )
    3334     gen_cell_cb_call_port( cell, indent, f, name_array )
     3933  #inib_cb::Symbol: :INIB, :CB_ALL, :CB_DYNAMIC
     3934  def gen_cell_cb_port( cell, indent, f, name_array, inib_cb = :INIB )
     3935    gen_cell_cb_call_port( cell, indent, f, name_array, inib_cb )
    33353936    gen_cell_cb_entry_port( cell, indent, f, name_array )
    33363937  end
    33373938
    33383939  #=== 呼び口の初期化コードの生成
    3339   def gen_cell_cb_call_port( cell, indent, f, name_array )
     3940  def gen_cell_cb_call_port( cell, indent, f, name_array, inib_cb )
    33403941    jl = cell.get_join_list
    33413942
    33423943    port = get_port_list
    3343     if @n_call_port != 0 then
     3944    if inib_cb == :INIB && ( @n_call_port - @n_call_port_omitted_in_CB -
     3945                             ( $ram_initializer ? 0 : (@n_call_port_dynamic-@n_call_port_array_dynamic) )  > 0 ) ||
     3946       inib_cb == :CB_ALL && @n_call_port > 0 ||
     3947       inib_cb == :CB_DYNAMIC && (@n_call_port_dynamic - @n_call_port_array_dynamic) > 0 then
    33443948      print_indent( f, indent + 1 )
    3345       f.print "/* call port #_CP_# */ \n"
     3949      f.print "/* call port (#{inib_cb}) #_CP_# */ \n"
    33463950      port.each{ |p|
    33473951        next if p.get_port_type != :CALL
    33483952        next if p.is_omit?
    33493953        next if p.is_cell_unique?        # 最適化(単一セルで呼び口マクロに埋め込まれる)
     3954        next if inib_cb == :INIB && p.is_dynamic? && p.get_array_size == nil && ! $ram_initializer
     3955        next if inib_cb == :CB_DYNAMIC && ( ! p.is_dynamic? || p.get_array_size != nil )
    33503956
    33513957        j = jl.get_item( p.get_name )
     
    33543960        # debug
    33553961        if j == nil then
     3962          dbgPrint "cell_cb_call_port: #{p.get_name} array size=#{p.get_array_size}\n"
    33563963          # optional 呼び口
    33573964          # cdl_error( "H1003 internal error: cell \'$1\' port \'$2\': initializer not found\n" , cell.get_name, p.get_name )
    33583965          # exit( 1 )
    3359           f.printf( "%-40s /* #_CCP5_# */\n",  "0," )
    3360           if p.get_array_size == "[]" then
    3361             # 添数省略の呼び口配列
    3362             print_indent( f, indent + 1 )
    3363             f.printf( "%-40s /* %s #_CCP6_# */\n", "0,", "length of #{p.get_name} (n_#{p.get_name})" )
     3966          if p.get_array_size then
     3967            if p.is_dynamic? then
     3968              if inib_cb == :INIB then
     3969                if  $ram_initializer then
     3970                  f.printf( "%-40s /* #_CCP7_# _init_ */\n",  "#{cell.get_global_name}_#{p.get_name}_init_," )
     3971                  print_indent( f, indent + 1 )
     3972                end
     3973                f.printf( "%-40s /* #_CCP7B_# */\n",  "#{cell.get_global_name}_#{p.get_name}," )
     3974              elsif $rom == false then
     3975                f.printf( "%-40s /* #_CCP8_# */\n",  "#{cell.get_global_name}_#{p.get_name}," )
     3976              end
     3977            else
     3978              f.printf( "%-40s /* #_CCP9_# */\n",  "0," )
     3979            end
     3980            if p.get_array_size == "[]" then
     3981              # 添数省略の呼び口配列
     3982              print_indent( f, indent + 1 )
     3983              f.printf( "%-40s /* %s #_CCP6_# */\n", "0,", "length of #{p.get_name} (n_#{p.get_name})" )
     3984            end
     3985          else
     3986            f.printf( "%-40s /* #_CCP5_# */\n",  "0," )
    33643987          end
    33653988          next
     
    33693992        if am then
    33703993          # 呼び口配列の場合
    3371           f.printf( "%-40s /* #_CCP3_# */\n",  "#{cell.get_global_name}_#{j.get_name}," )
     3994          if inib_cb == :INIB && p.is_dynamic? && p.get_array_size != nil && $ram_initializer then
     3995            f.printf( "%-40s /* #_CCP3_# _init_ */\n",  "#{cell.get_global_name}_#{j.get_name}_init_," )
     3996            print_indent( f, indent + 1 )
     3997          end
     3998          f.printf( "%-40s /* #_CCP3B_# */\n",  "#{cell.get_global_name}_#{j.get_name}," )
    33723999          if p.get_array_size == "[]" then
    33734000            # 添数省略の呼び口配列
     
    33854012          end
    33864013
     4014          init = ( p.is_dynamic? && inib_cb == :INIB ) ? "_init_" : ""
     4015
    33874016          if j.get_rhs_subscript then
    33884017            # 受け口配列の場合
     
    33914020                      # "&#{j.get_cell_global_name}_#{j.get_port_name}_des#{subscript},",
    33924021                      "#{des_type_cast}&#{j.get_port_global_name}_des#{subscript},",
    3393                       p.get_name )
     4022                      p.get_name.to_s + init )
    33944023          else
    33954024            # 呼び口配列でも、受け口配列でもない
     
    33974026              f.printf( "%-40s /* %s #_CCP1_# */\n",
    33984027                        "#{des_type_cast}&#{j.get_port_global_name}_des,",
    3399                         p.get_name )
     4028                        p.get_name.to_s + init )
    34004029            else
    34014030              # スケルトン不要最適化(CB (INIB) へのポインタを埋め込む)
    34024031              c = j.get_rhs_cell                    # 呼び先セル
    34034032              ct = c.get_celltype                   # 呼び先セルタイプ
     4033              name_array = ct.get_name_array( c )   # 呼び先セルタイプで name_array を得る
    34044034              if ct.has_INIB? || ct.has_CB? then
    3405                 name_array = ct.get_name_array( c )   # 呼び先セルタイプで name_array を得る
    34064035                f.printf( "%-40s /* %s #_CCP2_# */\n", "#{name_array[7]},", p.get_name )
    34074036              else
    34084037                # 呼び先は CB も INIB も持たない(NULL に初期化)
    3409                 f.printf( "%-40s /* %s #_CCP2_# */\n", "0,", p.get_name )
     4038                f.printf( "%-40s /* %s #_CCP2B_# */\n", "0,", p.get_name )
    34104039              end
    34114040            end
     
    36894318      f = fs[ c.get_region.get_domain_root ]
    36904319
    3691       ct = c.get_celltype
     4320      ct = c.get_celltype     # ct = self でも同じ
    36924321      jl = c.get_join_list
     4322      name_array = get_name_array( c )
    36934323
    36944324      port = ct.get_port_list
     
    37254355              else
    37264356                if has_CB? then
    3727                   if @singleton then
    3728                     f.print "    &#{@global_name}_SINGLE_CELL_CB,        /* CB */\n"
    3729                   else
    3730                     # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
    3731                     f.print "    &#{@global_name}_CB_tab[#{index}],      /* CB */\n"
    3732                   end
     4357                  # if @singleton then
     4358                  #   f.print "    &#{@global_name}_SINGLE_CELL_CB,        /* CB 1 */\n"
     4359                  # else
     4360                  #   # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
     4361                  #   f.print "    &#{@global_name}_CB_tab[#{index}],      /* CB 2 */\n"
     4362                  # end
     4363                  f.print "    #{name_array[8]},      /* CB 1 */\n"
    37334364                elsif has_INIB? then
    3734                   if @singleton then
    3735                     f.print "    &#{@global_name}_SINGLE_CELL_INIB,      /* INIB */\n"
    3736                   else
    3737                     f.print "    &#{@global_name}_INIB_tab[#{index}],    /* INIB */\n"
    3738                   end
     4365                  # if @singleton then
     4366                  #   f.print "    &#{@global_name}_SINGLE_CELL_INIB,      /* INIB 1 */\n"
     4367                  # else
     4368                  #   f.print "    &#{@global_name}_INIB_tab[#{index}],    /* INIB 2 */\n"
     4369                  # end
     4370                  f.print "    &#{name_array[5]},      /* INIB 1 */\n"
    37394371                else
    37404372                  f.print "    0,\n"
     
    37604392            else
    37614393              if has_CB? then
    3762                 if @singleton then
    3763                   f.print "    &#{@global_name}_SINGLE_CELL_CB,       /* CB */\n"
    3764                 else
    3765                   f.print "    &#{@global_name}_CB_tab[#{index}],     /* CB */\n"
    3766                   # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
    3767                 end
     4394                # if @singleton then
     4395                #   f.print "    &#{@global_name}_SINGLE_CELL_CB,       /* CB 3 */\n"
     4396                # else
     4397                #   f.print "    &#{@global_name}_CB_tab[#{index}],     /* CB 4 */\n"
     4398                #   # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
     4399                # end
     4400                f.print "    #{name_array[8]},      /* CB 3 */\n"
    37684401              elsif has_INIB? then
    3769                 if @singleton then
    3770                   f.print "    &#{@global_name}_SINGLE_CELL_INIB,     /* INIB */\n"
    3771                 else
    3772                   f.print "    &#{@global_name}_INIB_tab[#{index}],   /* INIB */\n"
    3773                 end
     4402                # if @singleton then
     4403                #   f.print "    &#{@global_name}_SINGLE_CELL_INIB,     /* INIB 3 */\n"
     4404                # else
     4405                #   # f.print "    &#{@global_name}_INIB_tab[#{index}],   /* INIB 4 */\n"
     4406                # end
     4407                f.print "    &#{name_array[5]},      /* INIB 3 */\n"
    37744408              else
    37754409                f.print "    0,\n"
     
    39404574
    39414575        ft.get_paramlist.get_items.each{ |param|
     4576          # p "type_str: #{param.get_type.get_type_str}"
    39424577          f.print( "#{delim} #{param.get_type.get_type_str}" )
    39434578          f.print( " #{param.get_name}#{param.get_type.get_type_str_post}" )
     
    39674602      end
    39684603
     4604      if p.is_ref_desc? then
     4605        subsc = p.get_array_size ? ' int_t subscript ' : ''
     4606        f.print " *   [ref_desc]\n"
     4607        f.printf( " *      %-14s %s;\n",
     4608                  "Descriptor( #{p.get_signature.get_global_name} )",
     4609                  "#{p.get_name}_refer_to_descriptor(#{subsc})" )
     4610        f.printf( " *      %-14s %s;\n",
     4611                  "Descriptor( #{p.get_signature.get_global_name} )",
     4612                  "#{p.get_name}_ref_desc(#{subsc})      (same as above; abbreviated version)" )
     4613      end
     4614      if p.is_dynamic? then
     4615        subsc = p.get_array_size ? 'int_t subscript, ' : ''
     4616        subsc2 = p.get_array_size ? ' int_t subscript' : ''
     4617        if p.is_optional? then
     4618          f.print " *   [dynamic, optional]\n"
     4619        else
     4620          f.print " *   [dynamic]\n"
     4621        end
     4622        f.printf( " *      %-14s %s;\n",
     4623                  "void",
     4624                  "#{p.get_name}_set_descriptor( #{subsc}Descriptor( #{p.get_signature.get_global_name} ) desc )" )
     4625        if p.is_optional? then
     4626          f.printf( " *      %-14s %s;\n",
     4627                    "void",
     4628                    "#{p.get_name}_unjoin( #{subsc2} )" )
     4629        end
     4630      end
    39694631    }
    39704632
     
    40484710          delim = ", "
    40494711          f.print param.get_type.get_type_str
     4712          # p "type_str2: #{param.get_type.get_type_str}"
    40504713          f.print " "
    40514714          f.print param.get_name
     
    41034766  def generate_inline_template_code
    41044767    return if @n_entry_port_inline == 0
     4768    return if @b_reuse && ! $generate_all_template
    41054769    if ! ( @plugin && @plugin.gen_ep_func? ) then
    41064770      return if @b_reuse && ! $generate_all_template
     
    44805144  #  str に以下の置換を行う
    44815145  #-   $ct$ ⇒ セルタイプ名(ct)
    4482   #-   $cell$ ⇒ セル名(cell)   cell が nil ならば3つの置換は行われない
     5146  #-   $cell$ ⇒ セル名(cell)   cell が nil ならば以下の置換は行われない
    44835147  #-   $cb$ ⇒ CB の C 言語名(cb)
    44845148  #-   $cbp$ ⇒ CB へのポインタ(cbp)
    44855149  #-   $cb_proto$ ⇒ CB の C 言語名プロトタイプ宣言用(cb_proto)
    4486   #-   $id$ ⇒ ct_cell
     5150  #-   $id$ ⇒ $ct$_$cell_global$    # ct_cell  before or same V1.5.2
    44875151  #-   $idx$ ⇒ idx
    44885152  #-   $ID$ ⇒ id (整数の番号)
    44895153  #-   $ct_global$ ⇒ セルタイプ名(ct)
    4490   #-   $cell_global$ ⇒ セル名(cell)   cell が nil ならば3つの置換は行われない
     5154  #-   $cell_global$ ⇒ セル名(cell)
    44915155  #-   $$   ⇒ $
    44925156  def subst_name( str, name_array )
     
    45035167
    45045168    str = str.gsub( /(^|[^\$])\$ct\$/, "\\1#{ct}" )
     5169    str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" )
    45055170    if cell then
    45065171      str = str.gsub( /(^|[^\$])\$cell\$/, "\\1#{cell}" )
    45075172      str = str.gsub( /(^|[^\$])\$cb\$/, "\\1#{cb}" )
    4508       str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell}" )
     5173      # str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell}" )
     5174      str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell_global}" )
    45095175      str = str.gsub( /(^|[^\$])\$cb_proto\$/, "\\1#{cb_proto}" )
    45105176      str = str.gsub( /(^|[^\$])\$ID\$/, "\\1#{id}" )
    45115177      str = str.gsub( /(^|[^\$])\$idx\$/, "\\1#{idx}" )
    45125178      str = str.gsub( /(^|[^\$])\$cbp\$/, "\\1#{cbp}" )
    4513       str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" )
    45145179      str = str.gsub( /(^|[^\$])\$cell_global\$/, "\\1#{cell_global}" )
    45155180    end
     
    46315296  end
    46325297end
     5298
     5299class DomainType < Node
     5300  def gen_factory
     5301    # p "DomainType: gen_factory"
     5302    @plugin.gen_factory
     5303  end
     5304end
Note: See TracChangeset for help on using the changeset viewer.