Class: Generate

Inherits:
Node show all
Includes:
PluginModule
Defined in:
lib/tecsgen/core/componentobj.rb

Overview

generate: signature, celltype, cell へのプラグインのロードと適用

Instance Method Summary collapse

Methods included from PluginModule

gen_plugin_post_code, #generate_and_parse, #load_plugin

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(plugin_name, object_nsp, option) ⇒ Generate

Returns a new instance of Generate.



7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
# File 'lib/tecsgen/core/componentobj.rb', line 7661

def initialize(plugin_name, object_nsp, option)
  super()
  @plugin_name = plugin_name
  @object_nsp = object_nsp
  option = option.to_s # option は Token
  @option = option
  @plugin_object = nil

  dbgPrint "generate: #{plugin_name} #{object_nsp} option=#{option}\n"

  object = Namespace.find(object_nsp)
  if object.is_a?(Signature) ||
     object.is_a?(Celltype) ||
     object.is_a?(CompositeCelltype) ||
     object.is_a?(Cell)
    @plugin_object = object.apply_plugin(@plugin_name, @option)
  elsif object
    # V1.5.0 以前の仕様では、signature のみ可能だった
#      cdl_error( "S1149 $1 not signature" , signature_nsp )
    cdl_error("S9999 generate: '$1' neither signature, celltype nor cell", object_nsp)
    return
  else
    cdl_error("S9999 generate: '$1' not found", object_nsp)
  end
end