Class: Signature

Inherits:
NSBDNode show all
Includes:
PluginModule
Defined in:
lib/tecsgen/core/componentobj.rb,
lib/tecsgen/core/gen_xml.rb,
lib/tecsgen/core/generate.rb,
lib/tecsgen/core/tecsinfo.rb,
lib/tecsgen/core/unjoin_plugin.rb

Overview

mikan 以下は ruby の mix in で実現できるかもしれない Nestable を継承した場合、クラス変数は Nestable のものが共有される(別にしたかった) class Nestable

@@nest_stack_index = -1
@@nest_stack = []
@@current_object = nil

def self.push
  @@nest_stack_index += 1
  @@nest_stack[ @nest_stack_index ] = @@current_object
  @@current_object = nil
end

def pop
  @@current_object = @@nest_stack[ @@nest_stack_index ]
  @nest_stack_index -= 1
  if @@nest_stack_index < -1 then
    raise TooManyRestore
  end
end

end

Constant Summary collapse

@@nest_stack_index =
-1
@@nest_stack =
[]
@@current_object =
nil
@@set_descriptor_list =
{}

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PluginModule

gen_plugin_post_code, #generate_and_parse, #load_plugin

Methods inherited from NSBDNode

#get_namespace, #get_namespace_path, #is_imported?, #set_namespace_path

Methods inherited from BDNode

#get_owner, #set_owner

Methods inherited from Node

#cdl_error, #cdl_error2, #cdl_error3, #cdl_info, #cdl_info2, #cdl_warning, #cdl_warning2, #get_locale, #locale_str, #set_locale

Constructor Details

#initialize(name) ⇒ Signature

STAGE: B



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/tecsgen/core/componentobj.rb', line 111

def initialize(name)
  super()
  @name = name
  Namespace.new_signature(self)
  set_namespace_path # @NamespacePath の設定
  if Namespace.get_global_name&.empty?
    @global_name = @name
  else
    @global_name = :"#{Namespace.get_global_name}_#{@name}"
  end

  @func_name_to_id = {}
  @context = nil
  @b_callback = false
  @b_deviate = false
  @b_empty = false
  @b_checked_as_allocator_signature = false
  @descriptor_list = nil
  @generate = nil
  @@current_object = self
  set_specifier_list(Generator.get_statement_specifier)
end

Class Method Details

.get_currentObject

STAGE: P このメソッドは parse 中のみ呼び出される



105
106
107
# File 'lib/tecsgen/core/componentobj.rb', line 105

def self.get_current
  @@current_object
end

.popObject



95
96
97
98
99
100
101
# File 'lib/tecsgen/core/componentobj.rb', line 95

def self.pop
  @@current_object = @@nest_stack[@@nest_stack_index]
  @@nest_stack_index -= 1
  if @@nest_stack_index < -1
    raise "TooManyRestore"
  end
end

.pushObject



89
90
91
92
93
# File 'lib/tecsgen/core/componentobj.rb', line 89

def self.push
  @@nest_stack_index += 1
  @@nest_stack[@@nest_stack_index] = @@current_object
  @@current_object = nil
end

.set_descriptor_listObject



366
367
368
369
370
371
372
373
# File 'lib/tecsgen/core/componentobj.rb', line 366

def self.set_descriptor_list
  Namespace.get_root.travers_all_signature{|sig|
    if @@set_descriptor_list[sig].nil?
      @@set_descriptor_list[sig] = true
      sig.set_descriptor_list
    end
  }
end

Instance Method Details

#apply_plugin(plugin_name, option) ⇒ Object

Signature#apply_plugin



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/tecsgen/core/componentobj.rb', line 337

def apply_plugin(plugin_name, option)
    if is_empty?
      cdl_warning("S9999 $1 is empty. cannot apply signature plugin. ignored", @name)
      return
    end

    plClass = load_plugin(plugin_name, SignaturePlugin)
    return if plClass.nil?
    if $verbose
      print "new through: plugin_object = #{plClass.class.name}.new( #{@name}, #{option} )\n"
    end

    begin
      plugin_object = plClass.new(self, option)
      plugin_object.set_locale @locale
    rescue Exception => evar
      cdl_error("S1150 $1: fail to new", plugin_name)
      print_exception(evar)
    end
    generate_and_parse plugin_object
end

#each_paramObject

Signature# signaure のすべての関数のすべてのパラメータをたどる

block

ブロックを引数に取る

ブロックは2つの引数を受け取る Decl, ParamDecl ( Decl: 関数ヘッダ ) Port クラスにも each_param がある(同じ働き)



236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/tecsgen/core/componentobj.rb', line 236

def each_param # ブロック引数 { |func_decl, param_decl| }
  fha = get_function_head_array                       # 呼び口または受け口のシグニチャの関数配列
  return if fha.nil?                                # nil なら文法エラーで有効値が設定されなかった

  pr = Proc.new   # このメソッドのブロック引数を pr に代入
  fha.each{|fh|  # fh: FuncHead                      # 関数配列中の各関数頭部
    fd = fh.get_declarator # fd: Decl  (関数頭部からDeclarotorを得る)
    if fd.is_function? # fd が関数でなければ、すでにエラー
      fd.get_type.get_paramlist.get_items.each{|par| # すべてのパラメータについて
        pr.call(fd, par)
      }
    end
  }
end

#end_of_parse(function_head_list) ⇒ Object

STAGE: B



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/tecsgen/core/componentobj.rb', line 136

def end_of_parse(function_head_list)
  @function_head_list = function_head_list

  # id を割付ける
  id = 1
  function_head_list.get_items.each{|f|
    @func_name_to_id[f.get_name] = id
    f.set_owner self
    id += 1
  }
  if id == 1
    @b_empty = true
  end

  # set_descriptor_list ##

  if @generate
    signature_plugin
  end

  @@current_object = nil

  return self
end

#gen_sh_endif(f) ⇒ Object



1104
1105
1106
# File 'lib/tecsgen/core/generate.rb', line 1104

def gen_sh_endif(f)
  f.print("#endif /* #{@global_name}_TECSGEN_H */\n")
end

#gen_sh_func_id(f) ⇒ Object

Signature# 関数の ID の define を出力



1096
1097
1098
1099
1100
1101
1102
# File 'lib/tecsgen/core/generate.rb', line 1096

def gen_sh_func_id(f)
  f.print "/* function id */\n"
  get_function_head_array.each{|fun|
    f.printf("#define\tFUNCID_%-31s (%d)\n", "#{@global_name}_#{fun.get_name}".upcase, get_id_from_func_name(fun.get_name))
  }
  f.print "\n"
end

#gen_sh_func_tab(f) ⇒ Object



1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
# File 'lib/tecsgen/core/generate.rb', line 1043

def gen_sh_func_tab(f)
  # シグニチャディスクリプタの出力
  f.printf TECSMsg.get(:SD_comment), "#_SD_#"
  f.print "struct tag_#{@global_name}_VDES {\n"
  f.print "    struct tag_#{@global_name}_VMT *VMT;\n"
  f.print "};\n\n"

  # シグニチャ関数テーブルの出力
  f.printf TECSMsg.get(:SFT_comment), "#_SFT_#"
  f.print("struct tag_#{@global_name}_VMT {\n")
  get_function_head_array.each{|fun|
    f.print "    "
    functype = fun.get_declarator.get_type
    f.printf("%-14s", functype.get_type_str)

    f.print(" (*#{fun.get_name}__T)(")
    f.print(" const struct tag_#{@global_name}_VDES *edp") unless @singleton

    if functype.get_paramlist
      items = functype.get_paramlist.get_items
      len = items.length
    else
      # ここで nil になるのは、引数なしの時に void がなかった場合
      items = []
      len = 0
    end

    i = 0
    items.each{|param|
      f.print ", "
      f.print(param.get_type.get_type_str)
      f.print(" ")
      f.print(param.get_name)
      f.print(param.get_type.get_type_str_post)
      i += 1
    }
    f.print " );\n"
  }
  if get_function_head_array.length == 0
    f.print("    void   (*dummy__)(void);\n")
  end

  f.print "};\n\n"
  f.printf TECSMsg.get(:SDES_comment), "#_SDES_#"
  f.print <<EOT
#ifndef Descriptor_of_#{@global_name}_Defined
#define  Descriptor_of_#{@global_name}_Defined
typedef struct { struct tag_#{@global_name}_VDES *vdes; } Descriptor( #{@global_name} );
#endif
EOT
end

#gen_sh_guard(f) ⇒ Object

signature header



1009
1010
1011
1012
# File 'lib/tecsgen/core/generate.rb', line 1009

def gen_sh_guard(f)
  f.print("#ifndef #{@global_name}_TECSGEN_H\n")
  f.print("#define #{@global_name}_TECSGEN_H\n\n")
end

#gen_sh_include(f) ⇒ Object



1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
# File 'lib/tecsgen/core/generate.rb', line 1025

def gen_sh_include(f)
  dl = get_descriptor_list
  if dl.length > 0
    f.printf TECSMsg.get(:SDI_comment), "#_SDI_#"
    dl.each{|dt, param|
      f.print <<EOT
/* pre-typedef incomplete-type to avoid error in case of mutual or cyclic reference */
#ifndef Descriptor_of_#{dt.get_global_name}_Defined
#define  Descriptor_of_#{dt.get_global_name}_Defined
typedef struct { struct tag_#{dt.get_global_name}_VDES *vdes; } Descriptor( #{dt.get_global_name} );
#endif
EOT
#        f.print "#include \"#{dt.get_global_name}_tecsgen.#{$h_suffix}\"\n"
    }
    f.print "\n"
  end
end

#gen_sh_info(f) ⇒ Object



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
# File 'lib/tecsgen/core/generate.rb', line 1014

def gen_sh_info(f)
  f.print <<EOT
/*
 * signature   :  #{@name}
 * global name :  #{@global_name}
 * context     :  #{get_context}
 */

EOT
end

#gen_XML(file, nest) ⇒ Object



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/tecsgen/core/gen_xml.rb', line 102

def gen_XML(file, nest)
  indent = XML_INDENT * nest
  if is_imported?
    file.print <<EOT
#{indent}<import path='#{@import.get_cdl_name}'>
EOT
    nest += 1
    indent = XML_INDENT * nest
  end

  file.print <<EOT
#{indent}<signature>
#{indent}#{XML_INDENT}<name> #{@name} </name>
EOT
  @function_head_list.get_items.each{|fh|
    file.print <<EOT
#{indent}#{XML_INDENT}<func>
#{indent}#{XML_INDENT}#{XML_INDENT}<name> #{fh.get_name} </name>
#{indent}#{XML_INDENT}#{XML_INDENT}<rettype> #{fh.get_return_type.get_type_str}#{fh.get_return_type.get_type_str_post} </rettype>
EOT
    fh.get_paramlist.get_items.each{|pd|
      file.print <<EOT
#{indent}#{XML_INDENT}#{XML_INDENT}<param>
#{indent}#{XML_INDENT}#{XML_INDENT}#{XML_INDENT}<name> #{pd.get_name} </name>
#{indent}#{XML_INDENT}#{XML_INDENT}#{XML_INDENT}<type> #{pd.get_type.get_type_str}#{pd.get_type.get_type_str_post} </type>
#{indent}#{XML_INDENT}#{XML_INDENT}</param>
EOT
    }
    file.print <<EOT
#{indent}#{XML_INDENT}</func>
EOT
  }
  file.print <<EOT
#{indent}</signature>
EOT
  if is_imported?
    nest -= 1
    indent = XML_INDENT * nest
    file.print <<EOT
#{indent}</import>
EOT
  end
end

#generateObject



976
977
978
# File 'lib/tecsgen/core/generate.rb', line 976

def generate
  generate_signature_header
end

#generate_postObject



980
981
982
# File 'lib/tecsgen/core/generate.rb', line 980

def generate_post
  generate_signature_header_post
end

#generate_signature_headerObject



984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File 'lib/tecsgen/core/generate.rb', line 984

def generate_signature_header
  f = AppFile.open("#{$gen}/#{@global_name}_tecsgen.#{$h_suffix}")

  print_note f
  gen_sh_guard f
  gen_sh_info f
  gen_sh_include f

  ifndef_macro_only f
  gen_sh_func_tab f
  endif_macro_only f
  gen_sh_func_id f

  f.close
end

#generate_signature_header_postObject



1000
1001
1002
1003
1004
# File 'lib/tecsgen/core/generate.rb', line 1000

def generate_signature_header_post
  f = AppFile.open("#{$gen}/#{@global_name}_tecsgen.#{$h_suffix}")
  gen_sh_endif f
  f.close
end

#get_contextObject

Signature# context を得る

context 文字列を返す “task”, “non-task”, “any” 未指定時のデフォルトとして task を返す



224
225
226
227
228
229
230
# File 'lib/tecsgen/core/componentobj.rb', line 224

def get_context
  if @context
    return @context
  else
    return "task"
  end
end

#get_descriptor_listObject

Signature# 引数で参照されている Descriptor 型のリストを

RETURN

Hash { Signature => ParamDecl }: 複数の ParamDecl から参照されている場合、最後のものしか返さない



361
362
363
# File 'lib/tecsgen/core/componentobj.rb', line 361

def get_descriptor_list
  @descriptor_list
end

#get_function_head(func_name) ⇒ Object



212
213
214
# File 'lib/tecsgen/core/componentobj.rb', line 212

def get_function_head(func_name)
  return @function_head_list.get_item(func_name.to_sym)
end

#get_function_head_arrayObject



204
205
206
207
208
209
210
# File 'lib/tecsgen/core/componentobj.rb', line 204

def get_function_head_array
  if @function_head_list
    return @function_head_list.get_items
  else
    return nil
  end
end

#get_global_nameObject



200
201
202
# File 'lib/tecsgen/core/componentobj.rb', line 200

def get_global_name
  @global_name
end

#get_id_from_func_name(func_name) ⇒ Object

Signature# 関数名から signature 内の id を得る



217
218
219
# File 'lib/tecsgen/core/componentobj.rb', line 217

def get_id_from_func_name(func_name)
  @func_name_to_id[func_name]
end

#get_nameObject



196
197
198
# File 'lib/tecsgen/core/componentobj.rb', line 196

def get_name
  @name
end

#has_descriptor?Boolean

Signature# 引数に Descriptor があるか?

Returns:

  • (Boolean)


414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/tecsgen/core/componentobj.rb', line 414

def has_descriptor?
  if get_descriptor_list.nil?
    # end_of_parse が呼び出される前に has_descriptor? が呼び出された
    # 呼び出し元は DescriptorType#initialize
    # この場合、同じシグニチャ内の引数が Descriptor 型である
    return true
  elsif get_descriptor_list.length > 0
    return true
  else
    return false
  end
end

#is_allocator?Boolean

Signature# 正当なアロケータ シグニチャかテストする

alloc, dealloc 関数を持つかどうか、第一引き数がそれぞれ、整数、ポインタ、第二引き数が、ポインタへのポインタ、なし

Returns:

  • (Boolean)


253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/tecsgen/core/componentobj.rb', line 253

def is_allocator?
  # 一回だけチェックする
  if @b_checked_as_allocator_signature == true
    return true
  end
  @b_checked_as_allocator_signature = true

  fha = get_function_head_array # 呼び口または受け口のシグニチャの関数配列
  if fha.nil? # nil なら文法エラーで有効値が設定されなかった
    return false
  end

  found_alloc = false
  found_dealloc = false
  fha.each{|fh| # fh: FuncHead                      # 関数配列中の各関数頭部
    fd = fh.get_declarator # fd: Decl  (関数頭部からDeclarotorを得る)
    if fd.is_function? # fd が関数でなければ、すでにエラー
      func_name = fd.get_name.to_sym
      if func_name == :alloc
        found_alloc = true
        params = fd.get_type.get_paramlist.get_items
        if params
          if !params[0].instance_of?(ParamDecl) ||
              !params[0].get_type.get_original_type.is_a?(IntType) ||
              params[0].get_direction != :IN
            # 第一引数が int 型でない
            if !params[0].instance_of?(ParamDecl) ||
                !params[0].get_type.is_a?(PtrType) ||
                !params[0].get_type.get_type.is_a?(PtrType) ||
                params[0].get_type.get_type.get_type.is_a?(PtrType) ||
                params[0].get_direction != :OUT
              # 第一引数がポインタ型でもない
              cdl_error3(@locale, "S1003 $1: \'alloc\' 1st parameter neither [in] integer type nor [out] double pointer type", @name)
            end
          elsif !params[1].instance_of?(ParamDecl) ||
              !params[1].get_type.is_a?(PtrType) ||
              !params[1].get_type.get_type.is_a?(PtrType) ||
              params[1].get_type.get_type.get_type.is_a?(PtrType) ||
              params[0].get_direction != :IN
            # (第一引数が整数で) 第二引数がポインタでない
            cdl_error3(@locale, "S1004 $1: \'alloc\' 2nd parameter not [in] double pointer", @name)
          end
        else
          cdl_error3(@locale, "S1005 $1: \'alloc\' has no parameter, unsuitable for allocator signature", @name)
        end
      elsif func_name == :dealloc
        found_dealloc = true
        params = fd.get_type.get_paramlist.get_items
        if params
          if !params[0].instance_of?(ParamDecl) ||
              !params[0].get_type.is_a?(PtrType) ||
              params[0].get_type.get_type.is_a?(PtrType) ||
              params[0].get_direction != :IN
            cdl_error3(@locale, "S1006 $1: \'dealloc\' 1st parameter not [in] pointer type", @name)
#            elsif params[1] != nil then    # 第二引き数はチェックしない
#              cdl_error3( @locale, "S1007 Error message is changed to empty" )
#                 cdl_error3( @locale, "S1007 $1: \'dealloc\' cannot has 2nd parameter" , @name )
          end
        else
          cdl_error3(@locale, "S1008 $1: \'dealloc\' has no parameter, unsuitable for allocator signature", @name)
        end
      end
      if found_alloc && found_dealloc
        return true
      end
    end
  }
  if !found_alloc
    cdl_error3(@locale, "S1009 $1: \'alloc\' function not found, unsuitable for allocator signature", @name)
  end
  if !found_dealloc
    cdl_error3(@locale, "S1010 $1: \'dealloc\' function not found, unsuitable for allocator signature", @name)
  end
  return false
end

#is_callback?Boolean

Signature# コールバックか?

指定子 callback が指定されていれば true

Returns:

  • (Boolean)


429
430
431
# File 'lib/tecsgen/core/componentobj.rb', line 429

def is_callback?
  @b_callback
end

#is_deviate?Boolean

Signature# 逸脱か?

指定子 deviate が指定されていれば true

Returns:

  • (Boolean)


435
436
437
# File 'lib/tecsgen/core/componentobj.rb', line 435

def is_deviate?
  @b_deviate
end

#is_empty?Boolean

Signature# 空か?

Returns:

  • (Boolean)


440
441
442
# File 'lib/tecsgen/core/componentobj.rb', line 440

def is_empty?
  @b_empty
end

#need_PPAllocator?(b_opaque = false) ⇒ Boolean

Signature# Push Pop Allocator が必要か?

Transparent RPC の場合 oneway かつ in の配列(size_is, count_is, string のいずれかで修飾)がある

Returns:

  • (Boolean)


446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/tecsgen/core/componentobj.rb', line 446

def need_PPAllocator?(b_opaque = false)
  fha = get_function_head_array # 呼び口または受け口のシグニチャの関数配列
  fha.each{|fh|
    fd = fh.get_declarator
    if fd.get_type.need_PPAllocator?(b_opaque)
      # p "#{fd.get_name} need_PPAllocator: true"
      @b_need_PPAllocator = true
      return true
    end
    # p "#{fd.get_name} need_PPAllocator: false"
  }
  return false
end


664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/tecsgen/core/tecsinfo.rb', line 664

def print_info(f, indent)
  f.print <<EOT

#{indent}/*** #{@global_name} signature information ****/
#{indent}cell nTECSInfo::tSignatureInfo #{@global_name}SignatureInfo {
#{indent}    name            = "#{@name}";
EOT
  @function_head_list.get_items.each{|fh|
    f.print <<EOT
#{indent}    cFunctionInfo[] = #{@global_name}_#{fh.get_name}FunctionInfo.eFunctionInfo;
EOT
  }
  f.print <<EOT
#{indent}};
EOT
  @function_head_list.get_items.each{|fh|
    fh.print_info f, indent
  }
end

#set_descriptor_listObject

Signature# 引数で参照されている Descriptor 型のリストを作成する



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/tecsgen/core/componentobj.rb', line 376

def set_descriptor_list
  desc_list = { }
  # p "has_desc #{@name}"
  fha = get_function_head_array # 呼び口または受け口のシグニチャの関数配列
  if fha.nil? # nil の場合、自己参照によるケースと仮定
    @descriptor_list = desc_list
    return desc_list
  end
  fha.each{|fh|
    fd = fh.get_declarator # fd: Decl  (関数頭部からDeclarotorを得る)
    if fd.is_function? # fd が関数でなければ、すでにエラー
      params = fd.get_type.get_paramlist.get_items
      if params
        params.each{|param|
          t = param.get_type.get_original_type
          while t.is_a? PtrType
            t = t.get_referto
          end
          # p "has_desc #{param.get_name} #{t}"
          if t.is_a? DescriptorType
            desc_list[t.get_signature] = param
            # p self.get_name, t.get_signature.get_name
            if t.get_signature == self
             # cdl_error( "S9999 Descriptor argument '$1' is the same signature as this parameter '$2' included", @name, param.get_name )
            end
            dir = param.get_direction
            if dir != :IN && dir != :OUT && dir != :INOUT
              cdl_error("S9999 Descriptor argument '$1' cannot be specified for $2 parameter", param.get_name, dir.to_s.downcase)
            end
          end
        }
      end
    end
  }
  @descriptor_list = desc_list
end

#set_specifier_list(spec_list) ⇒ Object

Signature# signature の指定子を設定

STAGE: B

spec_list
[ :CONTEXT, String ], …

s s



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/tecsgen/core/componentobj.rb', line 165

def set_specifier_list(spec_list)
  return if spec_list.nil? # 空ならば何もしない

  spec_list.each {|s|
    case s[0] # statement_specifier
    when :CALLBACK
      @b_callback = true
    when :CONTEXT # [context("non-task")] etc
      if @context
        cdl_error("S1001 context specifier duplicate")
      end
      # @context = s[1].gsub( /\A\"(.*)\"$/, "\\1" )
      @context = CDLString.remove_dquote s[1]
      case @context
      when "non-task", "task", "any"
      else
        cdl_warning("W1001 \'$1\': unknown context type. usually specifiy task, non-task or any", @context)
      end
    when :DEVIATE
      @b_deviate = true
    when :GENERATE
      if @generate
        cdl_error("S9999 generate specifier duplicate")
      end
      @generate = [s[1], s[2]] # [ PluginName, "option" ]
    else
      cdl_error("S1002 \'$1\': unknown specifier for signature", s[0])
    end
  }
end

#show_tree(indent) ⇒ Object



460
461
462
463
464
465
466
467
468
# File 'lib/tecsgen/core/componentobj.rb', line 460

def show_tree(indent)
  indent.times { print "  " }
  puts "Signature: name: #{@name} context: #{@context} deviate : #{@b_deviate} PPAllocator: #{@b_PPAllocator} #{self}"
  (indent + 1).times { print "  " }
  puts "namespace_path: #{@NamespacePath}"
  (indent + 1).times { print "  " }
  puts "function head list:"
  @function_head_list.show_tree(indent + 2)
end

#signature_pluginObject

Signature# シグニチャプラグイン (generate 指定子)



330
331
332
333
334
# File 'lib/tecsgen/core/componentobj.rb', line 330

def signature_plugin
  plugin_name = @generate[0]
  option = @generate[1]
  apply_plugin(plugin_name, option)
end

#unjoin_pluginObject



155
156
157
# File 'lib/tecsgen/core/unjoin_plugin.rb', line 155

def unjoin_plugin
  @generate = nil
end