Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.tab.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.tab.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.tab.rb	(revision 374)
@@ -1,5 +1,5 @@
 #
 # DO NOT MODIFY!!!!
-# This file is automatically generated by Racc 1.4.14
+# This file is automatically generated by Racc 1.4.9
 # from Racc grammer file "".
 #
@@ -8,293 +8,300 @@
 class C_parser < Racc::Parser
 
-module_eval(<<'...end C_parser.y.rb/module_eval...', 'C_parser.y.rb', 727)
-
-  RESERVED = {
-    # keyword
-    'typedef' => :TYPEDEF,
-    'struct' => :STRUCT,
-    'union' => :UNION,
-    'sizeof' => :SIZEOF,
-    'throw' => :THROW,
-
-    # specifier
-    # types
-    'void'    => :VOID,
-    'char'    => :CHAR,
-    'short'   => :SHORT,
-
-    'volatile'=> :VOLATILE,
-    'const'   => :CONST,
-    'extern'   => :EXTERN,
-
-    'long'    => :LONG,
-    'float'   => :FLOAT,
-    'double'  => :DOUBLE,
-    'signed'  => :SIGNED,
-    'unsigned'=> :UNSIGNED,
-
-    'int'     => :INT,
-    'enum'    => :ENUM,
-
-    'if'      => :IF,
-    'else'    => :ELSE,
-    'while'   => :WHILE,
-    'do'      => :DO,
-    'for'     => :FOR,
-    'case'    => :CASE,
-    'default' => :DEFAULT,
-    'goto'    => :GOTO,
-    'continue' => :CONTINUE,
-    'break'   => :BREAK,
-    'return'  => :RETURN,
-    '__inline__'  => :__INLINE__,
-    'inline'  => :INLINE,
-    '__inline'  => :__INLINE,
-    'Inline'  => :CINLINE,        # inline starting with Capital letter
-    'static'  => :STATIC,
-    'register' => :REGISTER,
-    'auto'    => :AUTO,
-    '__extension__'    => :EXTENSION,
-
-  }
-
-  @@generator_nest = -1
-  @@generator_stack = []
-  @@current_locale = []
-
-  def finalize
-
-    # mikan Namespace.pop
-    Celltype.pop
-    Cell.pop
-    CompositeCelltype.pop
-    Region.pop
-
-  end
-
-  def set_plugin( plugin )
-    @plugin = plugin
-  end
-
-  def self.get_plugin
-    @@generator_stack[@@generator_nest].get_plugin
-  end
-
-  def get_plugin
-    @plugin
-  end
-
-  def parse(files)
-
-    # mikan Namespace.push
-    Celltype.push
-    Cell.push
-    CompositeCelltype.push
-    Region.push
-
-    @@generator_nest += 1
-    @@generator_stack[@@generator_nest] = self
-    @b_no_type_name = false
-
-   begin
-
-    @q = []
-    comment = false
-
-    # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策
-    TECS_LANG::set_kcode_binary
-
-    # 800U, 0xffLL など (整数リテラルに共通の修飾子)
-    integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?"
-
-    files.each {|file|
-      lineno = 1
-     begin
-#2.0       IO.foreach(file) {|line|
-       TECSIO.foreach(file) {|line|
-        col = 1
-        line.rstrip!
-
-        until line.empty?
-
-          if comment
-            case line
-            # コメント終了
-            when /\A\*\//
-              comment = false
-            when /\A./
-              ;
-            end
-          else
-            case line
-            # 空白、プリプロセスディレクティブ
-            when /\A\s+/
-              ;
-            # 識別子
-            when /\A[a-zA-Z_]\w*/
-              word = $&
-              @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)]
-            # 16 進数定数
-            when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/
-              @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)]
-            # 8 進数定数
-            when /\A0[0-7]+#{integer_qualifier}/
-              @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)]
-            # 浮動小数定数
-            when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/
-              @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)]
-            # 整数定数
-            when /\A\d+#{integer_qualifier}/
-            # when /\A\d+/
-              @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)]
-            # 文字
-            when /\A'(?:[^'\\]|\\.)'/
-              @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)]
-            # 文字列
-#              "#include  #include #include \"../systask/logtask.cfg\"       最後の " 忘れ)で無限ループ
-#            when /\A"(?:[^"\\]+|\\.)*"/
-            when /\A"(?:[^"\\]|\\.)*"/   # これはうまく行くようだ
-              @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)]
-            # 行コメント
-            when /\A\/\/.*$/
-              # 読み飛ばすだけ
-            # コメント開始
-            when /\A\/\*/
-              comment = true
-            when /\A>>=/, /\A<<=/, /\A>>/,  /\A<</
-              @q << [$&, Token.new($&, file, lineno, col)]
-            when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/
-              @q << [$&, Token.new($&, file, lineno, col)]
-            when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/
-              @q << [$&, Token.new($&, file, lineno, col)]
-            when /\A./
-              @q << [$&, Token.new($&, file, lineno, col)]
-            else
-              raise
-            end
-          end
-
-          line = $'
-          col += $&.length
-        end
-
-        lineno += 1
-      }
-
-     rescue => evar
-       Generator.error( "B1002 while open or reading \'$1\'" , file )
-       print_exception( evar )
-     end
-    }
-
-    # 終了の印
-    @q << nil
-
-    @yydebug = true
-    do_parse
-
-   ensure
-    @@generator_nest -= 1
-    TECS_LANG::reset_kcode
-   end
-
-  end
-
-
-  def next_token
-    token = @q.shift
-
-    if token then
-      @@current_locale[@@generator_nest] = token[1].locale
-
-      case token[1].val
-      when ";", ":", ",", "(", ")", "{", "}"
-        set_no_type_name false
-      when ".", "->"
-        set_no_type_name true
-      end
-
-      # TYPE_NAME トークンへ置き換え
-      if @b_no_type_name == false
-        if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then
-          token[0] = :TYPE_NAME
-          locale = @@current_locale[@@generator_nest]
+module_eval(<<'...end C_parser.y.rb/module_eval...', 'C_parser.y.rb', 784)
+
+	RESERVED = {
+		# keyword
+		'typedef' => :TYPEDEF,
+		'struct' => :STRUCT,
+		'union' => :UNION,
+		'sizeof' => :SIZEOF,
+		'throw' => :THROW,
+
+		# specifier
+		# types
+		'void'    => :VOID,
+		'char'    => :CHAR,
+		'short'   => :SHORT,
+
+		'volatile'=> :VOLATILE,
+		'restrict'=> :RESTRICT,
+		'const'   => :CONST,
+		'extern'   => :EXTERN,
+
+		'long'    => :LONG,
+		'float'   => :FLOAT,
+		'double'  => :DOUBLE,
+		'signed'  => :SIGNED,
+		'unsigned'=> :UNSIGNED,
+
+		'int'     => :INT,
+		'enum'    => :ENUM,
+
+		'if'      => :IF,
+		'else'    => :ELSE,
+		'while'   => :WHILE,
+		'do'      => :DO,
+		'for'     => :FOR,
+		'switch'  => :SWITCH,
+		'case'    => :CASE,
+		'default' => :DEFAULT,
+		'goto'    => :GOTO,
+		'continue' => :CONTINUE,
+		'break'   => :BREAK,
+		'return'  => :RETURN,
+		'__inline__'  => :__INLINE__,
+		'inline'  => :INLINE,
+		'__inline'  => :__INLINE,
+		'Inline'  => :CINLINE,        # inline starting with Capital letter
+		'static'  => :STATIC,
+		'register' => :REGISTER,
+		'auto'    => :AUTO,
+		'__extension__'    => :EXTENSION,
+		'__asm__' => :_ASM,
+		'asm' =>     :_ASM
+
+	}
+
+	@@generator_nest = -1
+	@@generator_stack = []
+	@@current_locale = []
+
+	def finalize
+
+		# mikan Namespace.pop
+		Celltype.pop
+		Cell.pop
+		CompositeCelltype.pop
+		Region.pop
+
+	end
+
+	def set_plugin( plugin )
+		@plugin = plugin
+	end
+
+	def self.get_plugin
+		@@generator_stack[@@generator_nest].get_plugin
+	end
+
+	def get_plugin
+		@plugin
+	end
+
+	def parse(files)
+
+		# mikan Namespace.push
+		Celltype.push
+		Cell.push
+		CompositeCelltype.push
+		Region.push
+
+		@@generator_nest += 1
+		@@generator_stack[@@generator_nest] = self
+		@b_no_type_name = false
+
+	begin
+
+		@q = []
+		comment = false
+#		b_asm   = false
+
+		# euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策
+		TECS_LANG::set_kcode_binary
+
+		# 800U, 0xffLL など (整数リテラルに共通の修飾子)
+		integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?"
+
+		files.each {|file|
+			lineno = 1
+		begin
+#2.0		IO.foreach(file) {|line|
+			TECSIO.foreach(file) {|line|
+			col = 1
+			line.rstrip!
+
+			until line.empty?
+
+				if comment
+					case line
+					# コメント終了
+					when /\A\*\//
+						comment = false
+					when /\A./
+						;
+					end
+				else
+					case line
+					# 空白、プリプロセスディレクティブ
+					when /\A\s+/
+						;
+					# 識別子
+					when /\A[a-zA-Z_]\w*/
+						word = $&
+						@q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)]
+					# 16 進数定数
+					when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/
+						@q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)]
+					# 8 進数定数
+					when /\A0[0-7]+#{integer_qualifier}/
+						@q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)]
+					# 浮動小数定数
+					when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/
+						@q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)]
+					# 整数定数
+					when /\A\d+#{integer_qualifier}/
+					# when /\A\d+/
+						@q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)]
+					# 文字
+					when /\A'(?:[^'\\]|\\.)'/
+						@q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)]
+					# 文字列
+#					"#include  #include #include \"../systask/logtask.cfg\"       最後の " 忘れ)で無限ループ
+#					when /\A"(?:[^"\\]+|\\.)*"/
+					when /\A"(?:[^"\\]|\\.)*"/   # これはうまく行くようだ
+						@q << [:STRING_LITERAL, Token.new($&, file, lineno, col)]
+					# 行コメント
+					when /\A\/\/.*$/
+						# 読み飛ばすだけ
+					# コメント開始
+					when /\A\/\*/
+						comment = true
+					when /\A>>=/, /\A<<=/, /\A>>/,  /\A<</
+						@q << [$&, Token.new($&, file, lineno, col)]
+					when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/
+						@q << [$&, Token.new($&, file, lineno, col)]
+					when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/
+						@q << [$&, Token.new($&, file, lineno, col)]
+					when /\A\|\|/, /\A\&\&/
+						@q << [$&, Token.new($&, file, lineno, col)]
+					when /\A./
+						@q << [$&, Token.new($&, file, lineno, col)]
+					else
+						raise
+					end
+				end
+
+				line = $'
+				col += $&.length
+			end
+
+			lineno += 1
+		}
+
+		rescue => evar
+			Generator.error( "B1002 while open or reading \'$1\'" , file )
+			print_exception( evar )
+		end
+	}
+
+	# 終了の印
+	@q << nil
+
+	@yydebug = true
+	do_parse
+
+		ensure
+			@@generator_nest -= 1
+			TECS_LANG::reset_kcode
+		end
+
+	end
+
+
+	def next_token
+		token = @q.shift
+
+		if token then
+			@@current_locale[@@generator_nest] = token[1].locale
+
+			case token[1].val
+			when ";", ":", ",", "(", ")", "{", "}"
+			set_no_type_name false
+			when ".", "->"
+			set_no_type_name true
+			end
+
+			# TYPE_NAME トークンへ置き換え
+			if @b_no_type_name == false
+				if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then
+					token[0] = :TYPE_NAME
+					locale = @@current_locale[@@generator_nest]
 #print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}: type_name'\n" )
-        end
-      end
-
-      if $debug then     # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生) 
-        locale = @@current_locale[@@generator_nest]
-        if token then
-          print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" )
-        else
-          print( "#{locale[0]}: line #{locale[1]} : EOF\n" )
-        end
-      end
-    end
-
-    token
-  end
-
-  def on_error(t, v, vstack)
-    if v == "$" then
-     Generator.error( "B1003 Unexpected EOF"  )
-    else
-     Generator.error( "B1004 syntax error near \'$1\'" , v.val )
-    end
-
-  end
-
-  def self.current_locale
-    @@current_locale[ @@generator_nest ]
-  end
-
-  @@n_error = 0
-  @@n_warning = 0
-  @@n_info = 0
-
-  # このメソッドは構文解析、意味解析からのみ呼出し可（コード生成でエラー発生は不適切）
-  def self.error( msg )
-    @@n_error += 1
-    locale = @@current_locale[ @@generator_nest ]
-
-    if locale then
-      Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
-    else
-      Console.puts "error: #{msg}"
-    end
-  end
-
-  # このメソッドは構文解析、意味解析からのみ呼出し可（コード生成でウォーニング発生は不適切）
-  def self.warning( msg )
-    @@n_warning += 1
-    locale = @@current_locale[ @@generator_nest ]
-    Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
-  end
-
-  # このメソッドは構文解析、意味解析からのみ呼出し可
-  def self.info( msg )
-    @@n_info += 1
-    locale = @@current_locale[ @@generator_nest ]
-    Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
-  end
-
-  def self.get_n_error
-    @@n_error
-  end
-
-  def self.get_n_warning
-    @@n_warning
-  end
-
-  def self.get_nest
-    @@generator_nest
-  end
-
-  def set_no_type_name b_no_type_name
-    locale = @@current_locale[ @@generator_nest ]
+				end
+			end
+
+			if $debug then     # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生) 
+				locale = @@current_locale[@@generator_nest]
+				if token then
+					print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" )
+				else
+					print( "#{locale[0]}: line #{locale[1]} : EOF\n" )
+				end
+			end
+		end
+
+		token
+	end
+
+	def on_error(t, v, vstack)
+		if v == "$" then
+			Generator.error( "B1003 Unexpected EOF"  )
+		else
+			Generator.error( "B1004 syntax error near \'$1\'" , v.val )
+		end
+
+	end
+
+	def self.current_locale
+		@@current_locale[ @@generator_nest ]
+	end
+
+	@@n_error = 0
+	@@n_warning = 0
+	@@n_info = 0
+
+	# このメソッドは構文解析、意味解析からのみ呼出し可（コード生成でエラー発生は不適切）
+	def self.error( msg )
+		@@n_error += 1
+		locale = @@current_locale[ @@generator_nest ]
+
+		if locale then
+			Console.puts "#{locale[0]}:#{locale[1]}: error: #{msg}"
+		else
+			Console.puts "error: #{msg}"
+		end
+	end
+
+	# このメソッドは構文解析、意味解析からのみ呼出し可（コード生成でウォーニング発生は不適切）
+	def self.warning( msg )
+		@@n_warning += 1
+		locale = @@current_locale[ @@generator_nest ]
+		Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
+	end
+
+	# このメソッドは構文解析、意味解析からのみ呼出し可
+	def self.info( msg )
+		@@n_info += 1
+		locale = @@current_locale[ @@generator_nest ]
+		Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
+	end
+
+	def self.get_n_error
+		@@n_error
+	end
+
+	def self.get_n_warning
+		@@n_warning
+	end
+
+	def self.get_nest
+		@@generator_nest
+	end
+
+	def set_no_type_name b_no_type_name
+		locale = @@current_locale[ @@generator_nest ]
 #print "b_no_type_name=#{b_no_type_name} #{locale[0]}: line #{locale[1]}\n"
-    @b_no_type_name = b_no_type_name
-  end
+		@b_no_type_name = b_no_type_name
+	end
 
 ...end C_parser.y.rb/module_eval...
@@ -302,127 +309,145 @@
 
 clist = [
-'106,107,108,109,110,112,70,113,68,181,302,143,55,118,119,208,117,120',
-'121,122,123,124,125,106,107,108,109,110,112,337,113,209,336,210,143',
-'76,118,119,170,117,120,121,122,123,124,125,305,69,301,67,350,28,29,106',
-'107,108,109,110,112,75,113,28,29,162,143,77,118,119,170,117,120,121',
-'122,123,124,125,169,79,205,206,353,306,307,308,309,310,311,312,313,314',
-'315,264,55,144,8,9,10,11,15,16,17,18,19,20,21,174,267,23,25,27,28,29',
-'197,198,375,263,144,106,107,108,109,110,112,346,113,342,197,198,143',
-'173,118,119,153,117,120,121,122,123,124,125,106,107,108,109,110,112',
-'144,113,357,341,3,143,274,118,119,253,117,120,121,122,123,124,125,106',
-'107,108,109,110,112,54,113,199,200,361,143,53,118,119,98,117,120,121',
-'122,123,124,125,106,107,108,109,110,112,345,113,363,83,364,143,82,118',
-'119,346,117,120,121,122,123,124,125,81,144,249,83,274,253,82,253,53',
-'106,107,108,109,110,112,337,113,55,336,365,236,366,118,119,144,117,120',
-'121,122,123,124,125,54,249,367,194,253,97,53,53,195,196,81,199,200,55',
-'55,144,230,89,8,9,10,11,15,16,17,18,19,20,21,79,372,23,25,27,28,29,199',
-'200,144,231,88,232,233,234,235,87,237,238,240,241,242,243,194,377,194',
-'199,200,195,196,195,196,378,39,40,41,42,43,44,45,46,144,106,107,108',
-'109,110,112,379,113,205,206,380,143,381,118,119,382,117,120,121,122',
-'123,124,125,106,107,108,109,110,112,384,113,197,198,385,143,386,118',
-'119,65,117,120,121,122,123,124,125,106,107,108,109,110,112,62,113,391',
-'37,392,143,393,118,119,394,117,120,121,122,123,124,125,106,107,108,109',
-'110,112,61,113,211,212,396,143,398,118,119,280,117,120,121,122,123,124',
-'125,47,144,279,36,277,8,9,10,11,15,16,17,18,19,20,21,271,37,23,25,27',
-'28,29,270,144,38,8,9,10,11,15,16,17,18,19,20,21,199,200,23,25,27,28',
-'29,269,97,256,144,255,39,40,41,42,43,44,45,46,36,247,8,9,10,11,15,16',
-'17,18,19,20,21,144,246,23,25,27,28,29,245,32,38,106,107,108,109,110',
-'112,216,113,215,210,209,143,208,118,119,207,117,120,121,122,123,124',
-'125,39,40,41,42,43,44,45,46,303,106,107,108,109,110,112,316,113,317',
-'319,320,236,321,118,119,323,117,120,121,122,123,124,125,54,54,54,324',
-'54,325,53,53,53,326,53,329,176,55,55,55,230,55,8,9,10,11,15,16,17,18',
-'19,20,21,79,175,23,25,27,28,29,77,97,144,231,171,232,233,234,235,163',
-'237,238,240,241,242,243,183,348,184,349,185,186,187,207,,,39,40,41,42',
-'43,44,45,46,144,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120',
-'121,122,123,124,125,,,106,107,108,109,110,112,,113,,,,236,,118,119,',
-'117,120,121,122,123,124,125,54,54,54,,54,,53,53,53,,53,,,55,55,55,230',
-'55,8,9,10,11,15,16,17,18,19,20,21,79,,23,25,27,28,29,,,,231,,232,233',
-'234,235,144,237,238,240,241,242,243,201,202,203,204,201,202,203,204',
-',,39,40,41,42,43,44,45,46,144,106,107,108,109,110,112,,113,,,,236,,118',
-'119,,117,120,121,122,123,124,125,54,201,202,203,204,,53,,,,,,,55,,,230',
-',8,9,10,11,15,16,17,18,19,20,21,79,,23,25,27,28,29,,,,231,,232,233,234',
-'235,,237,238,240,241,242,243,,,,,,,,,,,39,40,41,42,43,44,45,46,144,106',
-'107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125',
-'106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124',
-'125,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123',
-'124,125,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122',
-'123,124,125,,144,,,,,,,,106,107,108,109,110,112,,113,,,,143,,118,119',
-'144,117,120,121,122,123,124,125,106,107,108,109,110,112,,113,,368,,143',
-',118,119,144,117,120,121,122,123,124,125,,,,,,,,106,107,108,109,110',
-'112,,113,144,,,236,,118,119,,117,120,121,122,123,124,125,,,,,,,,,,,',
-',,,,,230,144,8,9,10,11,15,16,17,18,19,20,21,79,,23,25,27,28,29,,,,231',
-'144,232,233,234,235,,237,238,240,241,242,243,,,,,,,,,,,39,40,41,42,43',
-'44,45,46,144,106,107,108,109,110,112,,113,,,,236,,118,119,,117,120,121',
-'122,123,124,125,,,,,,,,,,,,,,,,,230,,8,9,10,11,15,16,17,18,19,20,21',
-'79,,23,25,27,28,29,,,,231,,232,233,234,235,,237,238,240,241,242,243',
-',,,,,,,,,,39,40,41,42,43,44,45,46,144,106,107,108,109,110,112,,113,',
-',,236,,118,119,,117,120,121,122,123,124,125,,,,,,,,,,,,,,,,,230,,8,9',
-'10,11,15,16,17,18,19,20,21,79,,23,25,27,28,29,,,,231,,232,233,234,235',
-',237,238,240,241,242,243,,,,,,,,,,,39,40,41,42,43,44,45,46,144,106,107',
-'108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125,106',
-'107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125',
-'106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124',
-'125,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123',
-'124,125,,144,,,,,141,,,,,,,142,106,107,108,109,110,112,,113,,147,144',
-'143,,118,119,,117,120,121,122,123,124,125,106,107,108,109,110,112,,113',
-',,144,143,,118,119,,117,120,121,122,123,124,125,106,107,108,109,110',
-'112,,113,,,144,143,,118,119,,117,120,121,122,123,124,125,106,107,108',
-'109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125,,144,',
-',,,,,,106,107,108,109,110,112,,113,,,,143,,118,119,144,117,120,121,122',
-'123,124,125,106,107,108,109,110,112,,113,,,,143,,118,119,144,117,120',
-'121,122,123,124,125,106,107,108,109,110,112,,113,,,,143,,118,119,144',
-'117,120,121,122,123,124,125,106,107,108,109,110,112,,113,,,,143,,118',
-'119,,117,120,121,122,123,124,125,,144,,,,,141,351,,,,,,142,106,107,108',
-'109,110,112,,113,,,144,143,,118,119,,117,120,121,122,123,124,125,106',
-'107,108,109,110,112,,113,,,144,143,,118,119,,117,120,121,122,123,124',
-'125,106,107,108,109,110,112,,113,,,144,143,,118,119,,117,120,121,122',
-'123,124,125,106,107,108,109,110,112,,113,,,,143,,118,119,,117,120,121',
-'122,123,124,125,,144,,,,,,,,106,107,108,109,110,112,,113,,,,143,,118',
-'119,144,117,120,121,122,123,124,125,106,107,108,109,110,112,,113,,,',
-'143,,118,119,144,117,120,121,122,123,124,125,106,107,108,109,110,112',
-',113,,,,143,,118,119,144,117,120,121,122,123,124,125,,,,,,,,,,106,107',
-'108,109,110,112,,113,,,,236,,118,119,144,117,120,121,122,123,124,125',
-',,,,,,,,,,,,,,,144,230,,8,9,10,11,15,16,17,18,19,20,21,79,239,23,25',
-'27,28,29,,,144,231,,232,233,234,235,,237,238,240,241,242,243,,,,,,,',
-',,,39,40,41,42,43,44,45,46,144,106,107,108,109,110,112,,113,,338,,143',
-',118,119,,117,120,121,122,123,124,125,106,107,108,109,110,112,,113,',
-',,143,,118,119,,117,120,121,122,123,124,125,8,9,10,11,15,16,17,18,19',
-'20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27,28',
-'29,,106,107,108,109,110,112,,113,,,144,143,,118,119,,117,120,121,122',
-'123,124,125,106,107,108,109,110,112,,113,,,144,143,,118,119,,117,120',
-'121,122,123,124,125,106,107,108,109,110,112,,113,,,,143,,118,119,,117',
-'120,121,122,123,124,125,106,107,108,109,110,189,,113,,,,143,,118,119',
-',117,120,121,122,123,124,125,,144,,,,,,,,106,107,108,109,110,191,,113',
-',,,143,,118,119,144,117,120,121,122,123,124,125,106,107,108,109,110',
-'191,,113,,,,143,,118,119,144,117,120,121,122,123,124,125,106,107,108',
-'109,110,112,,113,,,,143,,118,119,144,117,120,121,122,123,124,125,106',
-'107,108,109,110,112,,113,,,,143,,118,119,,117,120,121,122,123,124,125',
-',144,,,,,141,,,,,,,142,,,328,,106,107,108,109,110,112,144,113,,,,143',
-',118,119,,117,120,121,122,123,124,125,,,,,,,144,,,,,,,,,,,106,107,108',
-'109,110,112,,113,,,,236,144,118,119,,117,120,121,122,123,124,125,,,',
-',,,,,,,,,,,,,230,,8,9,10,11,15,16,17,18,19,20,21,79,144,23,25,27,28',
-'29,,,,231,,232,233,234,235,,237,238,240,241,242,243,,,,,,,274,334,,253',
-'39,40,41,42,43,44,45,46,144,55,,,,,249,334,,253,,,53,,,,,,,55,,,,,8',
-'9,10,11,15,16,17,18,19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18',
-'19,20,21,,,23,25,27,28,29,370,,,,,,,,39,40,41,42,43,44,45,46,,,149,',
-',,,,,,39,40,41,42,43,44,45,46,,8,9,10,11,15,16,17,18,19,20,21,,,23,25',
-'27,28,29,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27,28,29,,,,330,,,,',
-'39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41,42,43,44,45,46,8,9,10,11',
-'15,16,17,18,19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18,19,20,21',
-',,23,25,27,28,29,,,,,,,,,39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41',
-'42,43,44,45,46,8,9,10,11,15,16,17,18,19,20,21,,340,23,25,27,28,29,8',
-'9,10,11,15,16,17,18,19,20,21,,164,23,25,27,28,29,,,,,,,,,39,40,41,42',
-'43,44,45,46,,,,,,,,,,,39,40,41,42,43,44,45,46,8,9,10,11,15,16,17,18',
-'19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27',
-'28,29,,,,,,,,,39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41,42,43,44,45',
-'46,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17',
-'18,19,20,21,,257,23,25,27,28,29,,,,,,,,,39,40,41,42,43,44,45,46,,,,',
-',,,,,,39,40,41,42,43,44,45,46,8,9,10,11,15,16,17,18,19,20,21,,,23,25',
-'27,28,29,8,9,10,11,15,16,17,18,19,20,21,,262,23,25,27,28,29,,,,,,,,',
-'39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41,42,43,44,45,46,8,9,10,11',
-'15,16,17,18,19,20,21,,,23,25,27,28,29,8,9,10,11,15,16,17,18,19,20,21',
-',,23,25,27,28,29,,,,,,,,,39,40,41,42,43,44,45,46,,,,,,,,,,,39,40,41',
-'42,43,44,45,46,8,9,10,11,15,16,17,18,19,20,21,,,23,25,27,28,29' ]
-        racc_action_table = arr = ::Array.new(2875, nil)
+'111,112,113,114,115,117,294,118,56,298,55,163,54,123,124,82,54,262,122',
+'125,126,127,128,129,130,111,112,113,114,115,117,217,118,271,391,101',
+'163,91,123,124,82,271,271,122,125,126,127,128,129,130,56,70,171,72,82',
+'69,397,71,80,32,33,34,224,309,271,223,216,226,84,227,228,229,84,392',
+'101,325,272,171,298,312,80,164,165,172,393,173,174,175,176,177,178,179',
+'180,149,181,101,218,79,308,369,388,32,33,34,265,266,164,165,172,73,173',
+'174,175,176,177,178,179,180,149,181,111,112,113,114,115,117,384,118',
+'32,33,34,163,78,123,124,82,440,402,122,125,126,127,128,129,130,55,219',
+'271,271,383,101,54,332,248,325,387,55,298,249,250,56,382,54,111,112',
+'113,114,115,117,56,118,56,171,331,163,395,123,124,82,276,210,122,125',
+'126,127,128,129,130,420,55,378,210,248,377,396,54,330,249,250,393,92',
+'164,165,172,56,173,174,175,176,177,178,179,180,149,181,171,9,10,11,12',
+'13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,355,356',
+'213,164,165,172,204,173,174,175,176,177,178,179,180,149,181,111,112',
+'113,114,115,117,404,118,93,378,203,163,377,123,124,82,193,271,122,125',
+'126,127,128,129,130,111,112,113,114,115,117,290,118,101,86,55,163,85',
+'123,124,82,54,291,122,125,126,127,128,129,130,56,357,171,13,14,15,16',
+'17,18,19,20,21,22,26,28,30,31,32,33,34,248,86,322,438,85,249,250,171',
+'434,435,370,164,165,172,271,173,174,175,176,177,178,179,180,149,181',
+'259,260,261,321,255,256,257,258,315,316,262,164,165,172,271,173,174',
+'175,176,177,178,179,180,149,181,111,112,113,114,115,117,403,118,317',
+'318,263,163,264,123,124,82,320,271,122,125,126,127,128,129,130,13,14',
+'15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,437,111,112,113,114,115',
+'117,360,118,400,171,271,163,368,123,124,82,166,103,122,125,126,127,128',
+'129,130,102,55,255,256,257,258,310,54,255,256,257,258,405,164,165,172',
+'56,173,174,175,176,177,178,179,180,149,181,171,9,10,11,12,13,14,15,16',
+'17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,259,260,301,164,165',
+'172,300,173,174,175,176,177,178,179,180,149,181,111,112,113,114,115',
+'117,408,118,253,254,292,163,409,123,124,82,253,254,122,125,126,127,128',
+'129,130,111,112,113,114,115,117,410,118,253,254,55,163,289,123,124,82',
+'54,288,122,125,126,127,128,129,130,56,415,171,13,14,15,16,17,18,19,20',
+'21,22,26,28,30,31,32,33,34,253,254,253,254,251,252,261,171,211,212,285',
+'164,165,172,284,173,174,175,176,177,178,179,180,149,181,237,238,239',
+'240,241,242,243,244,245,246,247,164,165,172,283,173,174,175,176,177',
+'178,179,180,149,181,111,112,113,114,115,117,282,118,251,252,389,163',
+'389,123,124,82,251,252,122,125,126,127,128,129,130,111,112,113,114,115',
+'117,101,118,67,82,55,163,64,123,124,82,54,63,122,125,126,127,128,129',
+'130,56,55,171,55,55,294,280,54,298,54,54,54,279,430,431,432,56,433,56',
+'56,56,365,436,278,263,275,264,171,273,270,48,164,165,172,444,173,174',
+'175,176,177,178,179,180,149,181,269,3,,,,,,,,,,164,165,172,,173,174',
+'175,176,177,178,179,180,149,181,111,112,113,114,115,117,,118,,,,163',
+',123,124,82,,,122,125,126,127,128,129,130,111,112,113,114,115,117,,118',
+',,,148,,123,124,,,,122,125,126,127,128,129,130,,,171,111,112,113,114',
+'115,117,,118,,,,148,,123,124,,,,122,125,126,127,128,129,130,,,,164,165',
+'172,,173,174,175,176,177,178,179,180,149,181,,,,,,,111,112,113,114,115',
+'117,,118,,411,,148,,123,124,,,149,122,125,126,127,128,129,130,,,,111',
+'112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129',
+'130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127',
+'128,129,130,,,171,,,,,,,,,,,,,149,,111,112,113,114,115,117,,118,,,171',
+'148,,123,124,,,,122,125,126,127,128,129,130,,149,,,,,,,,111,112,113',
+'114,115,117,,118,,,,148,,123,124,146,398,149,122,125,126,127,128,129',
+'130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127',
+'128,129,130,111,112,113,114,115,117,,118,,149,,148,,123,124,389,,,122',
+'125,126,127,128,129,130,,,,147,,,111,112,113,114,115,117,,118,,,,148',
+'149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,',
+'118,,379,,148,149,123,124,,,,122,125,126,127,128,129,130,,,,,,,,,,,',
+',149,,,,,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126',
+'127,128,129,130,,149,,,,,,,,,,,,,,,,,,,,,,,,,149,171,9,10,11,12,13,14',
+'15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,111,112,113',
+'114,115,117,,118,,,,148,,123,124,149,,,122,125,126,127,128,129,130,111',
+'112,113,114,115,117,,118,,,,148,,123,124,146,,,122,125,126,127,128,129',
+'130,111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127',
+'128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122',
+'125,126,127,128,129,130,,,147,,,111,112,113,114,115,117,,118,,,,148',
+'149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,',
+'118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113,114',
+'115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,111,112',
+'113,114,115,117,,118,,,,148,,123,124,146,,149,122,125,126,127,128,129',
+'130,111,112,113,114,115,117,427,118,,,,148,,123,124,,,149,122,125,126',
+'127,128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149',
+'122,125,126,127,128,129,130,,,147,,,111,112,113,114,115,117,,118,,185',
+',148,149,123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115',
+'117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112',
+'113,114,115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130',
+'111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128',
+'129,130,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126',
+'127,128,129,130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149',
+'122,125,126,127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123',
+'124,,,149,122,125,126,127,128,129,130,111,112,113,114,115,117,,118,',
+',,148,,123,124,,,149,122,125,126,127,128,129,130,,111,112,113,114,115',
+'117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113',
+'114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111',
+'112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129',
+'130,,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126',
+'127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123,124,,,149,122',
+'125,126,127,128,129,130,111,112,113,114,115,117,,118,,,,148,,123,124',
+',,149,122,125,126,127,128,129,130,,111,112,113,114,115,117,,118,,,,148',
+',123,124,,,149,122,125,126,127,128,129,130,111,112,113,114,115,117,',
+'118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113,114',
+'115,117,,118,,,,148,,123,124,146,,149,122,125,126,127,128,129,130,,111',
+'112,113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129',
+'130,,,,,,,,,,,,,,,,,,149,,,,,,,,,,147,,,111,112,113,114,115,117,,118',
+',,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113,114,115',
+'117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,,,,,,13',
+'14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114,115',
+'117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,,111,112',
+'113,114,115,231,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130',
+'111,112,113,114,115,233,,118,,,,148,,123,124,,,,122,125,126,127,128',
+'129,130,111,112,113,114,115,233,,118,,,,148,,123,124,,,149,122,125,126',
+'127,128,129,130,,,,,,,,,,,,,111,112,113,114,115,117,149,118,,,,148,',
+'123,124,,,,122,125,126,127,128,129,130,111,112,113,114,115,117,149,118',
+',,,148,,123,124,,,,122,125,126,127,128,129,130,,,,,,,149,13,14,15,16',
+'17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114,115,117,,118',
+',,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112,113,114,115',
+'117,327,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,,,,,,',
+',13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,,,111,112,113,114',
+'115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130,111,112',
+'113,114,115,117,,118,,,,148,,123,124,,,149,122,125,126,127,128,129,130',
+'111,112,113,114,115,117,,118,,,,148,,123,124,,,,122,125,126,127,128',
+'129,130,,111,112,113,114,115,117,429,118,,,,148,,123,124,,,149,122,125',
+'126,127,128,129,130,,287,,,,111,112,113,114,115,117,,118,,,,148,149',
+'123,124,146,442,,122,125,126,127,128,129,130,111,112,113,114,115,117',
+',118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,,111,112,113',
+'114,115,117,,118,,,,148,149,123,124,,,,122,125,126,127,128,129,130,',
+',147,,,,,,,,,,,,,,46,149,,,,,,,,,,,,,,,,,,,,,,,,,149,,,46,,,,,,,,,,',
+',,,,,,,,,,,,149,45,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30',
+'31,32,33,34,35,36,37,38,,,47,45,9,10,11,12,13,14,15,16,17,18,19,20,21',
+'22,26,28,30,31,32,33,34,35,36,37,38,,41,47,294,375,,298,,,54,,,,,,,',
+',56,,,,,,,,,,325,375,,298,,,,,,,,,,,,56,,,,,,,,9,10,11,12,13,14,15,16',
+'17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14',
+'15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,188,,,,,192',
+',,,,,,,,,,,,,,,,,,,413,,,,,,,,,,,,,,,,,,,,,,9,10,11,12,13,14,15,16,17',
+'18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15',
+'16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,371,9,10,11,12',
+'13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,,,,,',
+'205,,,,,,,,,,,,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31',
+'32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28',
+'30,31,32,33,34,35,36,37,38,307,,,,,,,,,,,,,,,,,,,,,,,,,381,,,,,,,,,',
+',,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36',
+'37,38,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34',
+'35,36,37,38,302,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31',
+'32,33,34,35,36,37,38,,,,,,,,,,,,9,10,11,12,13,14,15,16,17,18,19,20,21',
+'22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17,18,19',
+'20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15,16,17',
+'18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13,14,15',
+'16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11,12,13',
+'14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9,10,11',
+'12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37,38,9',
+'10,11,12,13,14,15,16,17,18,19,20,21,22,26,28,30,31,32,33,34,35,36,37',
+'38' ]
+        racc_action_table = arr = ::Array.new(3198, nil)
         idx = 0
         clist.each do |str|
@@ -434,133 +459,147 @@
 
 clist = [
-'210,210,210,210,210,210,26,210,24,114,213,210,55,210,210,297,210,210',
-'210,210,210,210,210,211,211,211,211,211,211,332,211,298,332,299,211',
-'48,211,211,95,211,211,211,211,211,211,211,217,26,213,24,300,55,55,189',
-'189,189,189,189,189,48,189,114,114,90,189,50,189,189,172,189,189,189',
-'189,189,189,189,95,50,132,132,303,217,217,217,217,217,217,217,217,217',
-'217,166,85,210,189,189,189,189,189,189,189,189,189,189,189,101,172,189',
-'189,189,189,189,287,287,347,166,211,394,394,394,394,394,394,347,394',
-'259,288,288,394,101,394,394,84,394,394,394,394,394,394,394,181,181,181',
-'181,181,181,189,181,318,259,1,181,273,181,181,273,181,181,181,181,181',
-'181,181,194,194,194,194,194,194,51,194,289,289,322,194,51,194,194,70',
-'194,194,194,194,194,194,194,195,195,195,195,195,195,275,195,324,52,327',
-'195,52,195,195,275,195,195,195,195,195,195,195,51,394,248,80,180,248',
-'80,180,248,392,392,392,392,392,392,252,392,180,252,330,392,333,392,392',
-'181,392,392,392,392,392,392,392,342,152,335,286,152,69,342,152,286,286',
-'248,290,290,342,152,194,392,66,392,392,392,392,392,392,392,392,392,392',
-'392,392,339,392,392,392,392,392,291,291,195,392,64,392,392,392,392,63',
-'392,392,392,392,392,392,285,354,128,292,292,285,285,128,128,355,392',
-'392,392,392,392,392,392,392,392,381,381,381,381,381,381,356,381,295',
-'295,357,381,358,381,381,359,381,381,381,381,381,381,381,380,380,380',
-'380,380,380,365,380,129,129,369,380,371,380,380,22,380,380,380,380,380',
-'380,380,196,196,196,196,196,196,14,196,382,32,387,196,389,196,196,390',
-'196,196,196,196,196,196,196,197,197,197,197,197,197,12,197,137,137,393',
-'197,397,197,197,185,197,197,197,197,197,197,197,3,381,184,32,182,32',
-'32,32,32,32,32,32,32,32,32,32,178,2,32,32,32,32,32,177,380,32,72,72',
-'72,72,72,72,72,72,72,72,72,130,130,72,72,72,72,72,175,170,157,196,156',
-'32,32,32,32,32,32,32,32,2,150,2,2,2,2,2,2,2,2,2,2,2,197,148,2,2,2,2',
-'2,146,2,2,198,198,198,198,198,198,144,198,142,136,135,198,134,198,198',
-'133,198,198,198,198,198,198,198,2,2,2,2,2,2,2,2,215,379,379,379,379',
-'379,379,231,379,232,234,235,379,236,379,379,238,379,379,379,379,379',
-'379,379,160,94,54,240,264,241,160,94,54,242,264,244,111,160,94,54,379',
-'264,379,379,379,379,379,379,379,379,379,379,379,379,105,379,379,379',
-'379,379,104,98,198,379,97,379,379,379,379,91,379,379,379,379,379,379',
-'115,278,115,281,115,115,115,296,,,379,379,379,379,379,379,379,379,379',
-'171,171,171,171,171,171,,171,,,,171,,171,171,,171,171,171,171,171,171',
-'171,,,378,378,378,378,378,378,,378,,,,378,,378,378,,378,378,378,378',
-'378,378,378,76,4,74,,174,,76,4,74,,174,,,76,4,74,378,174,378,378,378',
-'378,378,378,378,378,378,378,378,378,,378,378,378,378,378,,,,378,,378',
-'378,378,378,171,378,378,378,378,378,378,294,294,294,294,131,131,131',
-'131,,,378,378,378,378,378,378,378,378,378,361,361,361,361,361,361,,361',
-',,,361,,361,361,,361,361,361,361,361,361,361,218,293,293,293,293,,218',
-',,,,,,218,,,361,,361,361,361,361,361,361,361,361,361,361,361,361,,361',
-'361,361,361,361,,,,361,,361,361,361,361,,361,361,361,361,361,361,,,',
-',,,,,,,361,361,361,361,361,361,361,361,361,199,199,199,199,199,199,',
-'199,,,,199,,199,199,,199,199,199,199,199,199,199,350,350,350,350,350',
-'350,,350,,,,350,,350,350,,350,350,350,350,350,350,350,346,346,346,346',
-'346,346,,346,,,,346,,346,346,,346,346,346,346,346,346,346,191,191,191',
-'191,191,191,,191,,,,191,,191,191,,191,191,191,191,191,191,191,,199,',
-',,,,,,200,200,200,200,200,200,,200,,,,200,,200,200,350,200,200,200,200',
-'200,200,200,336,336,336,336,336,336,,336,,336,,336,,336,336,346,336',
-'336,336,336,336,336,336,,,,,,,,323,323,323,323,323,323,,323,191,,,323',
-',323,323,,323,323,323,323,323,323,323,,,,,,,,,,,,,,,,,323,200,323,323',
-'323,323,323,323,323,323,323,323,323,323,,323,323,323,323,323,,,,323',
-'336,323,323,323,323,,323,323,323,323,323,323,,,,,,,,,,,323,323,323,323',
-'323,323,323,323,323,321,321,321,321,321,321,,321,,,,321,,321,321,,321',
-'321,321,321,321,321,321,,,,,,,,,,,,,,,,,321,,321,321,321,321,321,321',
-'321,321,321,321,321,321,,321,321,321,321,321,,,,321,,321,321,321,321',
-',321,321,321,321,321,321,,,,,,,,,,,321,321,321,321,321,321,321,321,321',
-'398,398,398,398,398,398,,398,,,,398,,398,398,,398,398,398,398,398,398',
-'398,,,,,,,,,,,,,,,,,398,,398,398,398,398,398,398,398,398,398,398,398',
-'398,,398,398,398,398,398,,,,398,,398,398,398,398,,398,398,398,398,398',
-'398,,,,,,,,,,,398,398,398,398,398,398,398,398,398,320,320,320,320,320',
-'320,,320,,,,320,,320,320,,320,320,320,320,320,320,320,319,319,319,319',
-'319,319,,319,,,,319,,319,319,,319,319,319,319,319,319,319,77,77,77,77',
-'77,77,,77,,,,77,,77,77,,77,77,77,77,77,77,77,317,317,317,317,317,317',
-',317,,,,317,,317,317,,317,317,317,317,317,317,317,,320,,,,,77,,,,,,',
-'77,82,82,82,82,82,82,,82,,82,319,82,,82,82,,82,82,82,82,82,82,82,183',
-'183,183,183,183,183,,183,,,77,183,,183,183,,183,183,183,183,183,183',
-'183,316,316,316,316,316,316,,316,,,317,316,,316,316,,316,316,316,316',
-'316,316,316,304,304,304,304,304,304,,304,,,,304,,304,304,,304,304,304',
-'304,304,304,304,,82,,,,,,,,201,201,201,201,201,201,,201,,,,201,,201',
-'201,183,201,201,201,201,201,201,201,202,202,202,202,202,202,,202,,,',
-'202,,202,202,316,202,202,202,202,202,202,202,302,302,302,302,302,302',
-',302,,,,302,,302,302,304,302,302,302,302,302,302,302,277,277,277,277',
-'277,277,,277,,,,277,,277,277,,277,277,277,277,277,277,277,,201,,,,,302',
-'302,,,,,,302,203,203,203,203,203,203,,203,,,202,203,,203,203,,203,203',
-'203,203,203,203,203,209,209,209,209,209,209,,209,,,302,209,,209,209',
-',209,209,209,209,209,209,209,212,212,212,212,212,212,,212,,,277,212',
-',212,212,,212,212,212,212,212,212,212,204,204,204,204,204,204,,204,',
-',,204,,204,204,,204,204,204,204,204,204,204,,203,,,,,,,,271,271,271',
-'271,271,271,,271,,,,271,,271,271,209,271,271,271,271,271,271,271,205',
-'205,205,205,205,205,,205,,,,205,,205,205,212,205,205,205,205,205,205',
-'205,206,206,206,206,206,206,,206,,,,206,,206,206,204,206,206,206,206',
-'206,206,206,,,,,,,,,,145,145,145,145,145,145,,145,,,,145,,145,145,271',
-'145,145,145,145,145,145,145,,,,,,,,,,,,,,,,205,145,,145,145,145,145',
-'145,145,145,145,145,145,145,145,145,145,145,145,145,145,,,206,145,,145',
-'145,145,145,,145,145,145,145,145,145,,,,,,,,,,,145,145,145,145,145,145',
-'145,145,145,253,253,253,253,253,253,,253,,253,,253,,253,253,,253,253',
-'253,253,253,253,253,112,112,112,112,112,112,,112,,,,112,,112,112,,112',
-'112,112,112,112,112,112,38,38,38,38,38,38,38,38,38,38,38,,,38,38,38',
-'38,38,112,112,112,112,112,112,112,112,112,112,112,,,112,112,112,112',
-'112,,207,207,207,207,207,207,,207,,,253,207,,207,207,,207,207,207,207',
-'207,207,207,208,208,208,208,208,208,,208,,,112,208,,208,208,,208,208',
-'208,208,208,208,208,116,116,116,116,116,116,,116,,,,116,,116,116,,116',
-'116,116,116,116,116,116,117,117,117,117,117,117,,117,,,,117,,117,117',
-',117,117,117,117,117,117,117,,207,,,,,,,,118,118,118,118,118,118,,118',
-',,,118,,118,118,208,118,118,118,118,118,118,118,119,119,119,119,119',
-'119,,119,,,,119,,119,119,116,119,119,119,119,119,119,119,141,141,141',
-'141,141,141,,141,,,,141,,141,141,117,141,141,141,141,141,141,141,243',
-'243,243,243,243,243,,243,,,,243,,243,243,,243,243,243,243,243,243,243',
-',118,,,,,141,,,,,,,141,,,243,,237,237,237,237,237,237,119,237,,,,237',
-',237,237,,237,237,237,237,237,237,237,,,,,,,141,,,,,,,,,,,233,233,233',
-'233,233,233,,233,,,,233,243,233,233,,233,233,233,233,233,233,233,,,',
-',,,,,,,,,,,,,233,,233,233,233,233,233,233,233,233,233,233,233,233,237',
-'233,233,233,233,233,,,,233,,233,233,233,233,,233,233,233,233,233,233',
-',,,,,,274,274,,274,233,233,233,233,233,233,233,233,233,274,,,,,249,249',
-',249,,,249,,,,,,,249,,,,,274,274,274,274,274,274,274,274,274,274,274',
-',,274,274,274,274,274,249,249,249,249,249,249,249,249,249,249,249,,',
-'249,249,249,249,249,337,,,,,,,,274,274,274,274,274,274,274,274,,,83',
-',,,,,,,249,249,249,249,249,249,249,249,,337,337,337,337,337,337,337',
-'337,337,337,337,,,337,337,337,337,337,83,83,83,83,83,83,83,83,83,83',
-'83,,,83,83,83,83,83,,,,247,,,,,337,337,337,337,337,337,337,337,,,,,',
-',,,,,83,83,83,83,83,83,83,83,247,247,247,247,247,247,247,247,247,247',
-'247,,,247,247,247,247,247,5,5,5,5,5,5,5,5,5,5,5,,,5,5,5,5,5,,,,,,,,',
-'247,247,247,247,247,247,247,247,,,,,,,,,,,5,5,5,5,5,5,5,5,254,254,254',
-'254,254,254,254,254,254,254,254,,254,254,254,254,254,254,92,92,92,92',
-'92,92,92,92,92,92,92,,92,92,92,92,92,92,,,,,,,,,254,254,254,254,254',
-'254,254,254,,,,,,,,,,,92,92,92,92,92,92,92,92,155,155,155,155,155,155',
-'155,155,155,155,155,,,155,155,155,155,155,89,89,89,89,89,89,89,89,89',
-'89,89,,,89,89,89,89,89,,,,,,,,,155,155,155,155,155,155,155,155,,,,,',
-',,,,,89,89,89,89,89,89,89,89,88,88,88,88,88,88,88,88,88,88,88,,,88,88',
-'88,88,88,158,158,158,158,158,158,158,158,158,158,158,,158,158,158,158',
-'158,158,,,,,,,,,88,88,88,88,88,88,88,88,,,,,,,,,,,158,158,158,158,158',
-'158,158,158,67,67,67,67,67,67,67,67,67,67,67,,,67,67,67,67,67,161,161',
-'161,161,161,161,161,161,161,161,161,,161,161,161,161,161,161,,,,,,,',
-',67,67,67,67,67,67,67,67,,,,,,,,,,,161,161,161,161,161,161,161,161,7',
-'7,7,7,7,7,7,7,7,7,7,,,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,,,6,6,6,6,6,,',
-',,,,,,7,7,7,7,7,7,7,7,,,,,,,,,,,6,6,6,6,6,6,6,6,73,73,73,73,73,73,73',
-'73,73,73,73,,,73,73,73,73,73' ]
-        racc_action_check = arr = ::Array.new(2875, nil)
+'440,440,440,440,440,440,293,440,56,293,52,440,293,440,440,440,52,139',
+'440,440,440,440,440,440,440,438,438,438,438,438,438,106,438,354,326',
+'103,438,65,438,438,438,151,326,438,438,438,438,438,438,438,88,29,440',
+'31,51,29,354,31,109,56,56,56,120,207,286,120,106,120,293,120,120,120',
+'52,328,212,324,151,438,324,212,51,440,440,440,328,440,440,440,440,440',
+'440,440,440,440,440,318,110,49,207,286,318,88,88,88,142,142,438,438',
+'438,31,438,438,438,438,438,438,438,438,438,438,436,436,436,436,436,436',
+'304,436,120,120,120,436,49,436,436,436,428,362,436,436,436,436,436,436',
+'436,98,116,428,362,304,316,98,227,340,222,316,309,222,340,340,98,304',
+'309,167,167,167,167,167,167,222,167,309,436,226,167,333,167,167,167',
+'167,98,167,167,167,167,167,167,167,394,4,297,309,339,297,334,4,225,339',
+'339,394,66,436,436,436,4,436,436,436,436,436,436,436,436,436,436,167',
+'167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167',
+'167,167,167,167,167,167,167,167,267,267,101,167,167,167,95,167,167,167',
+'167,167,167,167,167,167,167,429,429,429,429,429,429,364,429,68,373,94',
+'429,373,429,429,429,87,364,429,429,429,429,429,429,429,427,427,427,427',
+'427,427,187,427,71,83,217,427,83,427,427,427,217,187,427,427,427,427',
+'427,427,427,217,269,429,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75',
+'75,75,133,53,221,426,53,133,133,427,418,418,291,429,429,429,426,429',
+'429,429,429,429,429,429,429,429,429,137,137,350,220,136,136,136,136',
+'214,214,351,427,427,427,220,427,427,427,427,427,427,427,427,427,427',
+'175,175,175,175,175,175,363,175,215,215,352,175,353,175,175,175,218',
+'363,175,175,175,175,175,175,175,76,76,76,76,76,76,76,76,76,76,76,76',
+'76,76,76,76,76,425,82,82,82,82,82,82,274,82,357,175,425,82,283,82,82',
+'82,82,73,82,82,82,82,82,82,82,72,201,347,347,347,347,209,201,348,348',
+'348,348,365,175,175,175,201,175,175,175,175,175,175,175,175,175,175',
+'82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82',
+'82,82,82,349,349,198,82,82,82,197,82,82,82,82,82,82,82,82,82,82,273',
+'273,273,273,273,273,371,273,135,135,189,273,374,273,273,273,346,346',
+'273,273,273,273,273,273,273,404,404,404,404,404,404,376,404,345,345',
+'79,404,186,404,404,404,79,184,404,404,404,404,404,404,404,79,380,273',
+'47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,344,344,343,343,342',
+'342,138,404,99,99,179,273,273,273,178,273,273,273,273,273,273,273,273',
+'273,273,131,131,131,131,131,131,131,131,131,131,131,404,404,404,177',
+'404,404,404,404,404,404,404,404,404,404,402,402,402,402,402,402,176',
+'402,341,341,395,402,396,402,402,402,134,134,402,402,402,402,402,402',
+'402,275,275,275,275,275,275,102,275,27,403,77,275,25,275,275,275,77',
+'23,275,275,275,275,275,275,275,77,55,402,152,384,191,174,55,191,152',
+'384,191,173,408,412,414,55,416,152,384,191,281,422,172,140,165,141,275',
+'163,149,3,402,402,402,437,402,402,402,402,402,402,402,402,402,402,147',
+'1,,,,,,,,,,275,275,275,,275,275,275,275,275,275,275,275,275,275,360',
+'360,360,360,360,360,,360,,,,360,,360,360,360,,,360,360,360,360,360,360',
+'360,249,249,249,249,249,249,,249,,,,249,,249,249,,,,249,249,249,249',
+'249,249,249,,,360,383,383,383,383,383,383,,383,,,,383,,383,383,,,,383',
+'383,383,383,383,383,383,,,,360,360,360,,360,360,360,360,360,360,360',
+'360,360,360,,,,,,,377,377,377,377,377,377,,377,,377,,377,,377,377,,',
+'249,377,377,377,377,377,377,377,,,,367,367,367,367,367,367,,367,,,,367',
+',367,367,,,383,367,367,367,367,367,367,367,366,366,366,366,366,366,',
+'366,,,,366,,366,366,,,,366,366,366,366,366,366,366,,,367,,,,,,,,,,,',
+',377,,393,393,393,393,393,393,,393,,,366,393,,393,393,,,,393,393,393',
+'393,393,393,393,,367,,,,,,,,356,356,356,356,356,356,,356,,,,356,,356',
+'356,356,356,366,356,356,356,356,356,356,356,330,330,330,330,330,330',
+',330,,,,330,,330,330,,,,330,330,330,330,330,330,330,322,322,322,322',
+'322,322,,322,,393,,322,,322,322,322,,,322,322,322,322,322,322,322,,',
+',356,,,310,310,310,310,310,310,,310,,,,310,356,310,310,,,,310,310,310',
+'310,310,310,310,298,298,298,298,298,298,,298,,298,,298,330,298,298,',
+',,298,298,298,298,298,298,298,,,,,,,,,,,,,322,,,,,282,282,282,282,282',
+'282,,282,,,,282,,282,282,,,,282,282,282,282,282,282,282,,310,,,,,,,',
+',,,,,,,,,,,,,,,,,298,282,282,282,282,282,282,282,282,282,282,282,282',
+'282,282,282,282,282,282,282,282,282,282,282,282,282,282,280,280,280',
+'280,280,280,,280,,,,280,,280,280,282,,,280,280,280,280,280,280,280,146',
+'146,146,146,146,146,,146,,,,146,,146,146,146,,,146,146,146,146,146,146',
+'146,278,278,278,278,278,278,,278,,,,278,,278,278,,,,278,278,278,278',
+'278,278,278,,397,397,397,397,397,397,,397,,,,397,,397,397,,,280,397',
+'397,397,397,397,397,397,,,146,,,405,405,405,405,405,405,,405,,,,405',
+'146,405,405,,,,405,405,405,405,405,405,405,271,271,271,271,271,271,',
+'271,,,,271,278,271,271,,,,271,271,271,271,271,271,271,,266,266,266,266',
+'266,266,,266,,,,266,397,266,266,,,,266,266,266,266,266,266,266,80,80',
+'80,80,80,80,,80,,,,80,,80,80,80,,405,80,80,80,80,80,80,80,406,406,406',
+'406,406,406,406,406,,,,406,,406,406,,,271,406,406,406,406,406,406,406',
+',265,265,265,265,265,265,,265,,,,265,,265,265,,,266,265,265,265,265',
+'265,265,265,,,80,,,85,85,85,85,85,85,,85,,85,,85,80,85,85,,,,85,85,85',
+'85,85,85,85,264,264,264,264,264,264,,264,,,,264,406,264,264,,,,264,264',
+'264,264,264,264,264,,263,263,263,263,263,263,,263,,,,263,265,263,263',
+',,,263,263,263,263,263,263,263,262,262,262,262,262,262,,262,,,,262,',
+'262,262,,,85,262,262,262,262,262,262,262,261,261,261,261,261,261,,261',
+',,,261,,261,261,,,264,261,261,261,261,261,261,261,,260,260,260,260,260',
+'260,,260,,,,260,,260,260,,,263,260,260,260,260,260,260,260,259,259,259',
+'259,259,259,,259,,,,259,,259,259,,,262,259,259,259,259,259,259,259,258',
+'258,258,258,258,258,,258,,,,258,,258,258,,,261,258,258,258,258,258,258',
+'258,,257,257,257,257,257,257,,257,,,,257,,257,257,,,260,257,257,257',
+'257,257,257,257,256,256,256,256,256,256,,256,,,,256,,256,256,,,259,256',
+'256,256,256,256,256,256,255,255,255,255,255,255,,255,,,,255,,255,255',
+',,258,255,255,255,255,255,255,255,,254,254,254,254,254,254,,254,,,,254',
+',254,254,,,257,254,254,254,254,254,254,254,253,253,253,253,253,253,',
+'253,,,,253,,253,253,,,256,253,253,253,253,253,253,253,252,252,252,252',
+'252,252,,252,,,,252,,252,252,,,255,252,252,252,252,252,252,252,,251',
+'251,251,251,251,251,,251,,,,251,,251,251,,,254,251,251,251,251,251,251',
+'251,250,250,250,250,250,250,,250,,,,250,,250,250,,,253,250,250,250,250',
+'250,250,250,389,389,389,389,389,389,,389,,,,389,,389,389,389,,252,389',
+'389,389,389,389,389,389,,248,248,248,248,248,248,,248,,,,248,,248,248',
+',,251,248,248,248,248,248,248,248,,,,,,,,,,,,,,,,,,250,,,,,,,,,,389',
+',,117,117,117,117,117,117,,117,,,,117,389,117,117,,,,117,117,117,117',
+'117,117,117,,236,236,236,236,236,236,,236,,,,236,248,236,236,,,,236',
+'236,236,236,236,236,236,,,,,,,117,117,117,117,117,117,117,117,117,117',
+'117,117,117,117,117,117,117,,,121,121,121,121,121,121,,121,,,,121,,121',
+'121,,,117,121,121,121,121,121,121,121,,122,122,122,122,122,122,,122',
+',,,122,,122,122,,,236,122,122,122,122,122,122,122,123,123,123,123,123',
+'123,,123,,,,123,,123,123,,,,123,123,123,123,123,123,123,124,124,124',
+'124,124,124,,124,,,,124,,124,124,,,121,124,124,124,124,124,124,124,',
+',,,,,,,,,,,233,233,233,233,233,233,122,233,,,,233,,233,233,,,,233,233',
+'233,233,233,233,233,223,223,223,223,223,223,123,223,,,,223,,223,223',
+',,,223,223,223,223,223,223,223,,,,,,,124,233,233,233,233,233,233,233',
+'233,233,233,233,233,233,233,233,233,233,,,231,231,231,231,231,231,,231',
+',,,231,,231,231,,,233,231,231,231,231,231,231,231,224,224,224,224,224',
+'224,224,224,,,,224,,224,224,,,223,224,224,224,224,224,224,224,,,,,,',
+',231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231',
+',,213,213,213,213,213,213,,213,,,,213,,213,213,,,231,213,213,213,213',
+'213,213,213,210,210,210,210,210,210,,210,,,,210,,210,210,,,224,210,210',
+'210,210,210,210,210,180,180,180,180,180,180,,180,,,,180,,180,180,,,',
+'180,180,180,180,180,180,180,,407,407,407,407,407,407,407,407,,,,407',
+',407,407,,,213,407,407,407,407,407,407,407,,180,,,,435,435,435,435,435',
+'435,,435,,,,435,210,435,435,435,435,,435,435,435,435,435,435,435,164',
+'164,164,164,164,164,,164,,,,164,180,164,164,,,,164,164,164,164,164,164',
+'164,,279,279,279,279,279,279,,279,,,,279,407,279,279,,,,279,279,279',
+'279,279,279,279,,,435,,,,,,,,,,,,,,41,435,,,,,,,,,,,,,,,,,,,,,,,,,164',
+',,2,,,,,,,,,,,,,,,,,,,,,,,279,41,41,41,41,41,41,41,41,41,41,41,41,41',
+'41,41,41,41,41,41,41,41,41,41,41,41,41,,,41,2,2,2,2,2,2,2,2,2,2,2,2',
+'2,2,2,2,2,2,2,2,2,2,2,2,2,2,,2,2,294,294,,294,,,294,,,,,,,,,294,,,,',
+',,,,,325,325,,325,,,,,,,,,,,,325,,,,,,,,294,294,294,294,294,294,294',
+'294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294',
+'294,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325,325',
+'325,325,325,325,325,325,325,325,325,86,,,,,86,,,,,,,,,,,,,,,,,,,,378',
+',,,,,,,,,,,,,,,,,,,,,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86',
+'86,86,86,86,86,86,86,86,86,378,378,378,378,378,378,378,378,378,378,378',
+'378,378,378,378,378,378,378,378,378,378,378,378,378,378,292,7,7,7,7',
+'7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,,,,,,96,,,,,,,,,,,,292,292',
+'292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292,292',
+'292,292,292,292,292,292,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96',
+'96,96,96,96,96,96,96,96,96,96,202,,,,,,,,,,,,,,,,,,,,,,,,,299,,,,,,',
+',,,,,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202',
+'202,202,202,202,202,202,202,202,202,299,299,299,299,299,299,299,299',
+'299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299,299',
+'199,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92',
+'92,92,92,,,,,,,,,,,,199,199,199,199,199,199,199,199,199,199,199,199',
+'199,199,199,199,199,199,199,199,199,199,199,199,199,8,8,8,8,8,8,8,8',
+'8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,196,196,196,196,196,196,196,196,196',
+'196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,6,6',
+'6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5',
+'5,5,5,5,5,5,5,5,5,5,5,5,5,5,93,93,93,93,93,93,93,93,93,93,93,93,93,93',
+'93,93,93,93,93,93,93,93,93,93,93,69,69,69,69,69,69,69,69,69,69,69,69',
+'69,69,69,69,69,69,69,69,69,69,69,69,69' ]
+        racc_action_check = arr = ::Array.new(3198, nil)
         idx = 0
         clist.each do |str|
@@ -572,427 +611,475 @@
 
 racc_action_pointer = [
-   nil,   150,   420,   404,   652,  2412,  2762,  2744,   nil,   nil,
-   nil,   nil,   346,   nil,   323,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   337,   nil,    -5,   nil,    -7,   nil,   nil,   nil,
-   nil,   nil,   366,   nil,   nil,   nil,   nil,   nil,  1848,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    18,   nil,
-    23,   162,   188,   nil,   534,    -8,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   232,   227,   nil,   204,  2674,   nil,   233,
-   124,   nil,   387,  2814,   653,   nil,   651,  1303,   nil,   nil,
-   205,   nil,  1363,  2342,   124,    72,   nil,   nil,  2604,  2552,
-    22,   543,  2482,   nil,   533,    21,   nil,   537,   563,   nil,
-   nil,    88,   nil,   nil,   533,   474,   nil,   nil,   nil,   nil,
-   nil,   542,  1866,   nil,     2,   581,  1972,  1995,  2027,  2050,
-   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   275,   322,
-   414,   685,    45,   480,   461,   458,   456,   351,   nil,   nil,
-   nil,  2073,   485,   nil,   477,  1749,   470,   nil,   467,   nil,
-   445,   nil,   235,   nil,   nil,  2534,   411,   409,  2622,   nil,
-   532,  2692,   nil,   nil,   nil,   nil,    74,   nil,   nil,   nil,
-   436,   608,    51,   nil,   655,   435,   nil,   419,   412,   nil,
-   206,   138,   401,  1386,   393,   383,   nil,   nil,   nil,    51,
-   nil,   890,   nil,   nil,   161,   184,   356,   379,   482,   821,
-   922,  1464,  1487,  1570,  1639,  1694,  1717,  1926,  1949,  1593,
-    -2,    21,  1616,    -7,   nil,   506,   nil,     4,   745,   nil,
+   nil,   732,  2528,   716,   182,  3068,  3043,  2752,  2993,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   515,   517,  2177,   518,   519,   488,  2137,   491,   nil,
-   529,   503,   507,  2096,   509,   nil,   nil,  2394,   204,  2271,
-   nil,   nil,   217,  1843,  2464,   nil,   nil,   nil,   nil,   108,
-   nil,   nil,   nil,   nil,   536,   nil,   nil,   nil,   nil,   nil,
-   nil,  1671,   nil,   145,  2253,   184,   nil,  1533,   581,   nil,
-   nil,   586,   nil,   nil,   nil,   273,   224,    91,   105,   144,
-   225,   250,   269,   724,   681,   287,   579,   -20,    -5,    -4,
-    10,   nil,  1510,    72,  1432,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,  1409,  1326,    82,  1280,
-  1257,  1069,   133,   975,   153,   nil,   nil,   155,   nil,   nil,
-   216,   nil,    22,   222,   nil,   235,   945,  2324,   nil,   260,
-   nil,   nil,   234,   nil,   nil,   nil,   867,   106,   nil,   nil,
-   844,   nil,   nil,   nil,   253,   294,   310,   315,   283,   319,
-   nil,   727,   nil,   nil,   nil,   329,   nil,   nil,   nil,   334,
-   nil,   339,   nil,   nil,   nil,   nil,   nil,   nil,   633,   514,
-   333,   310,   296,   nil,   nil,   nil,   nil,   303,   nil,   362,
-   332,   nil,   216,   350,   115,   nil,   nil,   385,  1163,   nil ]
+   nil,   nil,   nil,   624,   nil,   619,   nil,   656,   nil,    38,
+   nil,    40,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,  2499,   nil,   nil,   nil,   nil,   nil,   510,   nil,    78,
+   nil,    37,     3,   322,   nil,   680,   -14,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,    20,   183,   nil,   249,  3118,
+   nil,   278,   429,   421,   nil,   252,   344,   664,   nil,   544,
+  1392,   nil,   419,   285,   nil,  1473,  2701,   266,    28,   nil,
+   nil,   nil,  2932,  3093,   214,   193,  2819,   nil,   138,   576,
+   nil,   200,   654,    22,   nil,   nil,    12,   nil,   nil,    15,
+     1,   nil,   nil,   nil,   nil,   nil,   137,  1959,   nil,   nil,
+    55,  2035,  2061,  2086,  2111,   nil,   nil,   nil,   nil,   nil,
+   nil,   568,   nil,   306,   629,   495,   326,   318,   571,   -20,
+   672,   673,    64,   nil,   nil,   nil,  1235,   724,   nil,   702,
+   nil,    22,   682,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,   672,  2431,   669,   nil,   161,   nil,   nil,
+   nil,   nil,   702,   691,   685,   376,   635,   612,   546,   542,
+  2350,   nil,   nil,   nil,   547,   nil,   545,   281,   nil,   507,
+   nil,   684,   nil,   nil,   nil,   nil,  3018,   451,   447,  2968,
+   nil,   440,  2881,   nil,   nil,   nil,   nil,    44,   nil,   410,
+  2325,   nil,    61,  2300,   343,   368,   nil,   286,   381,   nil,
+   348,   322,   147,  2173,  2249,   189,   160,   139,   nil,   nil,
+   nil,  2224,   nil,  2148,   nil,   nil,  1985,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  1904,   779,
+  1853,  1828,  1802,  1777,  1752,  1726,  1701,  1676,  1650,  1625,
+  1600,  1574,  1549,  1524,  1498,  1443,  1367,   223,   nil,   300,
+   nil,  1341,   nil,   514,   385,   659,   nil,   nil,  1260,  2457,
+  1210,   619,  1132,   379,   nil,   nil,    45,   nil,   nil,   nil,
+   nil,   325,  2794,    -1,  2604,   nil,   nil,   183,  1090,  2906,
+   nil,   nil,   nil,   nil,   107,   nil,   nil,   nil,   nil,   149,
+  1065,   nil,   nil,   nil,   nil,   nil,   137,   nil,    82,   nil,
+   nil,   nil,  1034,   nil,    68,  2629,    23,   nil,    65,   nil,
+  1009,   nil,   nil,   167,   186,   nil,   nil,   nil,   nil,   170,
+   131,   621,   567,   559,   557,   520,   503,   417,   423,   464,
+   334,   326,   350,   351,    14,   nil,   984,   421,   nil,   nil,
+   754,   nil,   129,   376,   256,   451,   908,   883,   nil,   nil,
+   nil,   510,   nil,   260,   520,   nil,   539,   855,  2726,   nil,
+   556,   nil,   nil,   807,   683,   nil,   nil,   nil,   nil,  1878,
+   nil,   nil,   nil,   950,   180,   629,   631,  1286,   nil,   nil,
+   nil,   nil,   634,   653,   539,  1316,  1417,  2376,   687,   nil,
+   nil,   nil,   689,   nil,   693,   nil,   649,   nil,   318,   nil,
+   nil,   nil,   622,   nil,   nil,   412,   323,   281,   128,   256,
+   nil,   nil,   nil,   nil,   nil,  2406,   118,   666,    23,   nil,
+    -2,   nil,   nil,   nil,   nil,   nil,   nil ]
 
 racc_action_default = [
-  -176,  -243,    -1,  -243,  -243,   -70,   -71,   -72,   -80,   -81,
-   -82,   -83,   -84,   -85,   -86,   -87,   -88,   -89,   -90,   -91,
-   -92,   -93,   -96,   -99,  -243,  -116,  -243,  -129,  -134,  -135,
-  -177,  -178,  -243,  -180,  -181,  -184,  -185,  -186,  -243,  -232,
-  -233,  -234,  -235,  -236,  -237,  -238,  -239,   400,  -243,   -76,
-   -78,  -243,  -137,  -139,  -243,  -145,   -73,   -84,   -86,   -74,
-   -75,  -183,  -182,   -98,  -243,  -102,  -115,  -243,  -119,  -243,
-  -128,  -179,  -106,  -108,  -243,   -69,  -243,  -243,  -190,  -191,
-  -136,  -138,  -243,  -243,  -243,  -146,  -147,   -94,  -243,  -243,
-   -84,   -85,  -243,  -117,  -243,  -243,  -130,  -132,  -243,  -107,
-  -109,  -243,  -188,   -77,   -78,    -2,    -3,    -4,    -5,    -6,
-    -7,    -8,  -243,   -10,   -12,   -23,  -243,  -243,  -243,  -243,
-   -29,   -30,   -31,   -32,   -33,   -34,   -35,   -37,   -41,   -44,
-   -47,   -52,   -55,   -57,   -59,   -61,   -63,   -65,   -68,   -79,
-  -170,  -243,  -243,  -240,  -243,  -243,  -243,  -142,  -243,  -144,
-  -149,  -151,  -155,  -140,  -148,  -243,   -84,   -85,  -243,  -100,
-  -243,  -243,  -122,  -121,  -114,  -118,  -243,  -123,  -125,  -126,
-  -243,  -243,  -243,  -187,  -243,  -243,   -11,  -243,  -243,   -67,
-  -156,   -20,  -243,  -243,  -243,  -243,   -18,   -19,   -24,  -243,
-   -25,  -243,   -27,   -28,  -243,  -243,  -243,  -243,  -243,  -243,
-  -243,  -243,  -243,  -243,  -243,  -243,  -243,  -243,  -243,  -243,
-  -243,  -243,  -243,  -243,  -174,  -243,  -241,   -35,  -243,  -192,
-  -193,  -194,  -195,  -196,  -197,  -198,  -199,  -200,  -201,  -202,
-  -203,  -243,  -243,  -243,  -243,  -243,  -240,  -243,  -243,  -213,
-  -243,  -243,  -243,  -243,  -243,  -141,  -143,  -243,  -158,  -243,
-  -153,  -154,  -159,  -243,  -243,  -105,  -104,   -97,  -101,  -243,
-  -110,  -112,  -113,  -120,  -243,  -131,  -133,  -127,  -189,  -242,
-    -9,  -243,  -157,  -158,  -243,  -243,   -21,   -20,  -243,   -16,
-   -17,  -243,   -38,   -39,   -40,   -42,   -43,   -45,   -46,   -48,
-   -49,   -50,   -51,   -53,   -54,   -56,   -58,   -60,   -62,   -64,
-  -243,  -171,  -243,  -243,  -243,  -221,  -222,  -223,  -224,  -225,
-  -226,  -227,  -228,  -229,  -230,  -231,  -243,  -243,  -243,  -243,
-  -243,  -243,  -243,  -243,  -243,  -215,  -216,  -243,  -218,  -219,
-  -243,  -152,  -160,  -243,  -166,  -243,  -243,  -243,  -162,  -243,
-   -95,  -103,  -243,  -124,   -36,   -13,  -243,  -243,   -15,   -26,
-  -243,  -172,  -175,  -173,  -243,  -243,  -243,  -243,  -243,  -243,
-  -210,  -243,  -212,  -214,  -217,  -243,  -161,  -167,  -164,  -243,
-  -168,  -243,  -163,  -111,   -22,   -14,   -66,  -220,  -243,  -243,
-  -243,  -243,  -243,  -211,  -150,  -165,  -169,  -204,  -206,  -243,
-  -243,  -209,  -243,  -243,  -243,  -205,  -207,  -243,  -243,  -208 ]
+  -215,  -269,    -1,  -269,  -269,   -86,   -88,   -90,   -92,   -98,
+   -99,  -100,  -101,  -102,  -103,  -104,  -105,  -106,  -107,  -108,
+  -109,  -110,  -111,  -112,  -113,  -114,  -115,  -118,  -121,  -269,
+  -139,  -269,  -163,  -164,  -165,  -166,  -167,  -168,  -169,  -216,
+  -217,  -269,  -219,  -220,  -223,  -224,  -225,  -269,   447,  -269,
+   -94,   -96,  -269,  -171,  -173,  -269,  -180,   -87,  -112,  -114,
+   -89,   -91,   -93,  -222,  -221,  -120,  -269,  -124,  -138,  -269,
+  -142,  -269,  -155,  -158,  -218,  -130,  -132,  -269,   -85,  -269,
+  -269,  -229,  -269,  -170,  -172,  -269,  -269,  -269,  -181,  -182,
+  -184,  -116,  -269,  -269,  -112,  -113,  -269,  -140,  -269,  -269,
+  -159,  -161,  -269,  -269,  -129,  -131,  -269,  -227,   -95,   -96,
+    -2,    -3,    -4,    -5,    -6,    -7,    -8,  -269,   -10,   -12,
+   -25,  -269,  -269,  -269,  -269,   -31,   -32,   -33,   -34,   -35,
+   -36,   -37,   -39,   -43,   -46,   -49,   -54,   -57,   -59,   -61,
+   -63,   -65,   -67,   -69,   -97,  -209,  -269,  -269,  -265,  -269,
+   -82,  -269,  -269,  -230,  -231,  -232,  -233,  -234,  -235,  -236,
+  -237,  -238,  -239,  -265,  -269,  -269,  -243,  -269,  -245,  -247,
+  -248,  -249,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,
+  -269,  -268,   -37,   -84,  -269,  -176,  -269,  -269,  -179,  -186,
+  -188,  -192,  -193,  -174,  -183,  -185,  -269,  -112,  -113,  -269,
+  -122,  -269,  -269,  -145,  -144,  -137,  -141,  -269,  -146,  -148,
+  -269,  -151,  -269,  -269,  -269,  -269,  -226,  -269,  -269,   -11,
+  -269,  -269,  -195,  -269,  -269,  -269,  -269,  -269,   -19,   -20,
+   -26,  -269,   -27,  -269,   -29,   -30,  -269,   -71,   -72,   -73,
+   -74,   -75,   -76,   -77,   -78,   -79,   -80,   -81,  -269,  -269,
+  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,
+  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -213,  -269,
+  -266,  -269,  -250,  -269,  -269,  -269,  -244,  -246,  -269,  -269,
+  -269,  -269,  -269,  -269,  -261,  -262,  -269,  -263,  -175,  -177,
+  -178,  -269,  -269,  -197,  -269,  -190,  -191,  -198,  -269,  -269,
+  -128,  -127,  -119,  -123,  -269,  -133,  -135,  -136,  -143,  -269,
+  -269,  -149,  -153,  -160,  -162,  -152,  -269,  -156,  -269,  -228,
+  -267,    -9,  -269,  -196,  -197,  -269,  -269,   -14,  -269,   -23,
+  -269,   -17,   -18,  -269,  -269,   -70,   -40,   -41,   -42,   -44,
+   -45,   -47,   -48,   -50,   -51,   -52,   -53,   -55,   -56,   -58,
+   -60,   -62,   -64,   -66,  -269,  -210,  -269,  -269,   -83,  -240,
+  -269,  -242,  -269,  -269,  -269,  -269,  -269,  -269,  -260,  -264,
+  -194,  -269,  -189,  -199,  -269,  -205,  -269,  -269,  -269,  -201,
+  -269,  -117,  -125,  -269,  -269,  -147,  -150,  -154,  -157,  -269,
+   -38,   -13,   -15,  -269,  -269,   -28,  -269,  -269,  -211,  -214,
+  -212,  -241,  -269,  -269,  -269,  -269,  -269,  -269,  -269,  -200,
+  -206,  -203,  -269,  -207,  -269,  -202,  -269,  -134,  -269,   -24,
+   -16,   -68,  -251,  -253,  -254,  -269,  -269,  -269,  -269,  -269,
+  -187,  -204,  -208,  -126,   -21,  -269,  -269,  -269,  -269,  -256,
+  -269,  -258,   -22,  -252,  -255,  -257,  -259 ]
 
 racc_goto_table = [
-    50,     4,   177,   146,    56,    59,    60,   190,   192,   193,
-   148,    86,   139,   138,   260,    80,   167,   188,   138,   158,
-   275,   258,   178,    35,    31,   165,   332,    73,    12,    74,
-    14,     4,   287,   288,    91,   217,    95,   293,   294,   251,
-   304,   154,   219,     2,    85,   295,    92,   285,   286,   296,
-    72,   332,   297,    35,    71,   157,    91,   298,    12,    91,
-    14,    73,    73,    99,   100,   172,    94,   272,   161,   299,
-   102,   276,   104,   278,   103,    63,   214,   138,   155,   177,
-    64,   177,   152,   259,    72,    72,   254,   160,    94,    66,
-   168,    94,   266,    90,   165,   282,   283,   284,   166,   281,
-   265,    73,   300,   182,   331,   213,    30,   138,   248,   289,
-   290,   291,   292,   101,   156,    90,   347,   258,    90,    78,
-   145,     1,   157,   217,    72,   157,   nil,   nil,    91,   nil,
-   318,   nil,   nil,   327,   nil,   nil,   273,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   250,   nil,
-   nil,   nil,   nil,   nil,   160,   nil,   261,   160,   322,   nil,
-    94,   nil,   nil,   nil,   nil,   nil,   nil,   276,   nil,   nil,
-   268,   nil,   344,   138,   339,   nil,   nil,   nil,    73,   nil,
-   nil,   156,   nil,   nil,   156,   nil,   343,    90,   nil,   138,
-   nil,   nil,   nil,   nil,   354,   nil,   373,   nil,   nil,   nil,
-   nil,    72,   nil,   nil,   nil,   248,   355,   356,   nil,   358,
-   359,   217,    80,   217,   104,   nil,   nil,   nil,   360,   nil,
-   362,   157,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   273,   nil,   nil,   nil,   nil,   nil,   374,   352,   138,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   152,   nil,   152,   nil,
-   nil,   217,   nil,   160,   nil,   nil,   nil,   369,   383,   nil,
-   168,   nil,   nil,   nil,   371,   nil,   nil,   nil,   217,   217,
-   389,   390,   138,   152,   nil,   387,   388,   nil,   nil,   nil,
-   156,   nil,   217,   nil,   397,   nil,   376,   nil,   217,   395,
-   nil,   nil,   nil,   nil,   nil,   399,   nil,   nil,   nil,   nil,
+    51,   144,   145,    81,   183,   182,   184,   281,   186,    23,
+   267,    95,   208,    83,   206,   305,   303,   313,   328,   169,
+    25,     4,   199,   230,    57,    60,    61,    62,    75,    89,
+    40,    99,   168,   221,   198,    95,   296,    77,    95,   220,
+   373,   182,   232,   234,   235,    65,    96,   207,    23,    76,
+   304,   366,   343,   344,   345,   346,    75,    75,    90,    25,
+     4,   194,   214,   215,    66,   104,   105,   323,   145,    74,
+   202,   373,   196,   107,    68,   109,    94,    76,    76,   347,
+   348,   339,   340,   183,   182,   274,   341,   342,    98,   108,
+   195,   236,   187,    88,   209,   372,   353,   352,    75,   197,
+    94,   152,   286,    94,   169,   359,    39,   361,   351,   106,
+   350,   201,    98,   349,     2,    98,   303,   277,   167,    76,
+   206,   313,   225,   313,   394,     1,   299,   nil,   nil,   183,
+   182,   311,   183,   182,   314,   406,   407,   nil,   198,   nil,
+   nil,   198,   nil,   nil,    95,   326,   329,   333,   109,   334,
+   336,   337,   338,   220,   nil,   220,   nil,   nil,   335,   nil,
+   nil,   nil,   nil,   nil,   293,   nil,   nil,   nil,   182,   182,
+   182,   182,   182,   182,   182,   182,   182,   182,   182,   182,
+   182,   182,   182,   182,   182,   182,   152,   295,   354,   nil,
+   nil,   nil,   401,   358,   nil,   324,   nil,   306,   417,   nil,
+   362,   363,   364,   197,   nil,   nil,   197,   nil,   nil,    94,
+   nil,   nil,    75,   319,    75,   201,   nil,   nil,   201,   367,
+   380,    98,   nil,   385,   390,   nil,   nil,   nil,   nil,   183,
+   182,   386,   nil,    76,   422,    76,   424,   nil,   nil,   nil,
+   nil,   198,   182,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   329,   418,    83,   nil,   nil,   nil,   nil,   439,
+   nil,   441,   nil,   nil,   nil,   nil,   nil,   293,   443,   nil,
+   445,   nil,   446,   nil,   nil,   nil,   nil,   399,   145,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   324,   412,
+   414,   152,   183,   182,   416,   209,   197,   nil,   nil,   nil,
+   nil,   145,   nil,   nil,   nil,   419,   421,   182,   201,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   425,   426,   428,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   152,   nil,   261 ]
-
-racc_goto_check = [
-    32,    27,     6,    25,    27,    27,    27,    10,    10,    10,
-    57,    55,    33,    24,    45,    56,    51,    12,    24,    39,
-     8,    42,    13,    26,    64,    49,    61,     9,    34,    44,
-    36,    27,    15,    15,    35,    10,    53,    17,    17,    60,
-    79,    55,    70,     2,     9,    18,    48,    14,    14,    19,
-    30,    61,    20,    26,    64,    35,    35,    21,    34,    35,
-    36,     9,     9,    44,    44,    53,    27,    60,    48,    22,
-    32,     6,    32,     6,    31,    38,    33,    24,    40,     6,
-    41,     6,    27,    43,    30,    30,    39,    27,    27,    47,
-    32,    27,    25,    34,    49,    12,    12,    12,    50,    13,
-    54,     9,     6,     9,    59,    62,    63,    24,    55,    16,
-    16,    16,    16,    67,    34,    34,     8,    42,    34,    68,
-    69,     1,    35,    10,    30,    35,   nil,   nil,    35,   nil,
-    70,   nil,   nil,     6,   nil,   nil,    55,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    32,   nil,
-   nil,   nil,   nil,   nil,    27,   nil,    32,    27,    25,   nil,
-    27,   nil,   nil,   nil,   nil,   nil,   nil,     6,   nil,   nil,
-    32,   nil,    12,    24,    25,   nil,   nil,   nil,     9,   nil,
-   nil,    34,   nil,   nil,    34,   nil,    51,    34,   nil,    24,
-   nil,   nil,   nil,   nil,     6,   nil,    45,   nil,   nil,   nil,
-   nil,    30,   nil,   nil,   nil,    55,     6,     6,   nil,     6,
-     6,    10,    56,    10,    32,   nil,   nil,   nil,    70,   nil,
-    70,    35,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-    55,   nil,   nil,   nil,   nil,   nil,     6,    33,    24,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,    27,   nil,    27,   nil,
-   nil,    10,   nil,    27,   nil,   nil,   nil,    25,    70,   nil,
-    32,   nil,   nil,   nil,    57,   nil,   nil,   nil,    10,    10,
-     6,     6,    24,    27,   nil,    70,    70,   nil,   nil,   nil,
-    34,   nil,    10,   nil,     6,   nil,    24,   nil,    10,    70,
-   nil,   nil,   nil,   nil,   nil,    70,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,   423,   399,   145,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   306 ]
+
+racc_goto_check = [
+    36,    37,    12,    72,    26,    13,    28,    73,    60,    38,
+    11,    39,    55,    59,    53,    49,    46,    57,     8,    29,
+    40,    30,    43,    15,    30,    30,    30,    30,    33,    58,
+    68,    56,    84,    10,    39,    39,    65,    48,    39,     6,
+    66,    13,    13,    13,    13,    42,    52,    54,    38,     9,
+    47,    75,    18,    18,    18,    18,    33,    33,     9,    40,
+    30,    58,    56,    56,    45,    48,    48,    65,    12,    68,
+    52,    66,    44,    36,    51,    36,    38,     9,     9,    19,
+    19,    16,    16,    26,    13,    28,    17,    17,    30,    35,
+     9,    27,    61,    62,    36,    64,    24,    23,    33,    38,
+    38,    30,     6,    38,    29,    73,    67,    73,    22,    71,
+    21,    30,    30,    20,     2,    30,    46,    84,    83,     9,
+    53,    57,     9,    57,     8,     1,    43,   nil,   nil,    26,
+    13,    28,    26,    13,    28,    75,    75,   nil,    39,   nil,
+   nil,    39,   nil,   nil,    39,     6,    12,    10,    36,    10,
+    15,    15,    15,     6,   nil,     6,   nil,   nil,    12,   nil,
+   nil,   nil,   nil,   nil,    58,   nil,   nil,   nil,    13,    13,
+    13,    13,    13,    13,    13,    13,    13,    13,    13,    13,
+    13,    13,    13,    13,    13,    13,    30,    36,     6,   nil,
+   nil,   nil,    73,    12,   nil,    58,   nil,    36,    49,   nil,
+     6,     6,     6,    38,   nil,   nil,    38,   nil,   nil,    38,
+   nil,   nil,    33,    36,    33,    30,   nil,   nil,    30,    29,
+    12,    30,   nil,    55,    15,   nil,   nil,   nil,   nil,    26,
+    13,    28,   nil,     9,    73,     9,    73,   nil,   nil,   nil,
+   nil,    39,    13,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,    12,    11,    59,   nil,   nil,   nil,   nil,    73,
+   nil,    73,   nil,   nil,   nil,   nil,   nil,    58,    73,   nil,
+    73,   nil,    73,   nil,   nil,   nil,   nil,    37,    12,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,    27,   nil,    32 ]
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    58,    12,
+    60,    30,    26,    13,    28,    36,    38,   nil,   nil,   nil,
+   nil,    12,   nil,   nil,   nil,    12,    26,    13,    30,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,     6,     6,     6,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,    72,    37,    12,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+    36 ]
 
 racc_goto_pointer = [
-   nil,   121,    43,   nil,   nil,   nil,  -110,   nil,  -161,   -11,
-  -110,   nil,   -99,   -90,  -150,  -167,   -92,  -168,  -162,  -159,
-  -157,  -153,  -142,   nil,   -64,   -79,    21,    -1,   nil,   nil,
-    12,    -2,    -4,   -65,    26,   -33,    28,   nil,    53,   -69,
-    -9,    58,  -137,   -77,    -9,  -146,   nil,    65,   -21,   -67,
-     4,   -78,   nil,   -33,   -70,   -44,   -36,   -73,   nil,  -143,
-  -113,  -222,   -36,   104,    22,   nil,   nil,    39,    69,    41,
-  -103,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  -177 ]
+   nil,   125,   114,   nil,   nil,   nil,   -78,   nil,  -206,     2,
+   -84,  -136,   -78,   -80,   nil,   -98,  -170,  -167,  -203,  -180,
+  -148,  -152,  -155,  -167,  -169,   nil,   -81,   -40,   -79,   -63,
+    19,   nil,   nil,   -19,   nil,    10,    -4,   -79,     7,   -58,
+    18,   nil,    18,   -70,   -19,    37,  -183,  -151,   -10,  -186,
+   nil,    45,   -23,   -82,   -51,   -86,   -40,  -195,   -27,   -39,
+   -78,     6,    37,   nil,  -197,  -155,  -253,   104,    28,   nil,
+   nil,    32,   -48,  -168,   nil,  -231,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,    36,   -50 ]
 
 racc_goto_default = [
-   nil,   nil,   nil,   114,   105,   111,   244,   115,   nil,     7,
-   126,   116,   127,   nil,   128,   129,   130,   131,   132,   133,
-   134,   135,   136,   137,   179,   140,   220,   218,    48,     5,
-     6,    49,    84,   nil,    57,    13,    58,    22,   nil,   nil,
-   nil,   nil,   159,   nil,   180,   nil,    24,   nil,   nil,    93,
-   nil,   nil,    26,   nil,    96,    51,    52,   335,   150,   151,
-   333,   252,   nil,   nil,   nil,    33,    34,   nil,   227,   nil,
-   nil,   221,   222,   223,   224,   225,   226,   228,   229,   nil ]
+   nil,   nil,   nil,   119,   110,   116,   151,   120,   nil,     7,
+   nil,   nil,   150,   131,   121,   132,   133,   134,   135,   136,
+   137,   138,   139,   140,   141,   142,   143,   nil,   nil,    44,
+   191,    49,     5,     6,     8,    50,    87,   268,    58,    24,
+    59,    27,   nil,   nil,   nil,   nil,   200,   nil,   222,   nil,
+    29,   nil,   nil,    97,   nil,   nil,   nil,   100,    52,    53,
+   376,   nil,   nil,   189,   190,   374,   297,   nil,   nil,    42,
+    43,   nil,   154,   170,   153,   155,   156,   157,   158,   159,
+   160,   161,   162,   nil,   nil ]
 
 racc_reduce_table = [
   0, 0, :racc_error,
-  1, 97, :_reduce_none,
-  1, 99, :_reduce_2,
-  1, 99, :_reduce_3,
-  1, 99, :_reduce_4,
-  1, 99, :_reduce_5,
-  1, 99, :_reduce_6,
-  1, 99, :_reduce_7,
-  1, 99, :_reduce_8,
-  3, 99, :_reduce_9,
-  1, 101, :_reduce_10,
-  2, 101, :_reduce_11,
-  1, 103, :_reduce_none,
-  4, 103, :_reduce_none,
-  5, 103, :_reduce_none,
-  4, 103, :_reduce_15,
-  3, 103, :_reduce_16,
-  3, 103, :_reduce_17,
-  2, 103, :_reduce_18,
-  2, 103, :_reduce_19,
-  0, 104, :_reduce_none,
+  1, 98, :_reduce_none,
+  1, 100, :_reduce_2,
+  1, 100, :_reduce_3,
+  1, 100, :_reduce_4,
+  1, 100, :_reduce_5,
+  1, 100, :_reduce_6,
+  1, 100, :_reduce_7,
+  1, 100, :_reduce_8,
+  3, 100, :_reduce_9,
+  1, 102, :_reduce_10,
+  2, 102, :_reduce_11,
   1, 104, :_reduce_none,
+  4, 104, :_reduce_13,
   3, 104, :_reduce_none,
-  1, 106, :_reduce_none,
-  2, 106, :_reduce_24,
-  2, 106, :_reduce_25,
-  4, 106, :_reduce_26,
-  2, 106, :_reduce_27,
-  2, 106, :_reduce_28,
-  1, 107, :_reduce_29,
-  1, 107, :_reduce_30,
-  1, 107, :_reduce_31,
-  1, 107, :_reduce_32,
-  1, 107, :_reduce_33,
-  1, 107, :_reduce_34,
-  1, 108, :_reduce_none,
-  4, 108, :_reduce_36,
+  4, 104, :_reduce_none,
+  5, 104, :_reduce_none,
+  3, 104, :_reduce_17,
+  3, 104, :_reduce_18,
+  2, 104, :_reduce_19,
+  2, 104, :_reduce_20,
+  6, 104, :_reduce_none,
+  7, 104, :_reduce_none,
+  1, 105, :_reduce_none,
+  3, 105, :_reduce_none,
   1, 110, :_reduce_none,
-  3, 110, :_reduce_38,
-  3, 110, :_reduce_39,
-  3, 110, :_reduce_40,
-  1, 111, :_reduce_none,
-  3, 111, :_reduce_42,
-  3, 111, :_reduce_43,
+  2, 110, :_reduce_26,
+  2, 110, :_reduce_27,
+  4, 110, :_reduce_28,
+  2, 110, :_reduce_29,
+  2, 110, :_reduce_30,
+  1, 111, :_reduce_31,
+  1, 111, :_reduce_32,
+  1, 111, :_reduce_33,
+  1, 111, :_reduce_34,
+  1, 111, :_reduce_35,
+  1, 111, :_reduce_36,
   1, 112, :_reduce_none,
-  3, 112, :_reduce_45,
-  3, 112, :_reduce_46,
+  4, 112, :_reduce_38,
   1, 113, :_reduce_none,
-  3, 113, :_reduce_48,
-  3, 113, :_reduce_49,
-  3, 113, :_reduce_50,
-  3, 113, :_reduce_51,
+  3, 113, :_reduce_40,
+  3, 113, :_reduce_41,
+  3, 113, :_reduce_42,
   1, 114, :_reduce_none,
-  3, 114, :_reduce_53,
-  3, 114, :_reduce_54,
+  3, 114, :_reduce_44,
+  3, 114, :_reduce_45,
   1, 115, :_reduce_none,
-  3, 115, :_reduce_56,
+  3, 115, :_reduce_47,
+  3, 115, :_reduce_48,
   1, 116, :_reduce_none,
-  3, 116, :_reduce_58,
+  3, 116, :_reduce_50,
+  3, 116, :_reduce_51,
+  3, 116, :_reduce_52,
+  3, 116, :_reduce_53,
   1, 117, :_reduce_none,
-  3, 117, :_reduce_60,
+  3, 117, :_reduce_55,
+  3, 117, :_reduce_56,
   1, 118, :_reduce_none,
-  3, 118, :_reduce_62,
+  3, 118, :_reduce_58,
   1, 119, :_reduce_none,
-  3, 119, :_reduce_64,
+  3, 119, :_reduce_60,
   1, 120, :_reduce_none,
-  5, 120, :_reduce_66,
-  1, 102, :_reduce_67,
-  1, 121, :_reduce_68,
-  3, 122, :_reduce_none,
-  1, 123, :_reduce_70,
+  3, 120, :_reduce_62,
+  1, 121, :_reduce_none,
+  3, 121, :_reduce_64,
+  1, 122, :_reduce_none,
+  3, 122, :_reduce_66,
   1, 123, :_reduce_none,
-  1, 123, :_reduce_72,
-  2, 123, :_reduce_73,
-  2, 123, :_reduce_74,
-  2, 123, :_reduce_75,
-  1, 124, :_reduce_76,
-  3, 124, :_reduce_77,
+  5, 123, :_reduce_68,
+  1, 109, :_reduce_none,
+  3, 109, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 124, :_reduce_none,
+  1, 103, :_reduce_82,
+  3, 103, :_reduce_83,
+  1, 125, :_reduce_84,
+  3, 126, :_reduce_none,
+  1, 127, :_reduce_86,
+  2, 127, :_reduce_87,
   1, 127, :_reduce_none,
-  3, 127, :_reduce_79,
-  1, 126, :_reduce_80,
-  1, 126, :_reduce_81,
-  1, 126, :_reduce_82,
-  1, 126, :_reduce_83,
-  1, 126, :_reduce_84,
-  1, 126, :_reduce_85,
-  1, 126, :_reduce_86,
-  1, 126, :_reduce_87,
-  1, 126, :_reduce_88,
-  1, 126, :_reduce_89,
-  1, 126, :_reduce_90,
-  1, 126, :_reduce_91,
-  1, 126, :_reduce_92,
-  1, 126, :_reduce_93,
-  0, 136, :_reduce_94,
-  6, 130, :_reduce_95,
-  0, 137, :_reduce_96,
-  5, 130, :_reduce_97,
-  2, 130, :_reduce_98,
-  1, 133, :_reduce_99,
-  1, 135, :_reduce_none,
-  2, 135, :_reduce_none,
-  1, 134, :_reduce_102,
-  3, 138, :_reduce_103,
-  2, 138, :_reduce_none,
-  2, 138, :_reduce_none,
+  2, 127, :_reduce_89,
+  1, 127, :_reduce_90,
+  2, 127, :_reduce_91,
+  1, 127, :_reduce_none,
+  2, 127, :_reduce_none,
+  1, 128, :_reduce_94,
+  3, 128, :_reduce_95,
+  1, 132, :_reduce_none,
+  3, 132, :_reduce_97,
+  1, 129, :_reduce_none,
+  1, 129, :_reduce_none,
+  1, 129, :_reduce_none,
+  1, 129, :_reduce_none,
+  1, 130, :_reduce_102,
+  1, 130, :_reduce_103,
+  1, 130, :_reduce_104,
+  1, 130, :_reduce_105,
+  1, 130, :_reduce_106,
+  1, 130, :_reduce_107,
+  1, 130, :_reduce_108,
+  1, 130, :_reduce_109,
+  1, 130, :_reduce_110,
+  1, 130, :_reduce_111,
+  1, 130, :_reduce_112,
+  1, 130, :_reduce_113,
+  1, 130, :_reduce_114,
+  1, 130, :_reduce_115,
+  0, 141, :_reduce_116,
+  6, 135, :_reduce_117,
+  0, 142, :_reduce_118,
+  5, 135, :_reduce_119,
+  2, 135, :_reduce_120,
+  1, 138, :_reduce_121,
   1, 140, :_reduce_none,
-  2, 140, :_reduce_107,
-  1, 140, :_reduce_108,
-  2, 140, :_reduce_109,
-  1, 139, :_reduce_110,
-  3, 139, :_reduce_111,
-  1, 141, :_reduce_none,
-  5, 131, :_reduce_none,
-  4, 131, :_reduce_none,
-  2, 131, :_reduce_none,
-  1, 142, :_reduce_116,
-  1, 144, :_reduce_none,
-  2, 144, :_reduce_none,
-  1, 143, :_reduce_none,
-  3, 145, :_reduce_none,
-  2, 145, :_reduce_none,
-  2, 145, :_reduce_none,
+  2, 140, :_reduce_none,
+  1, 139, :_reduce_124,
+  3, 143, :_reduce_125,
+  5, 143, :_reduce_126,
+  2, 143, :_reduce_none,
+  2, 143, :_reduce_none,
+  2, 145, :_reduce_129,
+  1, 145, :_reduce_none,
+  2, 145, :_reduce_131,
+  1, 145, :_reduce_132,
+  1, 144, :_reduce_133,
+  3, 144, :_reduce_134,
   1, 146, :_reduce_none,
-  3, 146, :_reduce_none,
-  1, 147, :_reduce_none,
-  4, 132, :_reduce_none,
-  5, 132, :_reduce_none,
-  2, 132, :_reduce_none,
-  1, 148, :_reduce_129,
+  5, 136, :_reduce_none,
+  4, 136, :_reduce_none,
+  2, 136, :_reduce_none,
+  1, 147, :_reduce_139,
   1, 149, :_reduce_none,
-  3, 149, :_reduce_none,
-  1, 150, :_reduce_none,
+  2, 149, :_reduce_none,
+  1, 148, :_reduce_none,
   3, 150, :_reduce_none,
-  1, 105, :_reduce_134,
-  1, 105, :_reduce_135,
-  2, 128, :_reduce_136,
-  1, 128, :_reduce_none,
-  2, 128, :_reduce_138,
-  1, 152, :_reduce_139,
-  3, 152, :_reduce_140,
-  4, 152, :_reduce_141,
-  3, 152, :_reduce_142,
-  4, 152, :_reduce_143,
-  3, 152, :_reduce_144,
-  1, 151, :_reduce_145,
-  2, 151, :_reduce_146,
-  2, 151, :_reduce_147,
-  3, 151, :_reduce_148,
+  2, 150, :_reduce_none,
+  2, 150, :_reduce_none,
+  1, 151, :_reduce_none,
+  3, 151, :_reduce_none,
+  1, 152, :_reduce_none,
+  2, 152, :_reduce_none,
+  3, 152, :_reduce_none,
+  4, 137, :_reduce_none,
+  5, 137, :_reduce_none,
+  5, 137, :_reduce_none,
+  6, 137, :_reduce_none,
+  2, 137, :_reduce_none,
+  5, 137, :_reduce_none,
+  6, 137, :_reduce_none,
+  2, 137, :_reduce_none,
   1, 153, :_reduce_none,
-  5, 153, :_reduce_none,
+  3, 153, :_reduce_none,
   1, 154, :_reduce_none,
   3, 154, :_reduce_none,
-  2, 155, :_reduce_none,
-  2, 155, :_reduce_none,
-  1, 155, :_reduce_none,
-  1, 109, :_reduce_none,
-  2, 109, :_reduce_none,
-  1, 156, :_reduce_none,
-  1, 156, :_reduce_none,
-  2, 156, :_reduce_none,
-  3, 157, :_reduce_none,
-  2, 157, :_reduce_none,
-  3, 157, :_reduce_none,
-  3, 157, :_reduce_none,
-  4, 157, :_reduce_none,
-  2, 157, :_reduce_166,
-  3, 157, :_reduce_none,
-  3, 157, :_reduce_168,
-  4, 157, :_reduce_none,
-  1, 129, :_reduce_170,
-  3, 129, :_reduce_171,
-  4, 129, :_reduce_172,
-  4, 129, :_reduce_173,
-  1, 158, :_reduce_174,
-  3, 158, :_reduce_175,
-  0, 98, :_reduce_none,
-  2, 98, :_reduce_none,
+  1, 106, :_reduce_163,
+  1, 106, :_reduce_none,
+  1, 106, :_reduce_165,
+  1, 131, :_reduce_none,
+  1, 131, :_reduce_none,
+  1, 131, :_reduce_none,
+  1, 131, :_reduce_none,
+  2, 133, :_reduce_170,
+  1, 133, :_reduce_none,
+  2, 133, :_reduce_172,
+  1, 156, :_reduce_173,
+  3, 156, :_reduce_174,
+  4, 156, :_reduce_175,
+  3, 156, :_reduce_176,
+  4, 156, :_reduce_177,
+  4, 156, :_reduce_none,
+  3, 156, :_reduce_179,
+  1, 155, :_reduce_180,
+  2, 155, :_reduce_181,
+  2, 155, :_reduce_182,
+  3, 155, :_reduce_183,
   1, 159, :_reduce_none,
   2, 159, :_reduce_none,
+  1, 157, :_reduce_none,
+  5, 157, :_reduce_none,
   1, 160, :_reduce_none,
-  1, 160, :_reduce_none,
-  2, 160, :_reduce_none,
-  2, 160, :_reduce_none,
-  1, 160, :_reduce_none,
-  1, 160, :_reduce_none,
-  1, 160, :_reduce_none,
-  4, 161, :_reduce_187,
-  1, 163, :_reduce_188,
-  3, 163, :_reduce_189,
-  3, 162, :_reduce_none,
-  0, 165, :_reduce_none,
+  3, 160, :_reduce_none,
+  2, 161, :_reduce_none,
+  2, 161, :_reduce_none,
+  1, 161, :_reduce_none,
+  1, 158, :_reduce_none,
+  3, 158, :_reduce_none,
+  1, 107, :_reduce_none,
+  2, 107, :_reduce_none,
+  1, 162, :_reduce_none,
+  1, 162, :_reduce_none,
+  2, 162, :_reduce_none,
+  3, 163, :_reduce_none,
+  2, 163, :_reduce_none,
+  3, 163, :_reduce_none,
+  3, 163, :_reduce_none,
+  4, 163, :_reduce_none,
+  2, 163, :_reduce_205,
+  3, 163, :_reduce_none,
+  3, 163, :_reduce_207,
+  4, 163, :_reduce_none,
+  1, 134, :_reduce_209,
+  3, 134, :_reduce_210,
+  4, 134, :_reduce_211,
+  4, 134, :_reduce_212,
+  1, 108, :_reduce_213,
+  3, 108, :_reduce_214,
+  0, 99, :_reduce_none,
+  2, 99, :_reduce_none,
+  1, 164, :_reduce_none,
+  2, 164, :_reduce_none,
+  1, 165, :_reduce_none,
+  1, 165, :_reduce_none,
   2, 165, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  1, 166, :_reduce_none,
-  5, 167, :_reduce_none,
-  7, 167, :_reduce_none,
-  5, 168, :_reduce_none,
-  7, 169, :_reduce_none,
-  9, 170, :_reduce_none,
-  5, 171, :_reduce_none,
-  3, 172, :_reduce_none,
-  4, 172, :_reduce_none,
-  3, 172, :_reduce_none,
-  3, 164, :_reduce_none,
-  3, 173, :_reduce_none,
-  2, 173, :_reduce_none,
-  2, 173, :_reduce_none,
-  3, 173, :_reduce_none,
-  2, 173, :_reduce_none,
-  2, 174, :_reduce_none,
-  4, 174, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 175, :_reduce_none,
-  1, 125, :_reduce_none,
-  1, 125, :_reduce_none,
-  1, 125, :_reduce_none,
-  1, 125, :_reduce_none,
-  1, 125, :_reduce_none,
-  1, 125, :_reduce_none,
-  1, 125, :_reduce_none,
-  1, 125, :_reduce_none,
-  1, 100, :_reduce_240,
-  2, 100, :_reduce_241,
-  3, 100, :_reduce_242 ]
-
-racc_reduce_n = 243
-
-racc_shift_n = 400
+  2, 165, :_reduce_none,
+  1, 165, :_reduce_none,
+  1, 165, :_reduce_none,
+  1, 165, :_reduce_none,
+  4, 166, :_reduce_226,
+  1, 168, :_reduce_227,
+  3, 168, :_reduce_228,
+  3, 167, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  1, 170, :_reduce_none,
+  3, 171, :_reduce_none,
+  4, 171, :_reduce_none,
+  3, 171, :_reduce_none,
+  2, 169, :_reduce_none,
+  3, 169, :_reduce_none,
+  1, 180, :_reduce_none,
+  2, 180, :_reduce_none,
+  1, 181, :_reduce_none,
+  1, 181, :_reduce_none,
+  1, 172, :_reduce_none,
+  2, 172, :_reduce_none,
+  5, 173, :_reduce_none,
+  7, 173, :_reduce_none,
+  5, 177, :_reduce_none,
+  5, 174, :_reduce_none,
+  7, 175, :_reduce_none,
+  6, 176, :_reduce_none,
+  7, 176, :_reduce_none,
+  6, 176, :_reduce_none,
+  7, 176, :_reduce_none,
+  3, 178, :_reduce_none,
+  2, 178, :_reduce_none,
+  2, 178, :_reduce_none,
+  2, 178, :_reduce_none,
+  3, 178, :_reduce_none,
+  1, 101, :_reduce_265,
+  2, 101, :_reduce_266,
+  3, 101, :_reduce_267,
+  1, 179, :_reduce_268 ]
+
+racc_reduce_n = 269
+
+racc_shift_n = 447
 
 racc_token_table = {
@@ -1014,85 +1101,86 @@
   "++" => 15,
   "--" => 16,
-  "," => 17,
-  :SIZEOF => 18,
-  "&" => 19,
-  "*" => 20,
-  "+" => 21,
-  "-" => 22,
-  "~" => 23,
-  "!" => 24,
-  "/" => 25,
-  "%" => 26,
-  "<<" => 27,
-  ">>" => 28,
-  "<" => 29,
-  ">" => 30,
-  "<=" => 31,
-  ">=" => 32,
-  "==" => 33,
-  "!=" => 34,
-  "^" => 35,
-  "|" => 36,
-  "&&" => 37,
-  "||" => 38,
-  "?" => 39,
-  ":" => 40,
-  ";" => 41,
-  "=" => 42,
-  :VOID => 43,
-  :FLOAT => 44,
-  :DOUBLE => 45,
-  :BOOL => 46,
-  :TYPE_NAME => 47,
-  :CHAR => 48,
-  :SHORT => 49,
-  :INT => 50,
-  :LONG => 51,
-  :SIGNED => 52,
-  :UNSIGNED => 53,
-  "{" => 54,
-  "}" => 55,
-  :STRUCT => 56,
-  :UNION => 57,
-  :ENUM => 58,
-  :CONST => 59,
-  :VOLATILE => 60,
-  :C_EXP => 61,
-  :EXTENSION => 62,
-  :TYPEDEF => 63,
-  :IF => 64,
-  :ELSE => 65,
-  :WHILE => 66,
-  :DO => 67,
-  :FOR => 68,
-  :SWITCH => 69,
-  :infunc_statment => 70,
-  :CASE => 71,
-  :DEFAULT => 72,
-  :GOTO => 73,
-  :CONTINUE => 74,
-  :BREAK => 75,
-  :RETURN => 76,
-  "+=" => 77,
-  "-=" => 78,
-  "*=" => 79,
-  "/=" => 80,
-  "%=" => 81,
-  "<<=" => 82,
-  ">>=" => 83,
-  "&=" => 84,
-  "|=" => 85,
-  "^=" => 86,
-  :__INLINE__ => 87,
-  :INLINE => 88,
-  :__INLINE => 89,
-  :CINLINE => 90,
-  :EXTERN => 91,
-  :STATIC => 92,
-  :AUTO => 93,
-  :REGISTER => 94,
-  "::" => 95 }
-
-racc_nt_base = 96
+  "{" => 17,
+  "}" => 18,
+  "," => 19,
+  :SIZEOF => 20,
+  "&" => 21,
+  "*" => 22,
+  "+" => 23,
+  "-" => 24,
+  "~" => 25,
+  "!" => 26,
+  "/" => 27,
+  "%" => 28,
+  "<<" => 29,
+  ">>" => 30,
+  "<" => 31,
+  ">" => 32,
+  "<=" => 33,
+  ">=" => 34,
+  "==" => 35,
+  "!=" => 36,
+  "^" => 37,
+  "|" => 38,
+  "&&" => 39,
+  "||" => 40,
+  "?" => 41,
+  ":" => 42,
+  "=" => 43,
+  "+=" => 44,
+  "-=" => 45,
+  "*=" => 46,
+  "/=" => 47,
+  "%=" => 48,
+  "<<=" => 49,
+  ">>=" => 50,
+  "&=" => 51,
+  "|=" => 52,
+  "^=" => 53,
+  ";" => 54,
+  :EXTERN => 55,
+  :STATIC => 56,
+  :AUTO => 57,
+  :REGISTER => 58,
+  :VOID => 59,
+  :CHAR => 60,
+  :SHORT => 61,
+  :INT => 62,
+  :LONG => 63,
+  :FLOAT => 64,
+  :DOUBLE => 65,
+  :SIGNED => 66,
+  :UNSIGNED => 67,
+  :BOOL => 68,
+  :TYPE_NAME => 69,
+  :STRUCT => 70,
+  :UNION => 71,
+  :ENUM => 72,
+  :CONST => 73,
+  :RESTRICT => 74,
+  :VOLATILE => 75,
+  :__INLINE__ => 76,
+  :INLINE => 77,
+  :__INLINE => 78,
+  :CINLINE => 79,
+  :C_EXP => 80,
+  :EXTENSION => 81,
+  :TYPEDEF => 82,
+  :CASE => 83,
+  :DEFAULT => 84,
+  :IF => 85,
+  :ELSE => 86,
+  :SWITCH => 87,
+  :WHILE => 88,
+  :DO => 89,
+  :FOR => 90,
+  :GOTO => 91,
+  :CONTINUE => 92,
+  :BREAK => 93,
+  :RETURN => 94,
+  "::" => 95,
+  :_ASM => 96 }
+
+racc_nt_base = 97
 
 racc_use_result_var = true
@@ -1132,4 +1220,6 @@
   "\"++\"",
   "\"--\"",
+  "\"{\"",
+  "\"}\"",
   "\",\"",
   "SIZEOF",
@@ -1156,40 +1246,5 @@
   "\"?\"",
   "\":\"",
-  "\";\"",
   "\"=\"",
-  "VOID",
-  "FLOAT",
-  "DOUBLE",
-  "BOOL",
-  "TYPE_NAME",
-  "CHAR",
-  "SHORT",
-  "INT",
-  "LONG",
-  "SIGNED",
-  "UNSIGNED",
-  "\"{\"",
-  "\"}\"",
-  "STRUCT",
-  "UNION",
-  "ENUM",
-  "CONST",
-  "VOLATILE",
-  "C_EXP",
-  "EXTENSION",
-  "TYPEDEF",
-  "IF",
-  "ELSE",
-  "WHILE",
-  "DO",
-  "FOR",
-  "SWITCH",
-  "infunc_statment",
-  "CASE",
-  "DEFAULT",
-  "GOTO",
-  "CONTINUE",
-  "BREAK",
-  "RETURN",
   "\"+=\"",
   "\"-=\"",
@@ -1202,13 +1257,47 @@
   "\"|=\"",
   "\"^=\"",
+  "\";\"",
+  "EXTERN",
+  "STATIC",
+  "AUTO",
+  "REGISTER",
+  "VOID",
+  "CHAR",
+  "SHORT",
+  "INT",
+  "LONG",
+  "FLOAT",
+  "DOUBLE",
+  "SIGNED",
+  "UNSIGNED",
+  "BOOL",
+  "TYPE_NAME",
+  "STRUCT",
+  "UNION",
+  "ENUM",
+  "CONST",
+  "RESTRICT",
+  "VOLATILE",
   "__INLINE__",
   "INLINE",
   "__INLINE",
   "CINLINE",
-  "EXTERN",
-  "STATIC",
-  "AUTO",
-  "REGISTER",
+  "C_EXP",
+  "EXTENSION",
+  "TYPEDEF",
+  "CASE",
+  "DEFAULT",
+  "IF",
+  "ELSE",
+  "SWITCH",
+  "WHILE",
+  "DO",
+  "FOR",
+  "GOTO",
+  "CONTINUE",
+  "BREAK",
+  "RETURN",
   "\"::\"",
+  "_ASM",
   "$start",
   "all",
@@ -1219,10 +1308,12 @@
   "expression",
   "postfix_expression",
-  "argument_list",
+  "argument_expression_list",
   "type_qualifier",
+  "type_name",
+  "initializer_list",
+  "assignment_expression",
   "unary_expression",
   "unary_operator",
   "cast_expression",
-  "type_name",
   "multiplicative_expression",
   "additive_expression",
@@ -1236,10 +1327,12 @@
   "logical_or_expression",
   "conditional_expression",
+  "assignment_operator",
   "constant_expression",
   "declaration",
   "declaration_specifiers",
   "init_declarator_list",
-  "storage_class",
+  "storage_class_specifier",
   "type_specifier",
+  "function_specifier",
   "init_declarator",
   "declarator",
@@ -1255,5 +1348,5 @@
   "struct_declaration",
   "struct_declarator_list",
-  "type_specifier_qualifier_list",
+  "specifier_qualifier_list",
   "struct_declarator",
   "union_term",
@@ -1263,5 +1356,4 @@
   "union_declarator_list",
   "union_declarator",
-  "enum_type",
   "enumerator_list",
   "enumerator",
@@ -1269,17 +1361,19 @@
   "direct_declarator",
   "parameter_type_list",
+  "identifier_list",
+  "type_qualifier_list",
   "parameter_list",
   "parameter_declaration",
   "abstract_declarator",
   "direct_abstract_declarator",
-  "initializer_list",
   "extension_statement",
-  "statement",
+  "cdl_statement",
   "typedef",
   "func_def",
   "declarator_list",
-  "compoundstatement",
-  "infunc_statement_list",
-  "infunc_statement",
+  "compound_statement",
+  "statement",
+  "labeled_statement",
+  "expression_statement",
   "ifstatement",
   "whilestatement",
@@ -1287,8 +1381,8 @@
   "forstatement",
   "switchstatement",
-  "labelstatement",
-  "gotostatement",
-  "expressionstatement",
-  "assignment_operator" ]
+  "jump_statement",
+  "asm_statement",
+  "block_item_list",
+  "block_item" ]
 
 Racc_debug_parser = false
@@ -1300,5 +1394,5 @@
 # reduce 1 omitted
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 52)
+module_eval(<<'.,.,', 'C_parser.y.rb', 57)
   def _reduce_2(val, _values, result)
      result = [ :IDENTIFIER, val[0] ] 
@@ -1307,5 +1401,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 60)
+module_eval(<<'.,.,', 'C_parser.y.rb', 65)
   def _reduce_3(val, _values, result)
      result = [ :INTEGER_CONSTANT, val[0] ] 
@@ -1314,5 +1408,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 62)
+module_eval(<<'.,.,', 'C_parser.y.rb', 67)
   def _reduce_4(val, _values, result)
      result = [ :FLOATING_CONSTANT, val[0] ] 
@@ -1321,5 +1415,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 64)
+module_eval(<<'.,.,', 'C_parser.y.rb', 69)
   def _reduce_5(val, _values, result)
      result = [ :OCTAL_CONSTANT, val[0] ] 
@@ -1328,5 +1422,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 66)
+module_eval(<<'.,.,', 'C_parser.y.rb', 71)
   def _reduce_6(val, _values, result)
      result = [ :HEX_CONSTANT, val[0] ] 
@@ -1335,5 +1429,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 68)
+module_eval(<<'.,.,', 'C_parser.y.rb', 73)
   def _reduce_7(val, _values, result)
      result = [ :CHARACTER_LITERAL, val[0] ] 
@@ -1342,5 +1436,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 70)
+module_eval(<<'.,.,', 'C_parser.y.rb', 75)
   def _reduce_8(val, _values, result)
      result = [ :STRING_LITERAL_LIST, val[0] ] 
@@ -1349,5 +1443,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 72)
+module_eval(<<'.,.,', 'C_parser.y.rb', 77)
   def _reduce_9(val, _values, result)
      result = [ :PARENTHESES, val[1].get_elements ] 
@@ -1356,5 +1450,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 76)
+module_eval(<<'.,.,', 'C_parser.y.rb', 81)
   def _reduce_10(val, _values, result)
      result = [val[0]] 
@@ -1363,5 +1457,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 78)
+module_eval(<<'.,.,', 'C_parser.y.rb', 83)
   def _reduce_11(val, _values, result)
      result << val[1] 
@@ -1372,17 +1466,19 @@
 # reduce 12 omitted
 
-# reduce 13 omitted
+module_eval(<<'.,.,', 'C_parser.y.rb', 89)
+  def _reduce_13(val, _values, result)
+     result = [ :OP_SUBSC, val[0], val[2] ] 
+    result
+  end
+.,.,
 
 # reduce 14 omitted
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 86)
-  def _reduce_15(val, _values, result)
-     result = [ :OP_SUBSC, val[0], val[2] ] 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 88)
-  def _reduce_16(val, _values, result)
+# reduce 15 omitted
+
+# reduce 16 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 94)
+  def _reduce_17(val, _values, result)
      result = [ :OP_DOT, val[0], val[2] ] 
     result
@@ -1390,6 +1486,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 90)
-  def _reduce_17(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 96)
+  def _reduce_18(val, _values, result)
      result = [ :OP_REF, val[0], val[2] ] 
     result
@@ -1397,12 +1493,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 91)
-  def _reduce_18(val, _values, result)
-     result = val[0] 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 92)
+module_eval(<<'.,.,', 'C_parser.y.rb', 97)
   def _reduce_19(val, _values, result)
      result = val[0] 
@@ -1411,5 +1500,10 @@
 .,.,
 
-# reduce 20 omitted
+module_eval(<<'.,.,', 'C_parser.y.rb', 98)
+  def _reduce_20(val, _values, result)
+     result = val[0] 
+    result
+  end
+.,.,
 
 # reduce 21 omitted
@@ -1419,6 +1513,10 @@
 # reduce 23 omitted
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 104)
-  def _reduce_24(val, _values, result)
+# reduce 24 omitted
+
+# reduce 25 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 111)
+  def _reduce_26(val, _values, result)
      result = [ val[0], val[1] ] 
     result
@@ -1426,6 +1524,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 106)
-  def _reduce_25(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 113)
+  def _reduce_27(val, _values, result)
      result = [ :OP_SIZEOF_EXPR, val[1] ] 
     result
@@ -1433,6 +1531,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 108)
-  def _reduce_26(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 115)
+  def _reduce_28(val, _values, result)
      result = [ :OP_SIZEOF_TYPE, val[1] ] 
     result
@@ -1440,6 +1538,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 109)
-  def _reduce_27(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 116)
+  def _reduce_29(val, _values, result)
      result = val[1] 
     result
@@ -1447,6 +1545,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 110)
-  def _reduce_28(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 117)
+  def _reduce_30(val, _values, result)
      result = val[1] 
     result
@@ -1454,6 +1552,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 113)
-  def _reduce_29(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 120)
+  def _reduce_31(val, _values, result)
      result = :OP_U_AMP 
     result
@@ -1461,6 +1559,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 114)
-  def _reduce_30(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 121)
+  def _reduce_32(val, _values, result)
      result = :OP_U_ASTER 
     result
@@ -1468,6 +1566,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 115)
-  def _reduce_31(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 122)
+  def _reduce_33(val, _values, result)
      result = :OP_U_PLUS 
     result
@@ -1475,6 +1573,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 116)
-  def _reduce_32(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 123)
+  def _reduce_34(val, _values, result)
      result = :OP_U_MINUS 
     result
@@ -1482,6 +1580,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 117)
-  def _reduce_33(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 124)
+  def _reduce_35(val, _values, result)
      result = :OP_U_TILDE 
     result
@@ -1489,6 +1587,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 118)
-  def _reduce_34(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 125)
+  def _reduce_36(val, _values, result)
      result = :OP_U_EXCLAM 
     result
@@ -1496,8 +1594,8 @@
 .,.,
 
-# reduce 35 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 123)
-  def _reduce_36(val, _values, result)
+# reduce 37 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 130)
+  def _reduce_38(val, _values, result)
       result = [ :CAST, val[1], val[3] ] 
     result
@@ -1505,8 +1603,8 @@
 .,.,
 
-# reduce 37 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 128)
-  def _reduce_38(val, _values, result)
+# reduce 39 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 135)
+  def _reduce_40(val, _values, result)
      result = [ :OP_MULT, val[0], val[2] ]  
     result
@@ -1514,6 +1612,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 130)
-  def _reduce_39(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 137)
+  def _reduce_41(val, _values, result)
      result = [ :OP_DIV, val[0], val[2] ]  
     result
@@ -1521,6 +1619,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 132)
-  def _reduce_40(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 139)
+  def _reduce_42(val, _values, result)
      result = [ :OP_REMAIN, val[0], val[2] ]  
     result
@@ -1528,8 +1626,8 @@
 .,.,
 
-# reduce 41 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 137)
-  def _reduce_42(val, _values, result)
+# reduce 43 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 144)
+  def _reduce_44(val, _values, result)
      result = [ :OP_ADD, val[0], val[2] ]  
     result
@@ -1537,6 +1635,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 139)
-  def _reduce_43(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 146)
+  def _reduce_45(val, _values, result)
      result = [ :OP_SUB, val[0], val[2] ]  
     result
@@ -1544,8 +1642,8 @@
 .,.,
 
-# reduce 44 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 144)
-  def _reduce_45(val, _values, result)
+# reduce 46 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 151)
+  def _reduce_47(val, _values, result)
      result = [ :OP_LSFT, val[0], val[2] ]  
     result
@@ -1553,6 +1651,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 146)
-  def _reduce_46(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 153)
+  def _reduce_48(val, _values, result)
      result = [ :OP_RSFT, val[0], val[2] ]  
     result
@@ -1560,8 +1658,8 @@
 .,.,
 
-# reduce 47 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 151)
-  def _reduce_48(val, _values, result)
+# reduce 49 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 158)
+  def _reduce_50(val, _values, result)
      result = [ :OP_LT, val[0], val[2] ]  
     result
@@ -1569,6 +1667,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 153)
-  def _reduce_49(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 160)
+  def _reduce_51(val, _values, result)
      result = [ :OP_GT, val[0], val[2] ]  
     result
@@ -1576,6 +1674,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 155)
-  def _reduce_50(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 162)
+  def _reduce_52(val, _values, result)
      result = [ :OP_LE, val[0], val[2] ]  
     result
@@ -1583,6 +1681,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 157)
-  def _reduce_51(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 164)
+  def _reduce_53(val, _values, result)
      result = [ :OP_GE, val[0], val[2] ]  
     result
@@ -1590,8 +1688,8 @@
 .,.,
 
-# reduce 52 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 162)
-  def _reduce_53(val, _values, result)
+# reduce 54 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 169)
+  def _reduce_55(val, _values, result)
      result = [ :OP_EQ, val[0], val[2] ]  
     result
@@ -1599,6 +1697,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 164)
-  def _reduce_54(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 171)
+  def _reduce_56(val, _values, result)
      result = [ :OP_NE, val[0], val[2] ]  
     result
@@ -1606,8 +1704,8 @@
 .,.,
 
-# reduce 55 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 169)
-  def _reduce_56(val, _values, result)
+# reduce 57 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 176)
+  def _reduce_58(val, _values, result)
      result = [ :OP_AND, val[0], val[2] ]  
     result
@@ -1615,8 +1713,8 @@
 .,.,
 
-# reduce 57 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 174)
-  def _reduce_58(val, _values, result)
+# reduce 59 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 181)
+  def _reduce_60(val, _values, result)
      result = [ :OP_EOR, val[0], val[2] ]  
     result
@@ -1624,8 +1722,8 @@
 .,.,
 
-# reduce 59 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 179)
-  def _reduce_60(val, _values, result)
+# reduce 61 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 186)
+  def _reduce_62(val, _values, result)
      result = [ :OP_OR, val[0], val[2] ]  
     result
@@ -1633,8 +1731,8 @@
 .,.,
 
-# reduce 61 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 184)
-  def _reduce_62(val, _values, result)
+# reduce 63 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 191)
+  def _reduce_64(val, _values, result)
      result = [ :OP_LAND, val[0], val[2] ]  
     result
@@ -1642,8 +1740,8 @@
 .,.,
 
-# reduce 63 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 189)
-  def _reduce_64(val, _values, result)
+# reduce 65 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 196)
+  def _reduce_66(val, _values, result)
      result = [ :OP_LOR, val[0], val[2] ]  
     result
@@ -1651,8 +1749,8 @@
 .,.,
 
-# reduce 65 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 194)
-  def _reduce_66(val, _values, result)
+# reduce 67 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 201)
+  def _reduce_68(val, _values, result)
      result = [ :OP_CEX, val[0], val[2].get_elements, val[4] ]  
     result
@@ -1660,6 +1758,32 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 201)
-  def _reduce_67(val, _values, result)
+# reduce 69 omitted
+
+# reduce 70 omitted
+
+# reduce 71 omitted
+
+# reduce 72 omitted
+
+# reduce 73 omitted
+
+# reduce 74 omitted
+
+# reduce 75 omitted
+
+# reduce 76 omitted
+
+# reduce 77 omitted
+
+# reduce 78 omitted
+
+# reduce 79 omitted
+
+# reduce 80 omitted
+
+# reduce 81 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 223)
+  def _reduce_82(val, _values, result)
     			result = Expression.new( val[0] )
 			# result.print
@@ -1669,6 +1793,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 208)
-  def _reduce_68(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 228)
+  def _reduce_83(val, _values, result)
+    			result = Expression.new( val[2] )    # ',' の後ろを採用
+		
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 234)
+  def _reduce_84(val, _values, result)
     			result = Expression.new( val[0] )
 			# result.print
@@ -1685,8 +1817,8 @@
 .,.,
 
-# reduce 69 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 237)
-  def _reduce_70(val, _values, result)
+# reduce 85 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 261)
+  def _reduce_86(val, _values, result)
     			result = CIntType.new( -3 )    # storage class は無視
 		
@@ -1695,8 +1827,24 @@
 .,.,
 
-# reduce 71 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 242)
-  def _reduce_72(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 265)
+  def _reduce_87(val, _values, result)
+    			result = val[1]                # storage class は無視
+		
+    result
+  end
+.,.,
+
+# reduce 88 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 270)
+  def _reduce_89(val, _values, result)
+    			result = val[1].merge val[0]
+		
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 274)
+  def _reduce_90(val, _values, result)
     			result = CIntType.new( -3 )
 			result.set_qualifier val[0]
@@ -1706,31 +1854,19 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 247)
-  def _reduce_73(val, _values, result)
-    			result = val[1]                # storage class は無視
-		
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 251)
-  def _reduce_74(val, _values, result)
-    			result = val[1].merge val[0]
-		
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 255)
-  def _reduce_75(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 279)
+  def _reduce_91(val, _values, result)
     			val[1].set_qualifier val[0]
-                        result = val[1]
-		
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 262)
-  def _reduce_76(val, _values, result)
+						result = val[1]
+		
+    result
+  end
+.,.,
+
+# reduce 92 omitted
+
+# reduce 93 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 287)
+  def _reduce_94(val, _values, result)
      result = [val[0]] 
     result
@@ -1738,6 +1874,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 264)
-  def _reduce_77(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 289)
+  def _reduce_95(val, _values, result)
      result << val[2] 
     result
@@ -1745,8 +1881,8 @@
 .,.,
 
-# reduce 78 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 269)
-  def _reduce_79(val, _values, result)
+# reduce 96 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 294)
+  def _reduce_97(val, _values, result)
      val[0].set_initializer( val[2] ) 
     result
@@ -1754,6 +1890,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 272)
-  def _reduce_80(val, _values, result)
+# reduce 98 omitted
+
+# reduce 99 omitted
+
+# reduce 100 omitted
+
+# reduce 101 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 304)
+  def _reduce_102(val, _values, result)
      set_no_type_name true; result = CVoidType.new 
     result
@@ -1761,6 +1905,34 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 273)
-  def _reduce_81(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 306)
+  def _reduce_103(val, _values, result)
+     set_no_type_name true; result = CIntType.new(-11 ) 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 308)
+  def _reduce_104(val, _values, result)
+     set_no_type_name true; result = CIntType.new( -2 ) 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 310)
+  def _reduce_105(val, _values, result)
+     set_no_type_name true; result = CIntType.new( -3 ) 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 312)
+  def _reduce_106(val, _values, result)
+     set_no_type_name true; result = CIntType.new( -4 ) 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 314)
+  def _reduce_107(val, _values, result)
      set_no_type_name true; result = CFloatType.new(-32) 
     result
@@ -1768,6 +1940,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 274)
-  def _reduce_82(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 316)
+  def _reduce_108(val, _values, result)
      set_no_type_name true; result = CFloatType.new(-64) 
     result
@@ -1775,69 +1947,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 275)
-  def _reduce_83(val, _values, result)
-     set_no_type_name true; result = CBoolType.new 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 276)
-  def _reduce_84(val, _values, result)
-     set_no_type_name true; result = val[0] 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 277)
-  def _reduce_85(val, _values, result)
-     set_no_type_name true; result = CVoidType.new 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 278)
-  def _reduce_86(val, _values, result)
-     set_no_type_name true; result = CVoidType.new 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 279)
-  def _reduce_87(val, _values, result)
-     set_no_type_name true; result = CDefinedType.new( val[0].val ) 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 281)
-  def _reduce_88(val, _values, result)
-     set_no_type_name true; result = CIntType.new(-11 ) 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 282)
-  def _reduce_89(val, _values, result)
-     set_no_type_name true; result = CIntType.new( -2 ) 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 283)
-  def _reduce_90(val, _values, result)
-     set_no_type_name true; result = CIntType.new( -3 ) 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 284)
-  def _reduce_91(val, _values, result)
-     set_no_type_name true; result = CIntType.new( -4 ) 
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 287)
-  def _reduce_92(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 319)
+  def _reduce_109(val, _values, result)
     			set_no_type_name true
 			result = CIntType.new( -3 )
@@ -1848,6 +1957,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 293)
-  def _reduce_93(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 325)
+  def _reduce_110(val, _values, result)
     			set_no_type_name true
 			result = CIntType.new( -3 )
@@ -1858,6 +1967,41 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 302)
-  def _reduce_94(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 330)
+  def _reduce_111(val, _values, result)
+     set_no_type_name true; result = CBoolType.new 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 332)
+  def _reduce_112(val, _values, result)
+     set_no_type_name true; result = val[0] 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 334)
+  def _reduce_113(val, _values, result)
+     set_no_type_name true; result = CVoidType.new 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 336)
+  def _reduce_114(val, _values, result)
+     set_no_type_name true; result = CVoidType.new 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 338)
+  def _reduce_115(val, _values, result)
+     set_no_type_name true; result = CDefinedType.new( val[0].val ) 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 344)
+  def _reduce_116(val, _values, result)
      StructType.set_define( true )  
     result
@@ -1865,6 +2009,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 305)
-  def _reduce_95(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 347)
+  def _reduce_117(val, _values, result)
     			StructType.end_of_parse
 			result = val[1]
@@ -1874,6 +2018,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 311)
-  def _reduce_96(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 353)
+  def _reduce_118(val, _values, result)
     			result = CStructType.new()
 			StructType.set_define( true )
@@ -1883,6 +2027,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 316)
-  def _reduce_97(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 358)
+  def _reduce_119(val, _values, result)
     			StructType.end_of_parse
 			result = val[1]
@@ -1892,6 +2036,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 322)
-  def _reduce_98(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 364)
+  def _reduce_120(val, _values, result)
     			StructType.set_define( false )
 			StructType.end_of_parse
@@ -1902,6 +2046,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 328)
-  def _reduce_99(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 370)
+  def _reduce_121(val, _values, result)
      set_no_type_name true 
     result
@@ -1909,10 +2053,10 @@
 .,.,
 
-# reduce 100 omitted
-
-# reduce 101 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 337)
-  def _reduce_102(val, _values, result)
+# reduce 122 omitted
+
+# reduce 123 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 379)
+  def _reduce_124(val, _values, result)
     			result = CStructType.new( val[0].val )
 			set_no_type_name true
@@ -1922,6 +2066,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 346)
-  def _reduce_103(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 388)
+  def _reduce_125(val, _values, result)
     			val[1].each { |i|	# i: Decl
 				i.set_type( val[0] )
@@ -1936,12 +2080,24 @@
 .,.,
 
-# reduce 104 omitted
-
-# reduce 105 omitted
-
-# reduce 106 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 365)
-  def _reduce_107(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 399)
+  def _reduce_126(val, _values, result)
+    			val[1].each { |i|	# i: Decl
+				i.set_type( val[0] )
+				i.set_kind( :MEMBER )
+				i.check
+				CStructType.new_member( i )
+			}
+			result = val[1]
+		
+    result
+  end
+.,.,
+
+# reduce 127 omitted
+
+# reduce 128 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 417)
+  def _reduce_129(val, _values, result)
     			result = val[1].merge val[0]
 		
@@ -1950,6 +2106,17 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 369)
-  def _reduce_108(val, _values, result)
+# reduce 130 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 422)
+  def _reduce_131(val, _values, result)
+    			val[1].set_qualifier val[0]
+						result = val[1]
+		
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 427)
+  def _reduce_132(val, _values, result)
     			result = CIntType.new( -3 )
 			result.set_qualifier val[0]
@@ -1959,15 +2126,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 374)
-  def _reduce_109(val, _values, result)
-    			val[1].set_qualifier val[0]
-                        result = val[1]
-		
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 380)
-  def _reduce_110(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 433)
+  def _reduce_133(val, _values, result)
      result = [ val[0] ] 
     result
@@ -1975,6 +2133,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 382)
-  def _reduce_111(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 435)
+  def _reduce_134(val, _values, result)
      result << val[2] 
     result
@@ -1982,14 +2140,14 @@
 .,.,
 
-# reduce 112 omitted
-
-# reduce 113 omitted
-
-# reduce 114 omitted
-
-# reduce 115 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 399)
-  def _reduce_116(val, _values, result)
+# reduce 135 omitted
+
+# reduce 136 omitted
+
+# reduce 137 omitted
+
+# reduce 138 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 452)
+  def _reduce_139(val, _values, result)
      set_no_type_name true 
     result
@@ -1997,45 +2155,52 @@
 .,.,
 
-# reduce 117 omitted
-
-# reduce 118 omitted
-
-# reduce 119 omitted
-
-# reduce 120 omitted
-
-# reduce 121 omitted
-
-# reduce 122 omitted
-
-# reduce 123 omitted
-
-# reduce 124 omitted
-
-# reduce 125 omitted
-
-# reduce 126 omitted
-
-# reduce 127 omitted
-
-# reduce 128 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 430)
-  def _reduce_129(val, _values, result)
-     result = CEnumType.new( -1 ) 
-    result
-  end
-.,.,
-
-# reduce 130 omitted
-
-# reduce 131 omitted
-
-# reduce 132 omitted
-
-# reduce 133 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 446)
-  def _reduce_134(val, _values, result)
+# reduce 140 omitted
+
+# reduce 141 omitted
+
+# reduce 142 omitted
+
+# reduce 143 omitted
+
+# reduce 144 omitted
+
+# reduce 145 omitted
+
+# reduce 146 omitted
+
+# reduce 147 omitted
+
+# reduce 148 omitted
+
+# reduce 149 omitted
+
+# reduce 150 omitted
+
+# reduce 151 omitted
+
+# reduce 152 omitted
+
+# reduce 153 omitted
+
+# reduce 154 omitted
+
+# reduce 155 omitted
+
+# reduce 156 omitted
+
+# reduce 157 omitted
+
+# reduce 158 omitted
+
+# reduce 159 omitted
+
+# reduce 160 omitted
+
+# reduce 161 omitted
+
+# reduce 162 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 495)
+  def _reduce_163(val, _values, result)
      result = :CONST 
     result
@@ -2043,6 +2208,8 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 447)
-  def _reduce_135(val, _values, result)
+# reduce 164 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 498)
+  def _reduce_165(val, _values, result)
      result = :VOLATILE 
     result
@@ -2050,6 +2217,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 452)
-  def _reduce_136(val, _values, result)
+# reduce 166 omitted
+
+# reduce 167 omitted
+
+# reduce 168 omitted
+
+# reduce 169 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 509)
+  def _reduce_170(val, _values, result)
     			val[1].set_type( val[0] )
 			result = val[1]
@@ -2059,8 +2234,8 @@
 .,.,
 
-# reduce 137 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 458)
-  def _reduce_138(val, _values, result)
+# reduce 171 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 515)
+  def _reduce_172(val, _values, result)
     			result = Decl.new( val[1].val )
 			result.set_type( val[0] )
@@ -2070,6 +2245,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 464)
-  def _reduce_139(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 521)
+  def _reduce_173(val, _values, result)
      result = Decl.new( val[0].val ) 
     result
@@ -2077,6 +2252,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 466)
-  def _reduce_140(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 523)
+  def _reduce_174(val, _values, result)
      result = val[1] 
     result
@@ -2084,6 +2259,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 469)
-  def _reduce_141(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 526)
+  def _reduce_175(val, _values, result)
     			val[0].set_type( CArrayType.new( val[2] ) )
 			result = val[0]
@@ -2093,6 +2268,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 474)
-  def _reduce_142(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 531)
+  def _reduce_176(val, _values, result)
     			val[0].set_type( CArrayType.new )
 			result = val[0]
@@ -2102,6 +2277,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 479)
-  def _reduce_143(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 536)
+  def _reduce_177(val, _values, result)
     		# 	Generator.warning( "W6001 need 'void' for no parameter"  )
 			val[0].set_type( CFuncType.new )
@@ -2112,6 +2287,8 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 487)
-  def _reduce_144(val, _values, result)
+# reduce 178 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 543)
+  def _reduce_179(val, _values, result)
     		# 	Generator.warning( "W6002 need 'void' for no parameter"  )
 			val[0].set_type( CFuncType.new )
@@ -2122,6 +2299,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 494)
-  def _reduce_145(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 550)
+  def _reduce_180(val, _values, result)
      result = CPtrType.new 
     result
@@ -2129,6 +2306,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 497)
-  def _reduce_146(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 553)
+  def _reduce_181(val, _values, result)
     			result = CPtrType.new
 			result.set_qualifier( val[1] )
@@ -2138,6 +2315,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 502)
-  def _reduce_147(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 558)
+  def _reduce_182(val, _values, result)
     			val[1].set_type(CPtrType.new)
 			result = val[1]
@@ -2147,6 +2324,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 507)
-  def _reduce_148(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 563)
+  def _reduce_183(val, _values, result)
     			ptrtype = CPtrType.new
 			ptrtype.set_qualifier( val[1] )
@@ -2158,40 +2335,48 @@
 .,.,
 
-# reduce 149 omitted
-
-# reduce 150 omitted
-
-# reduce 151 omitted
-
-# reduce 152 omitted
-
-# reduce 153 omitted
-
-# reduce 154 omitted
-
-# reduce 155 omitted
-
-# reduce 156 omitted
-
-# reduce 157 omitted
-
-# reduce 158 omitted
-
-# reduce 159 omitted
-
-# reduce 160 omitted
-
-# reduce 161 omitted
-
-# reduce 162 omitted
-
-# reduce 163 omitted
-
-# reduce 164 omitted
-
-# reduce 165 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 571)
-  def _reduce_166(val, _values, result)
+# reduce 184 omitted
+
+# reduce 185 omitted
+
+# reduce 186 omitted
+
+# reduce 187 omitted
+
+# reduce 188 omitted
+
+# reduce 189 omitted
+
+# reduce 190 omitted
+
+# reduce 191 omitted
+
+# reduce 192 omitted
+
+# reduce 193 omitted
+
+# reduce 194 omitted
+
+# reduce 195 omitted
+
+# reduce 196 omitted
+
+# reduce 197 omitted
+
+# reduce 198 omitted
+
+# reduce 199 omitted
+
+# reduce 200 omitted
+
+# reduce 201 omitted
+
+# reduce 202 omitted
+
+# reduce 203 omitted
+
+# reduce 204 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 630)
+  def _reduce_205(val, _values, result)
     			Generator.warning( "W6003 need 'void' for no parameter"  )
 		
@@ -2200,8 +2385,8 @@
 .,.,
 
-# reduce 167 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 576)
-  def _reduce_168(val, _values, result)
+# reduce 206 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 635)
+  def _reduce_207(val, _values, result)
     			Generator.warning( "W6004 need 'void' for no parameter"  )
 		
@@ -2210,8 +2395,8 @@
 .,.,
 
-# reduce 169 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 583)
-  def _reduce_170(val, _values, result)
+# reduce 208 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 642)
+  def _reduce_209(val, _values, result)
      result = val[0] 
     result
@@ -2219,6 +2404,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 585)
-  def _reduce_171(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 644)
+  def _reduce_210(val, _values, result)
      result = val[1] 
     result
@@ -2226,6 +2411,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 587)
-  def _reduce_172(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 646)
+  def _reduce_211(val, _values, result)
      result = val[1] 
     result
@@ -2233,6 +2418,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 589)
-  def _reduce_173(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 648)
+  def _reduce_212(val, _values, result)
      result = C_EXP.new( val[2] ) 
     result
@@ -2240,6 +2425,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 594)
-  def _reduce_174(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 653)
+  def _reduce_213(val, _values, result)
     			result = [ val[0] ]
 		
@@ -2248,6 +2433,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 598)
-  def _reduce_175(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 657)
+  def _reduce_214(val, _values, result)
     			val[0] << val[2]
 			result = val[0]
@@ -2257,28 +2442,28 @@
 .,.,
 
-# reduce 176 omitted
-
-# reduce 177 omitted
-
-# reduce 178 omitted
-
-# reduce 179 omitted
-
-# reduce 180 omitted
-
-# reduce 181 omitted
-
-# reduce 182 omitted
-
-# reduce 183 omitted
-
-# reduce 184 omitted
-
-# reduce 185 omitted
-
-# reduce 186 omitted
-
-module_eval(<<'.,.,', 'C_parser.y.rb', 626)
-  def _reduce_187(val, _values, result)
+# reduce 215 omitted
+
+# reduce 216 omitted
+
+# reduce 217 omitted
+
+# reduce 218 omitted
+
+# reduce 219 omitted
+
+# reduce 220 omitted
+
+# reduce 221 omitted
+
+# reduce 222 omitted
+
+# reduce 223 omitted
+
+# reduce 224 omitted
+
+# reduce 225 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 685)
+  def _reduce_226(val, _values, result)
     			val[2].each{ |i|
 			   i.set_kind( :TYPEDEF )
@@ -2291,6 +2476,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 635)
-  def _reduce_188(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 694)
+  def _reduce_227(val, _values, result)
      result = [ val[0] ] 
     result
@@ -2298,6 +2483,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 637)
-  def _reduce_189(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 696)
+  def _reduce_228(val, _values, result)
      result << val[2] 
     result
@@ -2305,82 +2490,4 @@
 .,.,
 
-# reduce 190 omitted
-
-# reduce 191 omitted
-
-# reduce 192 omitted
-
-# reduce 193 omitted
-
-# reduce 194 omitted
-
-# reduce 195 omitted
-
-# reduce 196 omitted
-
-# reduce 197 omitted
-
-# reduce 198 omitted
-
-# reduce 199 omitted
-
-# reduce 200 omitted
-
-# reduce 201 omitted
-
-# reduce 202 omitted
-
-# reduce 203 omitted
-
-# reduce 204 omitted
-
-# reduce 205 omitted
-
-# reduce 206 omitted
-
-# reduce 207 omitted
-
-# reduce 208 omitted
-
-# reduce 209 omitted
-
-# reduce 210 omitted
-
-# reduce 211 omitted
-
-# reduce 212 omitted
-
-# reduce 213 omitted
-
-# reduce 214 omitted
-
-# reduce 215 omitted
-
-# reduce 216 omitted
-
-# reduce 217 omitted
-
-# reduce 218 omitted
-
-# reduce 219 omitted
-
-# reduce 220 omitted
-
-# reduce 221 omitted
-
-# reduce 222 omitted
-
-# reduce 223 omitted
-
-# reduce 224 omitted
-
-# reduce 225 omitted
-
-# reduce 226 omitted
-
-# reduce 227 omitted
-
-# reduce 228 omitted
-
 # reduce 229 omitted
 
@@ -2405,6 +2512,56 @@
 # reduce 239 omitted
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 718)
-  def _reduce_240(val, _values, result)
+# reduce 240 omitted
+
+# reduce 241 omitted
+
+# reduce 242 omitted
+
+# reduce 243 omitted
+
+# reduce 244 omitted
+
+# reduce 245 omitted
+
+# reduce 246 omitted
+
+# reduce 247 omitted
+
+# reduce 248 omitted
+
+# reduce 249 omitted
+
+# reduce 250 omitted
+
+# reduce 251 omitted
+
+# reduce 252 omitted
+
+# reduce 253 omitted
+
+# reduce 254 omitted
+
+# reduce 255 omitted
+
+# reduce 256 omitted
+
+# reduce 257 omitted
+
+# reduce 258 omitted
+
+# reduce 259 omitted
+
+# reduce 260 omitted
+
+# reduce 261 omitted
+
+# reduce 262 omitted
+
+# reduce 263 omitted
+
+# reduce 264 omitted
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 761)
+  def _reduce_265(val, _values, result)
      result = NamespacePath.new( val[0].val, false ) 
     result
@@ -2412,6 +2569,6 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 719)
-  def _reduce_241(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 762)
+  def _reduce_266(val, _values, result)
      result = NamespacePath.new( val[1].val, true ) 
     result
@@ -2419,7 +2576,24 @@
 .,.,
 
-module_eval(<<'.,.,', 'C_parser.y.rb', 721)
-  def _reduce_242(val, _values, result)
+module_eval(<<'.,.,', 'C_parser.y.rb', 764)
+  def _reduce_267(val, _values, result)
      result = val[0].append!( val[2].val ) 
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'C_parser.y.rb', 768)
+  def _reduce_268(val, _values, result)
+    		while true
+			# ';' が表れるまで、トークンを読み飛ばす。
+			# gcc の構文拡張に対応すべきだが、単純な実装として、';' まで読み飛ばす。
+			# トークン単位で読み飛ばしているので、文字列やコメント内の ';' は対象にならない。
+			token = next_token
+			if token[1].val == ";"
+				break
+			end
+			# p "skip: #{token[1].val}" 
+		end
+		
     result
   end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.y.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.y.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/C_parser.y.rb	(revision 374)
@@ -4,7 +4,7 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2018 by TOPPERS Project
 #--
-#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   上記著作権者は，以下の(1)〜(4)の条件を満たす場合に限り，本ソフトウェ
 #   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
 #   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
@@ -48,7 +48,12 @@
 # argument_expression_list(関数引数), assignment_expression(代入)がない
 # 式の result は、すべて配列で第一要素が識別シンボル、第二要素以下が引数
+#
+# 2019/3/28 長島 下記のC99の構文に近づくよう変更
+#（読めないヘッダーファイルがあったため）
+# http://www.quut.com/c/ANSI-C-grammar-y-1999.html
+# 元々のコメントと合わなくなっています
 
 primary_expression
-        : namespace_identifier
+		: namespace_identifier
 		{ result = [ :IDENTIFIER, val[0] ] }     #1ok
 #        : IDENTIFIER	# mikan namespace への対応
@@ -58,53 +63,55 @@
 #        | FALSE
 #		{ result = [ :BOOL_CONSTANT, false ] }
-        | INTEGER_CONSTANT
+		| INTEGER_CONSTANT
 		{ result = [ :INTEGER_CONSTANT, val[0] ] }
-        | FLOATING_CONSTANT
+		| FLOATING_CONSTANT
 		{ result = [ :FLOATING_CONSTANT, val[0] ] }
-        | OCTAL_CONSTANT
+		| OCTAL_CONSTANT
 		{ result = [ :OCTAL_CONSTANT, val[0] ] }
-        | HEX_CONSTANT
+		| HEX_CONSTANT
 		{ result = [ :HEX_CONSTANT, val[0] ] }
-        | CHARACTER_LITERAL
+		| CHARACTER_LITERAL
 		{ result = [ :CHARACTER_LITERAL, val[0] ] }
-        | string_literal_list
+		| string_literal_list
 		{ result = [ :STRING_LITERAL_LIST, val[0] ] }
-        | '(' expression ')'
+		| '(' expression ')'
 		{ result = [ :PARENTHESES, val[1].get_elements ] }
 
 string_literal_list
-        : STRING_LITERAL
+		: STRING_LITERAL
 		{ result = [val[0]] }
-        | string_literal_list STRING_LITERAL
+		| string_literal_list STRING_LITERAL
 		{ result << val[1] }
 
 # 関数呼び出しと後置インクリメント、デクリメント演算子がない
 postfix_expression
-        : primary_expression
-        | primary_expression '(' argument_list ')'
-        | primary_expression type_qualifier '(' argument_list ')'    # intended __asm volatile ( "   MNEMONIC  OPERAND" );
-        | postfix_expression '[' expression ']'
+		: primary_expression
+		| postfix_expression '[' expression ']'
 		{ result = [ :OP_SUBSC, val[0], val[2] ] }
-        | postfix_expression '.' IDENTIFIER
+		| postfix_expression '(' ')'
+		| postfix_expression '(' argument_expression_list ')'
+		| postfix_expression type_qualifier '(' argument_expression_list ')'    # intended __asm volatile ( "   MNEMONIC  OPERAND" );
+		| postfix_expression '.' IDENTIFIER
 		{ result = [ :OP_DOT, val[0], val[2] ] }
-        | postfix_expression '->' IDENTIFIER
+		| postfix_expression '->' IDENTIFIER
 		{ result = [ :OP_REF, val[0], val[2] ] }
-        | postfix_expression '++'	{ result = val[0] }   # ++, -- は無視する
-        | postfix_expression '--'	{ result = val[0] }
-
-argument_list
-        :
-        | expression
-        | argument_list ',' expression
+		| postfix_expression '++'	{ result = val[0] }   # ++, -- は無視する
+		| postfix_expression '--'	{ result = val[0] }
+		| '(' type_name ')' '{' initializer_list '}'
+		| '(' type_name ')' '{' initializer_list ',' '}'
+
+argument_expression_list
+		: assignment_expression
+		| argument_expression_list ',' assignment_expression
 
 
 # 前置インクリメント、デクリメント演算子がない
 unary_expression
-        : postfix_expression
-        | unary_operator cast_expression
+		: postfix_expression
+		| unary_operator cast_expression
 		{ result = [ val[0], val[1] ] }
-        | SIZEOF unary_expression
+		| SIZEOF unary_expression
 		{ result = [ :OP_SIZEOF_EXPR, val[1] ] }
-        | SIZEOF '(' type_name ')'
+		| SIZEOF '(' type_name ')'
 		{ result = [ :OP_SIZEOF_TYPE, val[1] ] }
 		| '++' unary_expression			{ result = val[1] }   # ++, -- は無視する
@@ -112,98 +119,117 @@
 
 unary_operator
-        : '&'	{ result = :OP_U_AMP }
-        | '*'	{ result = :OP_U_ASTER }
-        | '+'	{ result = :OP_U_PLUS }
-        | '-'	{ result = :OP_U_MINUS }
-        | '~'	{ result = :OP_U_TILDE }
-        | '!'	{ result = :OP_U_EXCLAM }
+		: '&'	{ result = :OP_U_AMP }
+		| '*'	{ result = :OP_U_ASTER }
+		| '+'	{ result = :OP_U_PLUS }
+		| '-'	{ result = :OP_U_MINUS }
+		| '~'	{ result = :OP_U_TILDE }
+		| '!'	{ result = :OP_U_EXCLAM }
 
 cast_expression
-        : unary_expression
-        | '(' type_name ')' cast_expression
+		: unary_expression
+		| '(' type_name ')' cast_expression
 		{  result = [ :CAST, val[1], val[3] ] }
 
 multiplicative_expression
-        : cast_expression
-        | multiplicative_expression '*' cast_expression
+		: cast_expression
+		| multiplicative_expression '*' cast_expression
 		{ result = [ :OP_MULT, val[0], val[2] ]  }
-        | multiplicative_expression '/' cast_expression
+		| multiplicative_expression '/' cast_expression
 		{ result = [ :OP_DIV, val[0], val[2] ]  }
-        | multiplicative_expression '%' cast_expression
+		| multiplicative_expression '%' cast_expression
 		{ result = [ :OP_REMAIN, val[0], val[2] ]  }
 
 additive_expression
-        : multiplicative_expression
-        | additive_expression '+' multiplicative_expression
+		: multiplicative_expression
+		| additive_expression '+' multiplicative_expression
 		{ result = [ :OP_ADD, val[0], val[2] ]  }
-        | additive_expression '-' multiplicative_expression
+		| additive_expression '-' multiplicative_expression
 		{ result = [ :OP_SUB, val[0], val[2] ]  }
 
 shift_expression
-        : additive_expression
-        | shift_expression '<<' additive_expression
+		: additive_expression
+		| shift_expression '<<' additive_expression
 		{ result = [ :OP_LSFT, val[0], val[2] ]  }
-        | shift_expression '>>' additive_expression
+		| shift_expression '>>' additive_expression
 		{ result = [ :OP_RSFT, val[0], val[2] ]  }
 
 relational_expression
-        : shift_expression
-        | relational_expression '<' shift_expression
+		: shift_expression
+		| relational_expression '<' shift_expression
 		{ result = [ :OP_LT, val[0], val[2] ]  }
-        | relational_expression '>' shift_expression
+		| relational_expression '>' shift_expression
 		{ result = [ :OP_GT, val[0], val[2] ]  }
-        | relational_expression '<=' shift_expression
+		| relational_expression '<=' shift_expression
 		{ result = [ :OP_LE, val[0], val[2] ]  }
-        | relational_expression '>=' shift_expression
+		| relational_expression '>=' shift_expression
 		{ result = [ :OP_GE, val[0], val[2] ]  }
 
 equality_expression
-        : relational_expression
-        | equality_expression '==' relational_expression
+		: relational_expression
+		| equality_expression '==' relational_expression
 		{ result = [ :OP_EQ, val[0], val[2] ]  }
-        | equality_expression '!=' relational_expression
+		| equality_expression '!=' relational_expression
 		{ result = [ :OP_NE, val[0], val[2] ]  }
 
 and_expression
-        : equality_expression
-        | and_expression '&' equality_expression
+		: equality_expression
+		| and_expression '&' equality_expression
 		{ result = [ :OP_AND, val[0], val[2] ]  }
 
 exclusive_or_expression
-        : and_expression
-        | exclusive_or_expression '^' and_expression
+		: and_expression
+		| exclusive_or_expression '^' and_expression
 		{ result = [ :OP_EOR, val[0], val[2] ]  }
 
 inclusive_or_expression
-        : exclusive_or_expression
-        | inclusive_or_expression '|' exclusive_or_expression
+		: exclusive_or_expression
+		| inclusive_or_expression '|' exclusive_or_expression
 		{ result = [ :OP_OR, val[0], val[2] ]  }
 
 logical_and_expression
-        : inclusive_or_expression
-        | logical_and_expression '&&' inclusive_or_expression
+		: inclusive_or_expression
+		| logical_and_expression '&&' inclusive_or_expression
 		{ result = [ :OP_LAND, val[0], val[2] ]  }
 
 logical_or_expression
-        : logical_and_expression
-        | logical_or_expression '||' logical_and_expression
+		: logical_and_expression
+		| logical_or_expression '||' logical_and_expression
 		{ result = [ :OP_LOR, val[0], val[2] ]  }
 
 conditional_expression
-        : logical_or_expression
-        | logical_or_expression '?' expression ':' conditional_expression
+		: logical_or_expression
+		| logical_or_expression '?' expression ':' conditional_expression
 		{ result = [ :OP_CEX, val[0], val[2].get_elements, val[4] ]  }
 
-
-# コンマ演算子が使えない
+assignment_expression
+		: conditional_expression
+		| unary_expression assignment_operator assignment_expression
+
+assignment_operator
+		: '='
+		| '+='
+		| '-='
+		| '*='
+		| '/='
+		| '%='
+		| '<<='
+		| '>>='
+		| '&='
+		| '|='
+		| '^='
+
 expression
-        : conditional_expression
+		: assignment_expression
 		{
 			result = Expression.new( val[0] )
 			# result.print
 		}
+		| expression ',' assignment_expression
+		{
+			result = Expression.new( val[2] )    # ',' の後ろを採用
+		}
 
 constant_expression
-        : conditional_expression
+		: conditional_expression
 		{
 			result = Expression.new( val[0] )
@@ -218,6 +244,4 @@
 		}
 
-
-
 # Types
 ##########################  宣言  ##########################
@@ -227,62 +251,70 @@
 # K&Rとの違い: storage classが指定できない、型が省略できない
 declaration
-        : declaration_specifiers init_declarator_list ';'
-#        : type_specifier_qualifier_list init_declarator_list ';'
+		: declaration_specifiers init_declarator_list ';'
+#        : specifier_qualifier_list init_declarator_list ';'
 
 # declaration_specifiersは関数のパラメータで使われるが、
-# type_specifier_qualifier_listで十分かもしれない
+# specifier_qualifier_listで十分かもしれない
 
 declaration_specifiers
-        : storage_class
+		: storage_class_specifier
 		{
 			result = CIntType.new( -3 )    # storage class は無視
 		}
-        | type_specifier
-        | type_qualifier
+		| storage_class_specifier declaration_specifiers
+		{
+			result = val[1]                # storage class は無視
+		}
+		| type_specifier
+		| type_specifier declaration_specifiers
+		{
+			result = val[1].merge val[0]
+		}
+		| type_qualifier
 		{
 			result = CIntType.new( -3 )
 			result.set_qualifier val[0]
 		}
-        | storage_class declaration_specifiers
-		{
-			result = val[1]                # storage class は無視
-		}
-        | type_specifier declaration_specifiers
-		{
-			result = val[1].merge val[0]
-		}
-        | type_qualifier declaration_specifiers
+		| type_qualifier declaration_specifiers
 		{
 			val[1].set_qualifier val[0]
-                        result = val[1]
-		}
-
+						result = val[1]
+		}
+		| function_specifier
+		| function_specifier declaration_specifiers
 
 init_declarator_list
-        : init_declarator
+		: init_declarator
 		{ result = [val[0]] }
-        | init_declarator_list ',' init_declarator
+		| init_declarator_list ',' init_declarator
 		{ result << val[2] }
 
 init_declarator
-        : declarator
-        | declarator '=' initializer
+		: declarator
+		| declarator '=' initializer
 		{ val[0].set_initializer( val[2] ) }
 
+storage_class_specifier
+		: EXTERN
+		| STATIC
+		| AUTO
+		| REGISTER
+
 type_specifier
-        : VOID	{ set_no_type_name true; result = CVoidType.new }
-        | FLOAT	{ set_no_type_name true; result = CFloatType.new(-32) }
-        | DOUBLE	{ set_no_type_name true; result = CFloatType.new(-64) }
-        | BOOL	{ set_no_type_name true; result = CBoolType.new }
-        | struct_specifier	{ set_no_type_name true; result = val[0] } # set_no_type_name true は struct_tag でも呼ばれる
-        | union_specifier	{ set_no_type_name true; result = CVoidType.new }  # void が宣言されたとする
-        | enum_specifier	{ set_no_type_name true; result = CVoidType.new }  # void が宣言されたとする
-        | TYPE_NAME	{ set_no_type_name true; result = CDefinedType.new( val[0].val ) }
-
-        | CHAR	{ set_no_type_name true; result = CIntType.new(-11 ) }
-        | SHORT	{ set_no_type_name true; result = CIntType.new( -2 ) }
-        | INT		{ set_no_type_name true; result = CIntType.new( -3 ) }
-        | LONG	{ set_no_type_name true; result = CIntType.new( -4 ) }
-        | SIGNED
+		: VOID
+		{ set_no_type_name true; result = CVoidType.new }
+		| CHAR
+		{ set_no_type_name true; result = CIntType.new(-11 ) }
+		| SHORT
+		{ set_no_type_name true; result = CIntType.new( -2 ) }
+		| INT
+		{ set_no_type_name true; result = CIntType.new( -3 ) }
+		| LONG
+		{ set_no_type_name true; result = CIntType.new( -4 ) }
+		| FLOAT
+		{ set_no_type_name true; result = CFloatType.new(-32) }
+		| DOUBLE
+		{ set_no_type_name true; result = CFloatType.new(-64) }
+		| SIGNED
 		{
 			set_no_type_name true
@@ -290,5 +322,5 @@
 			result.set_sign :SIGNED
 		}
-        | UNSIGNED
+		| UNSIGNED
 		{
 			set_no_type_name true
@@ -296,11 +328,21 @@
 			result.set_sign :UNSIGNED
 		}
+		| BOOL
+		{ set_no_type_name true; result = CBoolType.new }
+		| struct_specifier
+		{ set_no_type_name true; result = val[0] } # set_no_type_name true は struct_tag でも呼ばれる
+		| union_specifier
+		{ set_no_type_name true; result = CVoidType.new }  # void が宣言されたとする
+		| enum_specifier
+		{ set_no_type_name true; result = CVoidType.new }  # void が宣言されたとする
+		| TYPE_NAME
+		{ set_no_type_name true; result = CDefinedType.new( val[0].val ) }
 
 # mikan K&Rのstruct_or_union_specifierに相当するが、unionは使えない, bit field にも対応しない
 struct_specifier		# mikan
 #        : STRUCT struct_tag '{'
-        : struct_term struct_tag '{'
+		: struct_term struct_tag '{'
 		{ StructType.set_define( true )  }
-	   struct_declaration_list '}'
+		struct_declaration_list '}'
 		{
 			StructType.end_of_parse
@@ -308,10 +350,10 @@
 		}
 #        | STRUCT
-        | struct_term
+		| struct_term
 		{
 			result = CStructType.new()
 			StructType.set_define( true )
 		}
-	   '{' struct_declaration_list '}'
+		'{' struct_declaration_list '}'
 		{
 			StructType.end_of_parse
@@ -319,5 +361,5 @@
 		}
 #        | STRUCT struct_tag   # mikan struct_tag は namespace 対応が必要
-        | struct_term struct_tag   # mikan struct_tag は namespace 対応が必要
+		| struct_term struct_tag   # mikan struct_tag は namespace 対応が必要
 		{
 			StructType.set_define( false )
@@ -327,12 +369,12 @@
 
 struct_term
-        : STRUCT { set_no_type_name true }
+		: STRUCT { set_no_type_name true }
 
 struct_declaration_list
-        : struct_declaration
-        | struct_declaration_list struct_declaration
+		: struct_declaration
+		| struct_declaration_list struct_declaration
 
 struct_tag:
-        IDENTIFIER
+		IDENTIFIER
 		{
 			result = CStructType.new( val[0].val )
@@ -342,6 +384,6 @@
 # ポインタ修飾子を追加
 struct_declaration
-        : declaration_specifiers struct_declarator_list ';'
-#        :                                type_specifier_qualifier_list struct_declarator_list ';'
+		: declaration_specifiers struct_declarator_list ';'
+#        :                                specifier_qualifier_list struct_declarator_list ';'
 		{
 			val[1].each { |i|	# i: Decl
@@ -353,6 +395,17 @@
 			result = val[1]
 		}
-        | union_specifier ';'                       # 無名
-        | struct_specifier ';'                       # 無名
+		# ビットフィールドを読み飛ばし
+		| declaration_specifiers struct_declarator_list ':' constant_expression ';'
+		{
+			val[1].each { |i|	# i: Decl
+				i.set_type( val[0] )
+				i.set_kind( :MEMBER )
+				i.check
+				CStructType.new_member( i )
+			}
+			result = val[1]
+		}
+		| union_specifier ';'                       # 無名
+		| struct_specifier ';'                       # 無名
 
 
@@ -360,32 +413,32 @@
 # K&Rのspecifier_qualifier_listと同じ
 # 名前がまぎらわしかったのでtype_を付けた
-type_specifier_qualifier_list
-        : type_specifier
-        | type_specifier type_specifier_qualifier_list
+specifier_qualifier_list
+		: type_specifier specifier_qualifier_list
 		{
 			result = val[1].merge val[0]
 		}
-        | type_qualifier
+		| type_specifier
+		| type_qualifier specifier_qualifier_list
+		{
+			val[1].set_qualifier val[0]
+						result = val[1]
+		}
+		| type_qualifier
 		{
 			result = CIntType.new( -3 )
 			result.set_qualifier val[0]
 		}
-        | type_qualifier type_specifier_qualifier_list
-		{
-			val[1].set_qualifier val[0]
-                        result = val[1]
-		}
 
 struct_declarator_list
-        : struct_declarator
+		: struct_declarator
 		{ result = [ val[0] ] }
-        | struct_declarator_list ',' struct_declarator
+		| struct_declarator_list ',' struct_declarator
 		{ result << val[2] }
 
 # ビットフィールドは使えない
 struct_declarator
-        : declarator
-
-
+		: declarator
+#		| ':' constant_expression
+#		| declarator ':' constant_expression
 
 union_specifier
@@ -393,14 +446,14 @@
 #        | UNION '{' union_declaration_list '}'
 #        | UNION union_tag   # mikan struct_tag は namespace 対応が必要
-        : union_term union_tag '{' union_declaration_list '}'
-        | union_term '{' union_declaration_list '}'
-        | union_term union_tag   # mikan struct_tag は namespace 対応が必要
+		: union_term union_tag '{' union_declaration_list '}'
+		| union_term '{' union_declaration_list '}'
+		| union_term union_tag   # mikan struct_tag は namespace 対応が必要
 
 union_term
-        : UNION { set_no_type_name true }
+		: UNION { set_no_type_name true }
 
 union_declaration_list
-        : union_declaration
-        | union_declaration_list union_declaration
+		: union_declaration
+		| union_declaration_list union_declaration
 
 union_tag:
@@ -408,52 +461,56 @@
 
 union_declaration
-        : declaration_specifiers union_declarator_list ';'
+		: declaration_specifiers union_declarator_list ';'
 		| union_specifier ';'                       # 無名
 		| struct_specifier ';'                      # 無名
 
 union_declarator_list
-        : union_declarator
-        | union_declarator_list ',' union_declarator
-
-# ビットフィールドは使えない
+		: union_declarator
+		| union_declarator_list ',' union_declarator
+
 union_declarator
-        : declarator
-
-
-
-# enumの種類を追加
-enum_specifier		# mikan
-        : enum_type            '{' enumerator_list '}'
-        | enum_type IDENTIFIER '{' enumerator_list '}'
-        | enum_type IDENTIFIER
-
-enum_type
-        : ENUM	{ result = CEnumType.new( -1 ) }
-#        | ENUM8	{ result = CEnumType.new( 8 ) }
-#        | ENUM16	{ result = CEnumType.new( 16 ) }
-#        | ENUM32	{ result = CEnumType.new( 32 ) }
-#        | ENUM64	{ result = CEnumType.new( 64 ) }
-#        | ENUM128	{ result = CEnumType.new( 128 ) }
+		: declarator
+		| ':' constant_expression
+		| declarator ':' constant_expression
+
+enum_specifier
+		: ENUM '{' enumerator_list '}'
+		| ENUM IDENTIFIER '{' enumerator_list '}'
+		| ENUM '{' enumerator_list ',' '}'
+		| ENUM IDENTIFIER '{' enumerator_list ',' '}'
+		| ENUM IDENTIFIER
+		| ENUM TYPE_NAME '{' enumerator_list '}'
+		| ENUM TYPE_NAME '{' enumerator_list ',' '}'
+		| ENUM TYPE_NAME
 
 enumerator_list
-        : enumerator
-        | enumerator_list ',' enumerator
+		: enumerator
+		| enumerator_list ',' enumerator
 
 enumerator
-        : IDENTIFIER
-        | IDENTIFIER '=' constant_expression
+		: IDENTIFIER
+		| IDENTIFIER '=' constant_expression
 
 type_qualifier
-        : CONST	{ result = :CONST }
-        | VOLATILE	{ result = :VOLATILE }
+		: CONST
+		{ result = :CONST }
+		| RESTRICT
+		| VOLATILE
+		{ result = :VOLATILE }
+
+function_specifier
+		: __INLINE__
+		| INLINE
+		| __INLINE
+		| CINLINE
 
 declarator
-        : pointer direct_declarator
+		: pointer direct_declarator
 		{
 			val[1].set_type( val[0] )
 			result = val[1]
 		}
-        | direct_declarator
-        | pointer TYPE_NAME     # 関数ポインタの typedef が二重定義の場合
+		| direct_declarator
+		| pointer TYPE_NAME     # 関数ポインタの typedef が二重定義の場合
 		{
 			result = Decl.new( val[1].val )
@@ -462,19 +519,19 @@
 
 direct_declarator		# mikan
-        : IDENTIFIER
+		: IDENTIFIER
 		{ result = Decl.new( val[0].val ) }
-        | '(' declarator ')'
+		| '(' declarator ')'
 		{ result = val[1] }
-        | direct_declarator '[' constant_expression ']'
+		| direct_declarator '[' constant_expression ']'
 		{
 			val[0].set_type( CArrayType.new( val[2] ) )
 			result = val[0]
 		}
-        | direct_declarator '[' ']'
+		| direct_declarator '[' ']'
 		{
 			val[0].set_type( CArrayType.new )
 			result = val[0]
 		}
-        | direct_declarator '(' parameter_type_list ')'
+		| direct_declarator '(' parameter_type_list ')'
 		{
 		# 	Generator.warning( "W6001 need 'void' for no parameter"  )
@@ -482,7 +539,6 @@
 			result = val[0]
 		}
-
-#        | direct_declarator '(' identifier_list ')'  # これは何のために必要？ 060211
-        | direct_declarator '(' ')'
+		| direct_declarator '(' identifier_list ')'  # これは何のために必要？ 060211
+		| direct_declarator '(' ')'
 		{
 		# 	Generator.warning( "W6002 need 'void' for no parameter"  )
@@ -492,17 +548,17 @@
 
 pointer
-        : '*'
+		: '*'
 		{ result = CPtrType.new }
-        | '*' type_qualifier
+		| '*' type_qualifier_list
 		{
 			result = CPtrType.new
 			result.set_qualifier( val[1] )
 		}
-        | '*' pointer
+		| '*' pointer
 		{
 			val[1].set_type(CPtrType.new)
 			result = val[1]
 		}
-        | '*' type_qualifier pointer
+		| '*' type_qualifier_list pointer
 		{
 			ptrtype = CPtrType.new
@@ -512,14 +568,17 @@
 		}
 
+type_qualifier_list
+		: type_qualifier
+		| type_qualifier_list type_qualifier
 
 parameter_type_list
-        : parameter_list
-        | parameter_list ',' '.' '.' '.'
+		: parameter_list
+		| parameter_list ',' '.' '.' '.'
 		# mikan 可変長パラメータ,  ... の間のスペースが許される（手抜き）
 
 parameter_list
-        : parameter_declaration
+		: parameter_declaration
 #		{ result = ParamList.new( val[0] ) }
-        | parameter_list ',' parameter_declaration
+		| parameter_list ',' parameter_declaration
 #		{
 #			val[0].add_param( val[2] )
@@ -530,5 +589,5 @@
 # パラメータ修飾子を追加
 parameter_declaration
-        : declaration_specifiers declarator
+		: declaration_specifiers declarator
 #		{
 #			decl = ParamDecl.new( val[1], val[0], [] )
@@ -545,55 +604,55 @@
 #			result = nil
 #		}
-        | declaration_specifiers abstract_declarator	# 仮引数なし
-        | declaration_specifiers						# 仮引数なし
-
-
-#identifier_list       # 060211  不用になった
-#        : IDENTIFIER
-#        | identifier_list ',' IDENTIFIER
+		| declaration_specifiers abstract_declarator	# 仮引数なし
+		| declaration_specifiers						# 仮引数なし
+
+
+identifier_list       # 060211  不用になった
+        : IDENTIFIER
+        | identifier_list ',' IDENTIFIER
 
 type_name
-        : type_specifier_qualifier_list
-        | type_specifier_qualifier_list abstract_declarator
+		: specifier_qualifier_list
+		| specifier_qualifier_list abstract_declarator
 
 abstract_declarator		# mikan
-        : pointer
-        | direct_abstract_declarator
-        | pointer direct_abstract_declarator
+		: pointer
+		| direct_abstract_declarator
+		| pointer direct_abstract_declarator
 
 direct_abstract_declarator
-        : '(' abstract_declarator ')'
-        | '[' ']'
-        | '[' constant_expression ']'
-        | direct_abstract_declarator '[' ']'
-        | direct_abstract_declarator '[' constant_expression ']'
-        | '(' ')'
+		: '(' abstract_declarator ')'
+		| '[' ']'
+		| '[' assignment_expression ']'
+		| direct_abstract_declarator '[' ']'
+		| direct_abstract_declarator '[' assignment_expression ']'
+		| '(' ')'
 		{
 			Generator.warning( "W6003 need 'void' for no parameter"  )
 		}
-        | '(' parameter_type_list ')'
-        | direct_abstract_declarator '(' ')'
+		| '(' parameter_type_list ')'
+		| direct_abstract_declarator '(' ')'
 		{
 			Generator.warning( "W6004 need 'void' for no parameter"  )
 		}
-        | direct_abstract_declarator '(' parameter_type_list ')'
+		| direct_abstract_declarator '(' parameter_type_list ')'
 
 # assignment_expressionをconstant_expressionに変更
 initializer			# mikan
-        : constant_expression
+		: assignment_expression
 		{ result = val[0] }
-        | '{' initializer_list '}'
+		| '{' initializer_list '}'
 		{ result = val[1] }
-        | '{' initializer_list ',' '}'
+		| '{' initializer_list ',' '}'
 		{ result = val[1] }
-	| C_EXP '(' STRING_LITERAL ')'
+		| C_EXP '(' STRING_LITERAL ')'
 		{ result = C_EXP.new( val[2] ) }
 
 initializer_list
-        : initializer
+		: initializer
 		{
 			result = [ val[0] ]
 		}
-        | initializer_list ',' initializer
+		| initializer_list ',' initializer
 		{
 			val[0] << val[2]
@@ -606,22 +665,22 @@
 #トップレベルの構文規則
 C_parser
-        :
-        | C_parser extension_statement
+		:
+		| C_parser extension_statement
 
 extension_statement
-        : statement
-        | EXTENSION statement
-
-statement
-        : typedef
-        | func_def
-        | enum_specifier ';'
-        | struct_specifier ';'
-        | declaration
-        | ';'
-        | error   # エラー回復ポイント
+		: cdl_statement
+		| EXTENSION cdl_statement
+
+cdl_statement
+		: typedef
+		| func_def
+		| enum_specifier ';'
+		| struct_specifier ';'
+		| declaration
+		| ';'
+		| error   # エラー回復ポイント
 
 typedef
-        : TYPEDEF type_specifier_qualifier_list declarator_list ';'
+        : TYPEDEF specifier_qualifier_list declarator_list ';'
 		{
 			val[2].each{ |i|
@@ -633,384 +692,389 @@
 
 declarator_list
-        : declarator
+		: declarator
 		{ result = [ val[0] ] }
-        | declarator_list ',' declarator
+		| declarator_list ',' declarator
 		{ result << val[2] }
 
 func_def
-        : declaration_specifiers declarator compoundstatement
-
-infunc_statement_list
-        :
-        | infunc_statement_list infunc_statement
-
-infunc_statement
-        : declaration
-        | ifstatement
-        | whilestatement
-        | dowhilestatement
-        | forstatement
-        | switchstatement
-        | labelstatement
-        | compoundstatement
-        | gotostatement
-        | expressionstatement
-        | ';'
+		: declaration_specifiers declarator compound_statement
+
+statement
+		: labeled_statement
+		| compound_statement
+		| expression_statement
+		| ifstatement
+		| whilestatement
+		| dowhilestatement
+		| forstatement
+		| switchstatement
+		| jump_statement
+		| asm_statement
+
+labeled_statement
+		: IDENTIFIER ':' statement
+		| CASE constant_expression ':' statement
+		| DEFAULT ':' statement
+
+compound_statement
+		: '{' '}'
+		| '{' block_item_list '}'
+
+block_item_list
+		: block_item
+		| block_item_list block_item
+
+block_item
+		: declaration
+		| statement
+
+expression_statement
+		: ';'
+		| expression ';'
 
 ifstatement
-        : IF '(' expression ')' infunc_statement
-        | IF '(' expression ')' infunc_statement ELSE infunc_statement
+		: IF '(' expression ')' statement
+		| IF '(' expression ')' statement ELSE statement
+
+switchstatement
+		: SWITCH '(' expression ')' compound_statement
 
 whilestatement
-        : WHILE '(' expression ')' infunc_statement
+		: WHILE '(' expression ')' statement
 
 dowhilestatement
-        : DO infunc_statement WHILE '(' expression ')' ';'
+		: DO statement WHILE '(' expression ')' ';'
 
 forstatement
-        : FOR '(' expression ';' expression ';' expression ')' infunc_statement
-
-switchstatement
-        : SWITCH '(' expression ')'  infunc_statment
-
-labelstatement
-        : IDENTIFIER ':' infunc_statement
-        | CASE constant_expression ':' infunc_statement
-        | DEFAULT ':' infunc_statement
-
-compoundstatement
-        : '{' infunc_statement_list '}'
-
-gotostatement
-        : GOTO IDENTIFIER ';'
-        | CONTINUE ';'
-        | BREAK ';'
-        | RETURN expression ';'
-        | RETURN ';'
-
-expressionstatement
-        : expression ';'
-        | unary_expression assignment_operator expression ';'
-
-assignment_operator
-        : '='
-        | '+='
-        | '-='
-        | '*='
-        | '/='
-        | '%='
-        | '<<='
-        | '>>='
-        | '&='
-        | '|='
-        | '^='
-
-storage_class
-        : __INLINE__
-        | INLINE
-        | __INLINE
-        | CINLINE
-        | EXTERN
-        | STATIC
-        | AUTO
-        | REGISTER
+		: FOR '(' expression_statement expression_statement ')' statement
+		| FOR '(' expression_statement expression_statement expression ')' statement
+		| FOR '(' declaration expression_statement ')' statement
+		| FOR '(' declaration expression_statement expression ')' statement
+
+jump_statement
+		: GOTO IDENTIFIER ';'
+		| CONTINUE ';'
+		| BREAK ';'
+		| RETURN ';'
+		| RETURN expression ';'
 
 namespace_identifier
-        : IDENTIFIER		{ result = NamespacePath.new( val[0].val, false ) }
-        | '::' IDENTIFIER	{ result = NamespacePath.new( val[1].val, true ) }
-        | namespace_identifier '::' IDENTIFIER
+		: IDENTIFIER		{ result = NamespacePath.new( val[0].val, false ) }
+		| '::' IDENTIFIER	{ result = NamespacePath.new( val[1].val, true ) }
+		| namespace_identifier '::' IDENTIFIER
 		{ result = val[0].append!( val[2].val ) }
 
+asm_statement
+		: _ASM {
+		while true
+			# ';' が表れるまで、トークンを読み飛ばす。
+			# gcc の構文拡張に対応すべきだが、単純な実装として、';' まで読み飛ばす。
+			# トークン単位で読み飛ばしているので、文字列やコメント内の ';' は対象にならない。
+			token = next_token
+			if token[1].val == ";"
+				break
+			end
+			# p "skip: #{token[1].val}" 
+		end
+		}
+
 end
 
 ---- inner
 
-  RESERVED = {
-    # keyword
-    'typedef' => :TYPEDEF,
-    'struct' => :STRUCT,
-    'union' => :UNION,
-    'sizeof' => :SIZEOF,
-    'throw' => :THROW,
-
-    # specifier
-    # types
-    'void'    => :VOID,
-    'char'    => :CHAR,
-    'short'   => :SHORT,
-
-    'volatile'=> :VOLATILE,
-    'const'   => :CONST,
-    'extern'   => :EXTERN,
-
-    'long'    => :LONG,
-    'float'   => :FLOAT,
-    'double'  => :DOUBLE,
-    'signed'  => :SIGNED,
-    'unsigned'=> :UNSIGNED,
-
-    'int'     => :INT,
-    'enum'    => :ENUM,
-
-    'if'      => :IF,
-    'else'    => :ELSE,
-    'while'   => :WHILE,
-    'do'      => :DO,
-    'for'     => :FOR,
-    'case'    => :CASE,
-    'default' => :DEFAULT,
-    'goto'    => :GOTO,
-    'continue' => :CONTINUE,
-    'break'   => :BREAK,
-    'return'  => :RETURN,
-    '__inline__'  => :__INLINE__,
-    'inline'  => :INLINE,
-    '__inline'  => :__INLINE,
-    'Inline'  => :CINLINE,        # inline starting with Capital letter
-    'static'  => :STATIC,
-    'register' => :REGISTER,
-    'auto'    => :AUTO,
-    '__extension__'    => :EXTENSION,
-
-  }
-
-  @@generator_nest = -1
-  @@generator_stack = []
-  @@current_locale = []
-
-  def finalize
-
-    # mikan Namespace.pop
-    Celltype.pop
-    Cell.pop
-    CompositeCelltype.pop
-    Region.pop
-
-  end
-
-  def set_plugin( plugin )
-    @plugin = plugin
-  end
-
-  def self.get_plugin
-    @@generator_stack[@@generator_nest].get_plugin
-  end
-
-  def get_plugin
-    @plugin
-  end
-
-  def parse(files)
-
-    # mikan Namespace.push
-    Celltype.push
-    Cell.push
-    CompositeCelltype.push
-    Region.push
-
-    @@generator_nest += 1
-    @@generator_stack[@@generator_nest] = self
-    @b_no_type_name = false
-
-   begin
-
-    @q = []
-    comment = false
-
-    # euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策
-    TECS_LANG::set_kcode_binary
-
-    # 800U, 0xffLL など (整数リテラルに共通の修飾子)
-    integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?"
-
-    files.each {|file|
-      lineno = 1
-     begin
-#2.0       IO.foreach(file) {|line|
-       TECSIO.foreach(file) {|line|
-        col = 1
-        line.rstrip!
-
-        until line.empty?
-
-          if comment
-            case line
-            # コメント終了
-            when /\A\*\//
-              comment = false
-            when /\A./
-              ;
-            end
-          else
-            case line
-            # 空白、プリプロセスディレクティブ
-            when /\A\s+/
-              ;
-            # 識別子
-            when /\A[a-zA-Z_]\w*/
-              word = $&
-              @q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)]
-            # 16 進数定数
-            when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/
-              @q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)]
-            # 8 進数定数
-            when /\A0[0-7]+#{integer_qualifier}/
-              @q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)]
-            # 浮動小数定数
-            when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/
-              @q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)]
-            # 整数定数
-            when /\A\d+#{integer_qualifier}/
-            # when /\A\d+/
-              @q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)]
-            # 文字
-            when /\A'(?:[^'\\]|\\.)'/
-              @q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)]
-            # 文字列
-#              "#include  #include #include \"../systask/logtask.cfg\"       最後の " 忘れ)で無限ループ
-#            when /\A"(?:[^"\\]+|\\.)*"/
-            when /\A"(?:[^"\\]|\\.)*"/   # これはうまく行くようだ
-              @q << [:STRING_LITERAL, Token.new($&, file, lineno, col)]
-            # 行コメント
-            when /\A\/\/.*$/
-              # 読み飛ばすだけ
-            # コメント開始
-            when /\A\/\*/
-              comment = true
-            when /\A>>=/, /\A<<=/, /\A>>/,  /\A<</
-              @q << [$&, Token.new($&, file, lineno, col)]
-            when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/
-              @q << [$&, Token.new($&, file, lineno, col)]
-            when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/
-              @q << [$&, Token.new($&, file, lineno, col)]
-            when /\A./
-              @q << [$&, Token.new($&, file, lineno, col)]
-            else
-              raise
-            end
-          end
-
-          line = $'
-          col += $&.length
-        end
-
-        lineno += 1
-      }
-
-     rescue => evar
-       Generator.error( "B1002 while open or reading \'$1\'" , file )
-       print_exception( evar )
-     end
-    }
-
-    # 終了の印
-    @q << nil
-
-    @yydebug = true
-    do_parse
-
-   ensure
-    @@generator_nest -= 1
-    TECS_LANG::reset_kcode
-   end
-
-  end
-
-
-  def next_token
-    token = @q.shift
-
-    if token then
-      @@current_locale[@@generator_nest] = token[1].locale
-
-      case token[1].val
-      when ";", ":", ",", "(", ")", "{", "}"
-        set_no_type_name false
-      when ".", "->"
-        set_no_type_name true
-      end
-
-      # TYPE_NAME トークンへ置き換え
-      if @b_no_type_name == false
-        if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then
-          token[0] = :TYPE_NAME
-          locale = @@current_locale[@@generator_nest]
+	RESERVED = {
+		# keyword
+		'typedef' => :TYPEDEF,
+		'struct' => :STRUCT,
+		'union' => :UNION,
+		'sizeof' => :SIZEOF,
+		'throw' => :THROW,
+
+		# specifier
+		# types
+		'void'    => :VOID,
+		'char'    => :CHAR,
+		'short'   => :SHORT,
+
+		'volatile'=> :VOLATILE,
+		'restrict'=> :RESTRICT,
+		'const'   => :CONST,
+		'extern'   => :EXTERN,
+
+		'long'    => :LONG,
+		'float'   => :FLOAT,
+		'double'  => :DOUBLE,
+		'signed'  => :SIGNED,
+		'unsigned'=> :UNSIGNED,
+
+		'int'     => :INT,
+		'enum'    => :ENUM,
+
+		'if'      => :IF,
+		'else'    => :ELSE,
+		'while'   => :WHILE,
+		'do'      => :DO,
+		'for'     => :FOR,
+		'switch'  => :SWITCH,
+		'case'    => :CASE,
+		'default' => :DEFAULT,
+		'goto'    => :GOTO,
+		'continue' => :CONTINUE,
+		'break'   => :BREAK,
+		'return'  => :RETURN,
+		'__inline__'  => :__INLINE__,
+		'inline'  => :INLINE,
+		'__inline'  => :__INLINE,
+		'Inline'  => :CINLINE,        # inline starting with Capital letter
+		'static'  => :STATIC,
+		'register' => :REGISTER,
+		'auto'    => :AUTO,
+		'__extension__'    => :EXTENSION,
+		'__asm__' => :_ASM,
+		'asm' =>     :_ASM
+
+	}
+
+	@@generator_nest = -1
+	@@generator_stack = []
+	@@current_locale = []
+
+	def finalize
+
+		# mikan Namespace.pop
+		Celltype.pop
+		Cell.pop
+		CompositeCelltype.pop
+		Region.pop
+
+	end
+
+	def set_plugin( plugin )
+		@plugin = plugin
+	end
+
+	def self.get_plugin
+		@@generator_stack[@@generator_nest].get_plugin
+	end
+
+	def get_plugin
+		@plugin
+	end
+
+	def parse(files)
+
+		# mikan Namespace.push
+		Celltype.push
+		Cell.push
+		CompositeCelltype.push
+		Region.push
+
+		@@generator_nest += 1
+		@@generator_stack[@@generator_nest] = self
+		@b_no_type_name = false
+
+	begin
+
+		@q = []
+		comment = false
+#		b_asm   = false
+
+		# euc のコメントを utf8 として扱うと、コメントの終わりを誤る問題の対策
+		TECS_LANG::set_kcode_binary
+
+		# 800U, 0xffLL など (整数リテラルに共通の修飾子)
+		integer_qualifier = "([Uu][Ll][Ll]|[Uu][Ll]|[Uu]|[Ll][Ll]|[Ll])?"
+
+		files.each {|file|
+			lineno = 1
+		begin
+#2.0		IO.foreach(file) {|line|
+			TECSIO.foreach(file) {|line|
+			col = 1
+			line.rstrip!
+
+			until line.empty?
+
+				if comment
+					case line
+					# コメント終了
+					when /\A\*\//
+						comment = false
+					when /\A./
+						;
+					end
+				else
+					case line
+					# 空白、プリプロセスディレクティブ
+					when /\A\s+/
+						;
+					# 識別子
+					when /\A[a-zA-Z_]\w*/
+						word = $&
+						@q << [RESERVED[word] || :IDENTIFIER, Token.new(word.intern, file, lineno, col)]
+					# 16 進数定数
+					when /\A0x[0-9A-Fa-f]+#{integer_qualifier}/
+						@q << [:HEX_CONSTANT, Token.new($&, file, lineno, col)]
+					# 8 進数定数
+					when /\A0[0-7]+#{integer_qualifier}/
+						@q << [:OCTAL_CONSTANT, Token.new($&, file, lineno, col)]
+					# 浮動小数定数
+					when /\A[0-9]+\.([0-9]*)?([Ee][+-]?[0-9]+)?/
+						@q << [:FLOATING_CONSTANT, Token.new($&, file, lineno, col)]
+					# 整数定数
+					when /\A\d+#{integer_qualifier}/
+					# when /\A\d+/
+						@q << [:INTEGER_CONSTANT, Token.new($&.to_i, file, lineno, col)]
+					# 文字
+					when /\A'(?:[^'\\]|\\.)'/
+						@q << [:CHARACTER_LITERAL, Token.new($&, file, lineno, col)]
+					# 文字列
+#					"#include  #include #include \"../systask/logtask.cfg\"       最後の " 忘れ)で無限ループ
+#					when /\A"(?:[^"\\]+|\\.)*"/
+					when /\A"(?:[^"\\]|\\.)*"/   # これはうまく行くようだ
+						@q << [:STRING_LITERAL, Token.new($&, file, lineno, col)]
+					# 行コメント
+					when /\A\/\/.*$/
+						# 読み飛ばすだけ
+					# コメント開始
+					when /\A\/\*/
+						comment = true
+					when /\A>>=/, /\A<<=/, /\A>>/,  /\A<</
+						@q << [$&, Token.new($&, file, lineno, col)]
+					when /\A\+=/, /\A\-=/, /\A\*=/, /\A\/=/, /\A%=/, /\A&=/, /\A\|=/, /\A\^=/
+						@q << [$&, Token.new($&, file, lineno, col)]
+					when /\A::/, /\A==/, /\A!=/, /\A>=/, /\A<=/, /\A\->/, /\A\+\+/, /\A\-\-/
+						@q << [$&, Token.new($&, file, lineno, col)]
+					when /\A\|\|/, /\A\&\&/
+						@q << [$&, Token.new($&, file, lineno, col)]
+					when /\A./
+						@q << [$&, Token.new($&, file, lineno, col)]
+					else
+						raise
+					end
+				end
+
+				line = $'
+				col += $&.length
+			end
+
+			lineno += 1
+		}
+
+		rescue => evar
+			Generator.error( "B1002 while open or reading \'$1\'" , file )
+			print_exception( evar )
+		end
+	}
+
+	# 終了の印
+	@q << nil
+
+	@yydebug = true
+	do_parse
+
+	ensure
+		@@generator_nest -= 1
+		TECS_LANG::reset_kcode
+	end
+
+	end
+
+
+	def next_token
+		token = @q.shift
+
+		if token then
+			@@current_locale[@@generator_nest] = token[1].locale
+
+			case token[1].val
+			when ";", ":", ",", "(", ")", "{", "}"
+			set_no_type_name false
+			when ".", "->"
+			set_no_type_name true
+			end
+
+			# TYPE_NAME トークンへ置き換え
+			if @b_no_type_name == false
+				if token[0] == :IDENTIFIER && Namespace.is_typename?( token[1].val ) then
+					token[0] = :TYPE_NAME
+					locale = @@current_locale[@@generator_nest]
 #print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}: type_name'\n" )
-        end
-      end
-
-      if $debug then     # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生) 
-        locale = @@current_locale[@@generator_nest]
-        if token then
-          print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" )
-        else
-          print( "#{locale[0]}: line #{locale[1]} : EOF\n" )
-        end
-      end
-    end
-
-    token
-  end
-
-  def on_error(t, v, vstack)
-    if v == "$" then
-     Generator.error( "B1003 Unexpected EOF"  )
-    else
-     Generator.error( "B1004 syntax error near \'$1\'" , v.val )
-    end
-
-  end
-
-  def self.current_locale
-    @@current_locale[ @@generator_nest ]
-  end
-
-  @@n_error = 0
-  @@n_warning = 0
-  @@n_info = 0
-
-  # このメソッドは構文解析、意味解析からのみ呼出し可（コード生成でエラー発生は不適切）
-  def self.error( msg )
-    @@n_error += 1
-    locale = @@current_locale[ @@generator_nest ]
-
-    if locale then
-      Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
-    else
-      Console.puts "error: #{msg}"
-    end
-  end
-
-  # このメソッドは構文解析、意味解析からのみ呼出し可（コード生成でウォーニング発生は不適切）
-  def self.warning( msg )
-    @@n_warning += 1
-    locale = @@current_locale[ @@generator_nest ]
-    Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
-  end
-
-  # このメソッドは構文解析、意味解析からのみ呼出し可
-  def self.info( msg )
-    @@n_info += 1
-    locale = @@current_locale[ @@generator_nest ]
-    Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
-  end
-
-  def self.get_n_error
-    @@n_error
-  end
-
-  def self.get_n_warning
-    @@n_warning
-  end
-
-  def self.get_nest
-    @@generator_nest
-  end
-
-  def set_no_type_name b_no_type_name
-    locale = @@current_locale[ @@generator_nest ]
+				end
+			end
+
+			if $debug then     # 070107 token 無効時ここを通さないようした (through 対応 -d の時に例外発生) 
+				locale = @@current_locale[@@generator_nest]
+				if token then
+					print( "#{locale[0]}: line #{locale[1]} : #{token[0]} '#{token[1].val}'\n" )
+				else
+					print( "#{locale[0]}: line #{locale[1]} : EOF\n" )
+				end
+			end
+		end
+
+		token
+	end
+
+	def on_error(t, v, vstack)
+		if v == "$" then
+			Generator.error( "B1003 Unexpected EOF"  )
+		else
+			Generator.error( "B1004 syntax error near \'$1\'" , v.val )
+		end
+
+	end
+
+	def self.current_locale
+		@@current_locale[ @@generator_nest ]
+	end
+
+	@@n_error = 0
+	@@n_warning = 0
+	@@n_info = 0
+
+	# このメソッドは構文解析、意味解析からのみ呼出し可（コード生成でエラー発生は不適切）
+	def self.error( msg )
+		@@n_error += 1
+		locale = @@current_locale[ @@generator_nest ]
+
+		if locale then
+			Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
+		else
+			Console.puts "error: #{msg}"
+		end
+	end
+
+	# このメソッドは構文解析、意味解析からのみ呼出し可（コード生成でウォーニング発生は不適切）
+	def self.warning( msg )
+		@@n_warning += 1
+		locale = @@current_locale[ @@generator_nest ]
+		Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
+	end
+
+	# このメソッドは構文解析、意味解析からのみ呼出し可
+	def self.info( msg )
+		@@n_info += 1
+		locale = @@current_locale[ @@generator_nest ]
+		Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
+	end
+
+	def self.get_n_error
+		@@n_error
+	end
+
+	def self.get_n_warning
+		@@n_warning
+	end
+
+	def self.get_nest
+		@@generator_nest
+	end
+
+	def set_no_type_name b_no_type_name
+		locale = @@current_locale[ @@generator_nest ]
 #print "b_no_type_name=#{b_no_type_name} #{locale[0]}: line #{locale[1]}\n"
-    @b_no_type_name = b_no_type_name
-  end
+		@b_no_type_name = b_no_type_name
+	end
 
 ---- footer
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.tab.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.tab.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.tab.rb	(revision 374)
@@ -284,5 +284,5 @@
                   string += line
                   # この位置では error メソッドは使えない (token 読出し前)
-                  puts "error: #{file} line #{lineno}: string literal has newline without escape"
+                  puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape"
                   @@n_error += 1
                 end
@@ -325,8 +325,9 @@
                   b_in_string = true
                   # この位置では error メソッドは使えない (token 読出し前) # mikan cdl_error ではない
-                  puts "error: #{file} line #{lineno}: string literal has newline without escape"
+                  puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape"
                   @@n_error += 1
                 # 山括弧で囲まれた文字列
-                when /\A<[0-9A-Za-z_\. \/]+>/   # AB: angle bracke
+                # when /\A<[0-9A-Za-z_\. \/]+>/   # AB: angle bracke
+                when /\A<(?:[^>\\]|\\.)*>/   # これはうまく行くようだ
                   @q << [:AB_STRING_LITERAL, Token.new($&, file, lineno, col)]
                 # 行コメント
@@ -458,5 +459,5 @@
       end
       if locale then
-        Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
+        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: error: #{msg}"
       else
         Console.puts "error: #{msg}"
@@ -491,5 +492,5 @@
       end
       if locale then
-        Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
+        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: warning: #{msg}"
       else
         Console.puts "warning: #{msg}"
@@ -524,5 +525,5 @@
       end
       if locale then
-        Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
+        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: info: #{msg}"
       else
         Console.puts "info: #{msg}"
@@ -589,176 +590,176 @@
 
 clist = [
-'66,575,328,666,538,872,78,330,562,328,78,78,78,163,199,200,201,202,203',
-'204,205,207,846,208,678,700,897,135,647,212,213,214,215,216,217,218',
-'679,249,761,711,565,547,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
+'66,575,328,559,538,815,78,330,869,328,78,78,78,409,199,200,201,202,203',
+'204,205,207,846,208,678,135,897,135,647,212,213,214,215,216,217,218',
+'249,679,177,872,870,408,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
 '25,26,27,28,29,30,31,32,33,34,35,38,465,189,693,333,334,42,43,44,45',
-'46,47,48,49,896,180,644,256,559,177,815,163,135,189,135,135,135,135',
-'189,66,189,189,70,68,69,135,71,72,328,73,78,74,304,305,324,860,901,189',
-'255,162,325,136,327,189,75,75,75,76,77,77,77,135,88,189,189,189,189',
-'79,87,101,80,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
-'29,30,31,32,33,34,35,38,78,426,569,668,899,42,43,44,45,46,47,48,49,189',
-'178,189,136,66,136,136,136,136,256,135,446,89,100,78,78,136,328,70,68',
-'69,667,71,72,135,73,571,74,304,305,324,135,135,135,478,868,325,479,327',
-'867,399,75,136,76,89,77,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
-'25,26,27,28,29,30,31,32,33,34,35,38,450,48,49,400,839,42,43,44,45,46',
-'47,48,49,135,135,328,838,66,304,305,306,607,307,308,310,311,406,208',
-'78,136,136,70,68,69,401,71,72,797,73,150,74,78,149,136,654,304,305,324',
-'78,796,136,136,136,325,75,327,76,407,77,5,6,7,10,13,14,15,16,17,18,19',
-'20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,835,163,403,661,402',
-'42,43,44,45,46,47,48,49,163,648,826,403,88,697,136,136,432,78,87,681',
-'816,574,89,208,520,720,70,68,69,660,71,72,532,73,196,74,510,636,827',
-'199,200,201,202,203,204,205,207,208,208,75,682,76,135,77,212,213,214',
-'215,216,217,218,304,305,306,889,307,308,310,311,199,200,201,202,203',
-'204,205,207,817,208,635,747,518,135,637,212,213,214,215,216,217,218',
-'529,888,415,199,200,201,202,203,204,205,207,341,208,342,528,343,135',
-'234,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,414',
-'208,270,878,235,135,719,212,213,214,215,216,217,218,525,277,589,504',
-'691,314,180,136,582,590,721,581,199,200,201,202,203,204,205,207,879',
-'208,720,587,163,135,776,212,213,214,215,216,217,218,503,690,313,136',
-'199,200,201,202,203,204,205,207,264,208,523,698,282,135,770,212,213',
-'214,215,216,217,218,347,582,136,275,581,348,349,898,180,850,199,200',
-'201,202,203,204,205,207,163,208,699,283,91,135,136,212,213,214,215,216',
-'217,218,199,200,201,202,203,204,205,207,851,208,722,833,691,135,162',
-'212,213,214,215,216,217,218,630,163,88,887,136,902,478,886,87,479,347',
-'859,89,163,409,348,349,88,631,699,832,794,903,87,904,234,592,89,629',
-'170,136,199,200,201,202,203,204,205,207,858,208,564,408,90,135,235,212',
-'213,214,215,216,217,218,522,199,200,201,202,203,204,205,207,136,208',
-'521,150,906,135,149,212,213,214,215,216,217,218,199,200,201,202,203',
-'204,205,207,136,208,394,395,396,135,360,212,213,214,215,216,217,218',
-'199,200,201,202,203,204,205,207,361,208,394,395,396,135,362,212,213',
-'214,215,216,217,218,145,146,363,199,200,201,202,203,204,205,207,437',
-'208,287,288,454,135,136,212,213,214,215,216,217,218,234,354,355,356',
-'357,591,436,438,439,440,441,456,457,458,455,136,347,350,351,515,235',
-'348,349,199,200,201,202,203,204,205,207,907,208,352,353,514,135,136',
-'212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,513,208',
-'358,359,512,135,136,212,213,214,215,216,217,218,364,365,511,199,200',
-'201,202,203,204,205,207,208,208,404,336,482,135,136,212,213,214,215',
-'216,217,218,199,200,201,202,203,204,205,207,481,208,517,518,474,135',
-'473,212,213,214,215,216,217,218,472,199,200,201,202,203,204,205,207',
-'470,208,350,351,463,135,136,212,213,214,215,216,217,218,350,351,234',
-'354,355,356,357,607,454,737,738,740,741,437,136,88,352,353,196,739,785',
-'87,235,608,234,89,610,743,742,456,457,458,455,436,438,439,440,441,611',
-'136,354,355,356,357,235,352,353,199,200,201,202,203,204,205,207,336',
-'208,352,353,612,135,136,212,213,214,215,216,217,218,614,199,200,201',
-'202,203,204,205,207,472,208,352,353,615,135,136,212,213,214,215,216',
-'217,218,199,200,201,202,203,204,205,207,616,208,358,359,617,135,618',
-'212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,208,208',
-'594,336,908,135,621,212,213,214,215,216,217,218,620,288,163,199,200',
-'201,202,203,204,205,207,462,208,787,788,459,135,136,212,213,214,215',
-'216,217,218,625,199,200,201,202,203,204,205,207,448,208,789,790,445',
+'46,47,48,49,896,88,644,406,666,761,711,87,135,871,135,135,135,135,189',
+'66,189,189,70,68,69,135,71,72,328,73,78,74,304,305,324,860,901,189,407',
+'136,325,136,327,189,75,75,75,76,77,77,77,135,874,178,189,189,189,79',
+'875,101,80,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
+'29,30,31,32,33,34,35,38,78,364,365,256,899,42,43,44,45,46,47,48,49,189',
+'189,189,136,66,136,136,136,136,878,135,135,89,100,78,78,136,328,70,68',
+'69,399,71,72,135,73,877,74,304,305,324,135,446,135,478,868,325,479,327',
+'867,879,75,136,76,89,77,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
+'25,26,27,28,29,30,31,32,33,34,35,38,450,48,49,314,838,42,43,44,45,46',
+'47,48,49,135,135,839,135,66,304,305,306,135,307,308,310,311,691,838',
+'78,136,136,70,68,69,313,71,72,275,73,880,74,78,180,136,816,304,305,324',
+'78,881,136,136,136,325,75,327,76,690,77,5,6,7,10,13,14,15,16,17,18,19',
+'20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,835,426,403,282,697',
+'42,43,44,45,46,47,48,49,163,817,163,620,288,277,136,136,432,136,180',
+'504,78,150,136,654,149,720,70,68,69,283,71,72,403,73,402,74,520,636',
+'162,199,200,201,202,203,204,205,207,328,208,75,503,76,135,77,212,213',
+'214,215,216,217,218,304,305,306,859,307,308,310,311,199,200,201,202',
+'203,204,205,207,889,208,635,648,883,135,637,212,213,214,215,216,217',
+'218,884,858,681,199,200,201,202,203,204,205,207,341,208,342,888,343',
+'135,234,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
+'682,208,885,668,235,135,661,212,213,214,215,216,217,218,88,789,790,691',
+'256,400,87,136,150,890,89,149,199,200,201,202,203,204,205,207,667,208',
+'891,660,163,135,776,212,213,214,215,216,217,218,794,255,401,136,199',
+'200,201,202,203,204,205,207,892,208,719,415,850,135,162,212,213,214',
+'215,216,217,218,887,898,136,902,886,582,721,903,581,833,199,200,201',
+'202,203,204,205,207,720,208,414,851,904,135,136,212,213,214,215,216',
+'217,218,199,200,201,202,203,204,205,207,832,208,722,698,826,135,906',
+'212,213,214,215,216,217,218,163,163,88,478,136,907,479,582,87,908,581',
+'607,89,163,3,163,88,910,827,699,699,81,87,352,353,234,89,797,170,770',
+'136,199,200,201,202,203,204,205,207,796,208,547,587,564,135,235,212',
+'213,214,215,216,217,218,90,199,200,201,202,203,204,205,207,136,208,394',
+'395,396,135,91,212,213,214,215,216,217,218,199,200,201,202,203,204,205',
+'207,136,208,394,395,396,135,92,212,213,214,215,216,217,218,199,200,201',
+'202,203,204,205,207,163,208,350,351,96,135,124,212,213,214,215,216,217',
+'218,594,336,125,199,200,201,202,203,204,205,207,126,208,130,510,132',
+'135,136,212,213,214,215,216,217,218,134,199,200,201,202,203,204,205',
+'207,140,208,352,353,142,135,136,212,213,214,215,216,217,218,199,200',
+'201,202,203,204,205,207,143,208,404,336,144,135,136,212,213,214,215',
+'216,217,218,199,200,201,202,203,204,205,207,147,208,358,359,155,135',
+'136,212,213,214,215,216,217,218,350,351,156,199,200,201,202,203,204',
+'205,207,159,208,350,351,160,135,136,212,213,214,215,216,217,218,164',
+'199,200,201,202,203,204,205,207,165,208,358,359,166,135,136,212,213',
+'214,215,216,217,218,199,200,201,202,203,204,205,207,167,208,630,437',
+'168,135,136,212,213,214,215,216,217,218,352,353,234,747,518,171,631',
+'287,288,436,438,439,440,441,136,347,629,172,347,173,348,349,235,348',
+'349,199,200,201,202,203,204,205,207,174,208,352,353,175,135,136,212',
+'213,214,215,216,217,218,176,199,200,201,202,203,204,205,207,180,208',
+'184,772,185,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
+'204,205,207,454,208,145,146,186,135,136,212,213,214,215,216,217,218',
+'347,187,234,517,518,348,349,456,457,458,455,199,200,201,202,203,204',
+'205,207,454,208,188,235,189,135,191,212,213,214,215,216,217,218,354',
+'355,356,357,787,788,136,456,457,458,455,354,355,356,357,199,200,201',
+'202,203,204,205,207,437,208,382,383,384,135,136,212,213,214,215,216',
+'217,218,377,378,379,380,381,385,436,438,439,440,441,304,305,306,136',
+'307,308,310,311,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27',
+'28,29,30,31,32,33,34,35,38,136,354,355,356,357,42,43,44,45,46,47,48',
+'49,199,200,201,202,203,204,205,207,192,208,352,353,193,135,196,212,213',
+'214,215,216,217,218,247,89,136,199,200,201,202,203,204,205,207,257,208',
+'159,264,208,135,270,212,213,214,215,216,217,218,199,200,201,202,203',
+'204,205,207,180,208,272,279,280,135,281,212,213,214,215,216,217,218',
+'234,284,285,286,289,290,199,200,201,202,203,204,205,207,312,208,335',
+'189,336,135,235,212,213,214,215,216,217,218,360,199,200,201,202,203',
+'204,205,207,136,208,361,670,362,135,363,212,213,214,215,216,217,218',
+'199,200,201,202,203,204,205,207,368,208,369,136,371,135,372,212,213',
+'214,215,216,217,218,159,199,200,201,202,203,204,205,207,405,208,136',
+'587,410,135,142,212,213,214,215,216,217,218,412,413,199,200,201,202',
+'203,204,205,207,416,208,417,418,419,135,136,212,213,214,215,216,217',
+'218,420,199,200,201,202,203,204,205,207,421,208,444,445,448,135,136',
+'212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,459,208',
+'462,772,463,135,136,212,213,214,215,216,217,218,470,88,234,88,382,383',
+'384,87,472,87,473,89,474,89,481,136,377,378,379,380,381,385,235,482',
+'208,199,200,201,202,203,204,205,207,511,208,512,513,514,135,136,212',
+'213,214,215,216,217,218,515,199,200,201,202,203,204,205,207,521,208',
+'522,523,264,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
+'204,205,207,525,208,270,528,529,135,136,212,213,214,215,216,217,218',
+'199,200,201,202,203,204,205,207,208,208,532,208,208,135,180,212,213',
+'214,215,216,217,218,536,537,540,199,200,201,202,203,204,205,207,541',
+'208,542,544,545,135,136,212,213,214,215,216,217,218,737,738,740,741',
+'548,189,270,558,562,196,739,737,738,740,741,136,565,189,743,742,196',
+'739,234,592,569,88,88,571,88,743,742,87,87,88,87,89,89,136,89,87,328',
+'574,235,89,196,199,200,201,202,203,204,205,207,589,208,590,700,360,135',
+'136,212,213,214,215,216,217,218,361,362,472,199,200,201,202,203,204',
+'205,207,363,208,472,591,607,135,136,212,213,214,215,216,217,218,199',
+'200,201,202,203,204,205,207,608,208,611,336,612,135,614,212,213,214',
+'215,216,217,218,199,200,201,202,203,204,205,207,615,208,616,617,618',
+'135,208,212,213,214,215,216,217,218,621,737,738,740,741,163,625,88,88',
+'641,196,739,785,87,87,136,643,89,89,743,742,625,662,663,669,674,199',
+'200,201,202,203,204,205,207,675,208,676,680,683,135,136,212,213,214',
+'215,216,217,218,199,200,201,202,203,204,205,207,685,208,686,687,688',
+'135,136,212,213,214,215,216,217,218,472,104,105,106,107,108,109,110',
+'111,112,113,114,689,189,136,692,208,695,704,5,6,7,10,13,14,15,16,17',
+'18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,163,706,707',
+'708,163,42,43,44,45,46,47,48,49,710,712,136,117,118,119,120,121,122',
+'123,199,200,201,202,203,204,205,207,713,208,714,715,718,135,136,212',
+'213,214,215,216,217,218,199,200,201,202,203,204,205,207,723,208,726',
+'571,75,135,729,212,213,214,215,216,217,218,199,200,201,202,203,204,205',
+'207,730,208,196,744,745,135,748,212,213,214,215,216,217,218,199,200',
+'201,202,203,204,205,207,749,208,752,753,754,135,756,212,213,214,215',
+'216,217,218,625,759,760,764,199,200,201,202,203,204,205,207,767,208',
+'771,779,780,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
+'204,205,207,782,208,783,791,793,135,136,212,213,214,215,216,217,218',
+'199,200,201,202,203,204,205,207,189,208,795,798,799,135,136,212,213',
+'214,215,216,217,218,199,200,201,202,203,204,205,207,800,208,803,804',
+'805,135,136,212,213,214,215,216,217,218,806,654,718,180,199,200,201',
+'202,203,204,205,207,811,208,812,813,814,135,136,212,213,214,215,216',
+'217,218,199,200,201,202,203,204,205,207,726,208,823,828,831,135,136',
+'212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,836,208',
+'840,841,-386,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
+'204,205,207,842,208,843,237,844,135,136,212,213,214,215,216,217,218',
+'848,803,208,854,199,200,201,202,203,204,205,207,857,208,862,863,865',
 '135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
-'444,208,421,772,641,135,136,212,213,214,215,216,217,218,88,88,234,382',
-'383,384,87,87,420,643,89,89,419,418,136,377,378,379,380,381,385,417',
-'235,416,625,199,200,201,202,203,204,205,207,413,208,412,662,663,135',
-'136,212,213,214,215,216,217,218,142,199,200,201,202,203,204,205,207',
-'410,208,405,159,669,135,136,212,213,214,215,216,217,218,199,200,201',
-'202,203,204,205,207,372,208,371,369,674,135,136,212,213,214,215,216',
-'217,218,199,200,201,202,203,204,205,207,368,208,675,237,676,135,363',
-'212,213,214,215,216,217,218,304,305,306,234,307,308,310,311,362,199',
-'200,201,202,203,204,205,207,136,208,361,680,360,135,235,212,213,214',
-'215,216,217,218,683,199,200,201,202,203,204,205,207,136,208,336,685',
-'686,135,687,212,213,214,215,216,217,218,199,200,201,202,203,204,205',
-'207,136,208,688,689,189,135,692,212,213,214,215,216,217,218,199,200',
-'201,202,203,204,205,207,136,208,335,208,695,135,312,212,213,214,215',
-'216,217,218,290,289,286,199,200,201,202,203,204,205,207,285,208,704',
-'163,706,135,136,212,213,214,215,216,217,218,737,738,740,741,707,708',
-'88,88,163,196,739,710,87,87,284,136,89,89,743,742,712,713,714,199,200',
-'201,202,203,204,205,207,715,208,718,281,280,135,136,212,213,214,215',
-'216,217,218,199,200,201,202,203,204,205,207,723,208,726,571,75,135,136',
-'212,213,214,215,216,217,218,729,730,472,20,21,22,23,24,25,26,27,28,29',
-'30,31,32,33,136,196,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25',
-'26,27,28,29,30,31,32,33,34,35,38,279,744,745,272,3,42,43,44,45,46,47',
-'48,49,748,749,136,117,118,119,120,121,122,123,199,200,201,202,203,204',
-'205,207,750,208,610,752,753,135,136,212,213,214,215,216,217,218,199',
-'200,201,202,203,204,205,207,754,208,180,756,625,135,759,212,213,214',
-'215,216,217,218,199,200,201,202,203,204,205,207,760,208,270,208,264',
-'135,764,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
-'159,208,257,767,89,135,247,212,213,214,215,216,217,218,771,196,193,192',
-'199,200,201,202,203,204,205,207,779,208,780,191,782,135,136,212,213',
-'214,215,216,217,218,199,200,201,202,203,204,205,207,783,208,189,81,910',
-'135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
-'791,208,188,793,187,135,136,212,213,214,215,216,217,218,199,200,201',
-'202,203,204,205,207,795,208,186,670,798,135,136,212,213,214,215,216',
-'217,218,799,800,803,804,199,200,201,202,203,204,205,207,805,208,806',
-'654,718,135,136,212,213,214,215,216,217,218,737,738,740,741,180,88,88',
-'88,811,196,739,87,87,87,136,89,89,89,743,742,812,813,199,200,201,202',
-'203,204,205,207,814,208,185,184,726,135,136,212,213,214,215,216,217',
-'218,199,200,201,202,203,204,205,207,823,208,180,176,175,135,136,212',
-'213,214,215,216,217,218,382,383,384,472,117,118,119,120,121,122,123',
-'828,377,378,379,380,381,385,136,5,6,7,10,13,14,15,16,17,18,19,20,21',
-'22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,174,173,831,172,171,42',
-'43,44,45,46,47,48,49,168,836,136,167,166,840,841,-386,842,843,199,200',
-'201,202,203,204,205,207,844,208,165,164,160,135,136,212,213,214,215',
-'216,217,218,199,200,201,202,203,204,205,345,848,208,803,159,156,135',
-'208,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,854',
-'208,155,147,857,135,144,212,213,214,215,216,217,218,199,200,201,202',
-'203,204,205,207,143,208,862,863,142,135,865,212,213,214,215,216,217',
-'218,140,869,870,871,199,200,201,202,203,204,205,207,134,208,132,874',
-'875,135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205',
-'207,130,208,877,126,838,135,136,212,213,214,215,216,217,218,199,200',
-'201,202,203,204,205,207,880,208,881,587,328,135,136,212,213,214,215',
-'216,217,218,199,200,201,202,203,204,205,207,883,208,884,885,125,135',
-'136,212,213,214,215,216,217,218,124,890,891,234,104,105,106,107,108',
-'109,110,111,112,113,114,88,892,96,136,92,544,87,545,235,542,89,199,200',
-'201,202,203,204,205,207,548,208,189,270,541,135,136,212,213,214,215',
-'216,217,218,199,200,201,202,203,204,205,207,540,208,558,537,536,135',
-'136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207,,208',
-',,,135,136,212,213,214,215,216,217,218,199,200,201,202,203,204,205,207',
-',208,,,,135,,212,213,214,215,216,217,218,,,,,199,200,201,202,203,204',
-'205,207,,208,,772,,135,136,212,213,214,215,216,217,218,199,200,201,202',
-'203,204,205,207,,208,,,,135,136,212,213,214,215,216,217,218,199,200',
-'201,202,203,204,205,207,,208,,,,135,136,212,213,214,215,216,217,218',
-'199,200,201,202,203,204,205,207,,208,,,,135,136,212,213,214,215,216',
-'217,218,,,,,199,200,201,202,203,204,205,207,,208,,,,135,136,212,213',
-'214,215,216,217,218,199,200,201,202,203,204,205,207,,208,,,,135,136',
-'212,213,214,215,216,217,218,737,738,740,741,,88,,,,196,739,87,,,136',
-'89,,,743,742,,,,,,,,,,,,,,,,,136,104,105,106,107,108,109,110,111,112',
-'113,114,,,,478,585,,584,,,,,,,89,136,,,,,,,472,,,,,,117,118,119,120',
-'121,122,123,,,136,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26',
-'27,28,29,30,31,32,33,34,35,38,241,,78,,,42,43,44,45,46,47,48,49,,,,',
-',,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27',
-'28,29,30,31,32,33,34,35,38,672,,78,,,42,43,44,45,46,47,48,49,,,,,,,',
-',,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
+',208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202,203,204',
+'205,207,,208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202',
+'203,204,205,207,,208,,,,135,136,212,213,214,215,216,217,218,88,,,,,',
+'87,,,88,89,737,738,740,741,87,,,136,89,196,739,,,,234,,,,743,742,117',
+'118,119,120,121,122,123,,,136,,,,,235,,,199,200,201,202,203,204,205',
+'207,,208,,,,135,136,212,213,214,215,216,217,218,199,200,201,202,203',
+'204,205,207,,208,472,,,135,136,212,213,214,215,216,217,218,199,200,201',
+'202,203,204,205,345,,208,,,,135,,212,213,214,215,216,217,218,199,200',
+'201,202,203,204,205,207,,208,,,,135,,212,213,214,215,216,217,218,,,',
+'104,105,106,107,108,109,110,111,112,113,114,,,,,136,,,,,,,104,105,106',
+'107,108,109,110,111,112,113,114,,,,,136,117,118,119,120,121,122,123',
+',,,478,585,,584,,,,,,,89,136,117,118,119,120,121,122,123,20,21,22,23',
+'24,25,26,27,28,29,30,31,32,33,136,5,6,7,10,13,14,15,16,17,18,19,20,21',
+'22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,672,,78,,,42,43,44,45,46',
+'47,48,49,,,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22',
+'23,24,25,26,27,28,29,30,31,32,33,34,35,38,241,,78,,,42,43,44,45,46,47',
+'48,49,,,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23',
+'24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49',
+',,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26',
+'27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,506,,,',
+',,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27',
+'28,29,30,31,32,33,34,35,38,78,428,,,,42,43,44,45,46,47,48,49,,,,,,,',
+',,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
 '29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,',
 ',,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30',
-'31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,506,,,,,,,,,,,,,,,',
-',,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31',
-'32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6',
-'7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33',
-'34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13',
-'14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38',
-'78,428,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15',
-'16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,',
-',,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17',
-'18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,387,,,,42',
+'31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5',
+'6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33',
+'34,35,38,78,632,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10',
+'13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35',
+'38,78,638,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14',
+'15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,128',
+'658,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16',
+'17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42',
 '43,44,45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19',
-'20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45',
-'46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22',
-'23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48',
-'49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25',
-'26,27,28,29,30,31,32,33,34,35,38,128,516,,,,42,43,44,45,46,47,48,49',
+'20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,516,,,,42,43,44',
+'45,46,47,48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21',
+'22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47',
+'48,49,,,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
+'25,26,27,28,29,30,31,32,33,34,35,38,78,387,,,,42,43,44,45,46,47,48,49',
 ',,,,,,,,,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26',
 '27,28,29,30,31,32,33,34,35,38,78,,,,,42,43,44,45,46,47,48,49,,,,,,,',
 ',,,,,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
-'29,30,31,32,33,34,35,38,78,632,,,,42,43,44,45,46,47,48,49,,,,,,,,,,',
-',,,,,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29',
-'30,31,32,33,34,35,38,78,638,,,,42,43,44,45,46,47,48,49,,,,,,,,,,,,,',
-',,,,,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30',
-'31,32,33,34,35,38,,658,,,,42,43,44,45,46,47,48,49,104,105,106,107,108',
-'109,110,111,112,113,114,,,,,,,,,,,,,,,,,,,,,,,,,,,,117,118,119,120,121',
-'122,123,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29',
-'30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15',
-'16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,',
-'42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24',
-'25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6',
-'7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33',
-'34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19',
-'20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45',
-'46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28',
 '29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14',
 '15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,',
 ',,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23',
-'24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47' ]
-        racc_action_table = arr = ::Array.new(3623, nil)
+'24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49',
+'5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32',
+'33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18',
+'19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44',
+'45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27',
+'28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48,49,5,6,7,10,13',
+'14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,38',
+',,,,,42,43,44,45,46,47,48,49,5,6,7,10,13,14,15,16,17,18,19,20,21,22',
+'23,24,25,26,27,28,29,30,31,32,33,34,35,38,,,,,,42,43,44,45,46,47,48',
+'49,5,6,7,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31',
+'32,33,34,35,38,,,,,,42,43,44,45,46,47' ]
+        racc_action_table = arr = ::Array.new(3593, nil)
         idx = 0
         clist.each do |str|
@@ -770,192 +771,192 @@
 
 clist = [
-'2,469,843,576,422,856,192,194,450,192,329,2,613,434,630,630,630,630',
-'630,630,630,630,824,630,596,630,893,630,560,630,630,630,630,630,630',
-'630,597,154,703,642,454,434,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2',
-'2,2,2,2,2,2,2,2,329,422,613,194,194,2,2,2,2,2,2,2,2,893,414,560,157',
-'447,125,777,573,721,460,558,631,303,470,576,291,856,469,2,2,2,839,2',
-'2,563,2,291,2,192,192,192,843,895,824,157,573,192,630,192,596,329,2',
-'613,2,329,2,613,782,85,703,642,597,154,2,85,41,2,291,291,291,291,291',
+'2,469,843,447,422,777,192,194,852,192,329,2,613,269,515,515,515,515',
+'515,515,515,515,824,515,596,325,893,515,560,515,515,515,515,515,515',
+'515,154,597,125,856,853,269,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2',
+'2,2,2,2,2,2,2,2,329,422,613,194,194,2,2,2,2,2,2,2,2,893,85,560,267,576',
+'703,642,85,721,855,631,558,528,511,447,161,777,469,2,2,2,92,2,2,563',
+'2,161,2,192,192,192,843,895,824,267,325,192,515,192,596,329,2,613,2',
+'329,2,613,75,860,125,856,154,597,2,861,41,2,161,161,161,161,161,161',
+'161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161',
+'161,161,161,161,161,187,230,230,258,895,161,161,161,161,161,161,161',
+'161,576,703,642,721,185,631,558,528,511,866,691,303,89,41,315,185,92',
+'315,161,161,161,258,161,161,333,161,863,161,563,563,563,286,308,782',
+'340,851,563,340,563,851,866,161,75,161,340,161,185,185,185,185,185,185',
+'185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185',
+'185,185,185,185,185,315,89,89,190,869,185,185,185,185,185,185,185,185',
+'839,470,812,692,291,187,187,187,512,187,187,187,187,609,812,291,691',
+'303,185,185,185,190,185,185,171,185,872,185,778,171,333,778,315,315',
+'315,294,873,286,308,782,315,185,315,185,609,185,291,291,291,291,291',
 '291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291,291',
-'291,291,291,291,291,291,187,291,461,577,895,291,291,291,291,291,291',
-'291,291,447,125,777,721,185,558,631,303,470,258,286,308,89,41,315,185',
-'839,315,291,291,291,577,291,291,92,291,462,291,563,563,563,512,75,325',
-'340,851,563,340,563,851,258,291,782,291,340,291,185,185,185,185,185',
-'185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185',
-'185,185,185,185,185,185,315,89,89,262,812,185,185,185,185,185,185,185',
-'185,511,333,463,812,161,187,187,187,756,187,187,187,187,267,413,161',
-'286,308,185,185,185,262,185,185,756,185,148,185,561,148,92,561,315,315',
-'315,294,756,512,75,325,315,185,315,185,267,185,161,161,161,161,161,161',
-'161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161',
-'161,161,161,161,161,808,392,264,568,264,161,161,161,161,161,161,161',
-'161,375,561,784,625,127,625,511,333,294,778,127,599,778,465,127,412',
-'392,808,161,161,161,568,161,161,411,161,472,161,375,553,784,720,720',
-'720,720,720,720,720,720,410,720,161,599,161,720,161,720,720,720,720',
-'720,720,720,294,294,294,880,294,294,294,294,257,257,257,257,257,257',
-'257,257,778,257,553,684,684,257,553,257,257,257,257,257,257,257,409',
-'880,278,474,474,474,474,474,474,474,474,210,474,210,408,210,474,720',
-'474,474,474,474,474,474,474,403,403,403,403,403,403,403,403,278,403',
-'407,866,720,403,653,403,403,403,403,403,403,403,402,172,480,366,609',
-'190,172,720,580,483,653,580,479,479,479,479,479,479,479,479,866,479',
-'653,479,716,479,720,479,479,479,479,479,479,479,366,609,190,257,889',
-'889,889,889,889,889,889,889,401,889,396,626,176,889,716,889,889,889',
-'889,889,889,889,488,477,474,171,477,488,488,894,171,834,504,504,504',
-'504,504,504,504,504,102,504,626,176,9,504,403,504,504,504,504,504,504',
-'504,862,862,862,862,862,862,862,862,834,862,657,801,751,862,102,862',
-'862,862,862,862,862,862,549,115,253,879,479,897,476,879,253,476,221',
-'841,253,452,269,221,221,88,549,657,801,751,898,88,901,504,504,88,549',
-'115,889,859,859,859,859,859,859,859,859,841,859,452,269,8,859,504,859',
-'859,859,859,859,859,859,395,513,513,513,513,513,513,513,513,504,513',
-'394,86,904,513,86,513,513,513,513,513,513,513,848,848,848,848,848,848',
-'848,848,862,848,254,254,254,848,498,848,848,848,848,848,848,848,359',
-'359,359,359,359,359,359,359,499,359,520,520,520,359,500,359,359,359',
-'359,359,359,359,82,82,501,358,358,358,358,358,358,358,358,547,358,181',
-'181,564,358,859,358,358,358,358,358,358,358,848,496,496,496,496,502',
-'547,547,547,547,547,564,564,564,564,513,487,222,222,384,848,487,487',
-'806,806,806,806,806,806,806,806,905,806,223,223,383,806,848,806,806',
-'806,806,806,806,806,357,357,357,357,357,357,357,357,382,357,225,225',
-'381,357,359,357,357,357,357,357,357,357,230,230,380,797,797,797,797',
-'797,797,797,797,368,797,265,265,343,797,358,797,797,797,797,797,797',
-'797,796,796,796,796,796,796,796,796,342,796,389,389,338,796,337,796',
-'796,796,796,796,796,796,335,356,356,356,356,356,356,356,356,334,356',
-'489,489,327,356,806,356,356,356,356,356,356,356,490,490,797,495,495',
-'495,495,525,318,739,739,739,739,297,357,696,491,491,739,739,739,696',
-'797,526,796,696,528,739,739,318,318,318,318,297,297,297,297,297,529',
-'797,224,224,224,224,796,492,492,355,355,355,355,355,355,355,355,530',
-'355,493,493,531,355,796,355,355,355,355,355,355,355,533,354,354,354',
-'354,354,354,354,354,739,354,494,494,534,354,356,354,354,354,354,354',
-'354,354,353,353,353,353,353,353,353,353,535,353,497,497,536,353,537',
-'353,353,353,353,353,353,353,352,352,352,352,352,352,352,352,538,352',
-'505,505,906,352,543,352,352,352,352,352,352,352,539,539,544,748,748',
-'748,748,748,748,748,748,326,748,742,742,324,748,355,748,748,748,748',
-'748,748,748,548,729,729,729,729,729,729,729,729,309,729,743,743,307',
-'729,354,729,729,729,729,729,729,729,719,719,719,719,719,719,719,719',
-'306,719,285,719,557,719,353,719,719,719,719,719,719,719,430,602,748',
-'246,246,246,430,602,284,559,430,602,283,282,352,246,246,246,246,246',
-'246,281,748,280,565,351,351,351,351,351,351,351,351,276,351,274,570',
-'572,351,748,351,351,351,351,351,351,351,272,147,147,147,147,147,147',
-'147,147,271,147,266,256,578,147,729,147,147,147,147,147,147,147,350',
-'350,350,350,350,350,350,350,242,350,240,236,583,350,719,350,350,350',
-'350,350,350,350,149,149,149,149,149,149,149,149,235,149,586,149,588',
-'149,229,149,149,149,149,149,149,149,546,546,546,147,546,546,546,546',
-'228,349,349,349,349,349,349,349,349,351,349,227,598,226,349,147,349',
-'349,349,349,349,349,349,600,714,714,714,714,714,714,714,714,147,714',
-'206,604,605,714,606,714,714,714,714,714,714,714,348,348,348,348,348',
-'348,348,348,350,348,607,608,198,348,611,348,348,348,348,348,348,348',
-'710,710,710,710,710,710,710,710,149,710,195,616,619,710,189,710,710',
-'710,710,710,710,710,184,183,179,347,347,347,347,347,347,347,347,178',
-'347,632,634,636,347,349,347,347,347,347,347,347,347,827,827,827,827',
-'637,638,373,288,640,827,827,641,373,288,177,714,373,288,827,827,643',
-'644,646,706,706,706,706,706,706,706,706,648,706,651,175,174,706,348',
-'706,706,706,706,706,706,706,345,345,345,345,345,345,345,345,658,345',
-'662,663,664,345,710,345,345,345,345,345,345,345,665,666,827,36,36,36',
-'36,36,36,36,36,36,36,36,36,36,36,347,668,345,345,345,345,345,345,345',
-'345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,345',
-'345,345,345,345,173,671,673,169,1,345,345,345,345,345,345,345,345,688',
-'689,706,260,260,260,260,260,260,260,515,515,515,515,515,515,515,515',
-'691,515,692,693,694,515,345,515,515,515,515,515,515,515,166,166,166',
-'166,166,166,166,166,695,166,168,697,699,166,700,166,166,166,166,166',
-'166,166,341,341,341,341,341,341,341,341,701,341,167,165,164,341,707',
-'341,341,341,341,341,341,341,682,682,682,682,682,682,682,682,160,682',
-'159,711,152,682,151,682,682,682,682,682,682,682,718,144,141,139,521',
-'521,521,521,521,521,521,521,725,521,727,138,730,521,515,521,521,521',
-'521,521,521,521,522,522,522,522,522,522,522,522,731,522,137,3,909,522',
-'166,522,522,522,522,522,522,522,523,523,523,523,523,523,523,523,746',
-'523,136,749,133,523,341,523,523,523,523,523,523,523,581,581,581,581',
-'581,581,581,581,755,581,131,581,760,581,682,581,581,581,581,581,581',
-'581,761,763,764,766,908,908,908,908,908,908,908,908,767,908,768,769',
-'770,908,521,908,908,908,908,908,908,908,783,783,783,783,771,146,518',
-'245,772,783,783,146,518,245,522,146,518,245,783,783,773,775,290,290',
-'290,290,290,290,290,290,776,290,129,128,780,290,523,290,290,290,290',
-'290,290,290,207,207,207,207,207,207,207,207,781,207,126,124,123,207',
-'581,207,207,207,207,207,207,207,510,510,510,783,170,170,170,170,170',
-'170,170,793,510,510,510,510,510,510,908,207,207,207,207,207,207,207',
+'291,291,291,291,291,291,808,291,625,176,625,291,291,291,291,291,291',
+'291,291,392,778,573,539,539,172,839,470,294,692,172,366,561,86,512,561',
+'86,808,291,291,291,176,291,291,264,291,264,291,392,553,573,720,720,720',
+'720,720,720,720,720,874,720,291,366,291,720,291,720,720,720,720,720',
+'720,720,294,294,294,841,294,294,294,294,902,902,902,902,902,902,902',
+'902,880,902,553,561,876,902,553,902,902,902,902,902,902,902,877,841',
+'599,889,889,889,889,889,889,889,889,210,889,210,880,210,889,720,889',
+'889,889,889,889,889,889,521,521,521,521,521,521,521,521,599,521,878',
+'577,720,521,568,521,521,521,521,521,521,521,430,743,743,751,157,262',
+'430,720,148,881,430,148,522,522,522,522,522,522,522,522,577,522,882',
+'568,102,522,720,522,522,522,522,522,522,522,751,157,262,902,523,523',
+'523,523,523,523,523,523,883,523,653,278,834,523,102,523,523,523,523',
+'523,523,523,879,894,889,897,879,580,653,898,580,801,234,234,234,234',
+'234,234,234,234,653,234,278,834,901,234,521,234,234,234,234,234,234',
+'234,166,166,166,166,166,166,166,166,801,166,657,626,784,166,904,166',
+'166,166,166,166,166,166,115,716,518,476,522,905,476,477,518,906,477',
+'756,518,434,1,452,127,909,784,657,626,3,127,494,494,234,127,756,115',
+'716,523,479,479,479,479,479,479,479,479,756,479,434,479,452,479,234',
+'479,479,479,479,479,479,479,8,358,358,358,358,358,358,358,358,234,358',
+'520,520,520,358,9,358,358,358,358,358,358,358,363,363,363,363,363,363',
+'363,363,166,363,254,254,254,363,16,363,363,363,363,363,363,363,360,360',
+'360,360,360,360,360,360,375,360,222,222,38,360,68,360,360,360,360,360',
+'360,360,505,505,69,361,361,361,361,361,361,361,361,70,361,72,375,73',
+'361,479,361,361,361,361,361,361,361,74,682,682,682,682,682,682,682,682',
+'76,682,223,223,77,682,358,682,682,682,682,682,682,682,862,862,862,862',
+'862,862,862,862,79,862,265,265,80,862,363,862,862,862,862,862,862,862',
+'362,362,362,362,362,362,362,362,84,362,225,225,94,362,360,362,362,362',
+'362,362,362,362,489,489,95,797,797,797,797,797,797,797,797,100,797,490',
+'490,101,797,361,797,797,797,797,797,797,797,104,811,811,811,811,811',
+'811,811,811,106,811,497,497,108,811,682,811,811,811,811,811,811,811',
+'838,838,838,838,838,838,838,838,110,838,549,297,114,838,862,838,838',
+'838,838,838,838,838,491,491,797,684,684,117,549,181,181,297,297,297',
+'297,297,362,487,549,118,221,119,487,487,797,221,221,796,796,796,796',
+'796,796,796,796,122,796,492,492,123,796,797,796,796,796,796,796,796',
+'796,124,835,835,835,835,835,835,835,835,126,835,128,835,129,835,811',
+'835,835,835,835,835,835,835,514,514,514,514,514,514,514,514,318,514',
+'82,82,131,514,838,514,514,514,514,514,514,514,488,133,796,389,389,488',
+'488,318,318,318,318,823,823,823,823,823,823,823,823,564,823,136,796',
+'137,823,138,823,823,823,823,823,823,823,495,495,495,495,742,742,796',
+'564,564,564,564,224,224,224,224,207,207,207,207,207,207,207,207,547',
+'207,510,510,510,207,835,207,207,207,207,207,207,207,510,510,510,510',
+'510,510,547,547,547,547,547,546,546,546,514,546,546,546,546,207,207',
 '207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207,207',
-'207,207,207,207,122,119,799,118,117,207,207,207,207,207,207,207,207',
-'114,810,290,110,108,814,815,816,817,821,211,211,211,211,211,211,211',
-'211,822,211,106,104,101,211,207,211,211,211,211,211,211,211,212,212',
-'212,212,212,212,212,212,828,212,833,100,95,212,836,212,212,212,212,212',
-'212,212,902,902,902,902,902,902,902,902,837,902,94,84,840,902,80,902',
-'902,902,902,902,902,902,591,591,591,591,591,591,591,591,79,591,845,846',
-'77,591,850,591,591,591,591,591,591,591,76,852,853,855,575,575,575,575',
-'575,575,575,575,74,575,73,860,861,575,211,575,575,575,575,575,575,575',
-'234,234,234,234,234,234,234,234,72,234,863,70,869,234,212,234,234,234',
-'234,234,234,234,584,584,584,584,584,584,584,584,872,584,873,584,874',
-'584,902,584,584,584,584,584,584,584,514,514,514,514,514,514,514,514',
-'876,514,877,878,69,514,591,514,514,514,514,514,514,514,68,881,882,234',
-'162,162,162,162,162,162,162,162,162,162,162,4,883,38,575,16,431,4,432',
-'234,428,4,365,365,365,365,365,365,365,365,437,365,442,443,426,365,234',
-'365,365,365,365,365,365,365,364,364,364,364,364,364,364,364,425,364',
-'446,419,416,364,584,364,364,364,364,364,364,364,363,363,363,363,363',
-'363,363,363,,363,,,,363,514,363,363,363,363,363,363,363,838,838,838',
-'838,838,838,838,838,,838,,,,838,,838,838,838,838,838,838,838,,,,,835',
-'835,835,835,835,835,835,835,,835,,835,,835,365,835,835,835,835,835,835',
-'835,362,362,362,362,362,362,362,362,,362,,,,362,364,362,362,362,362',
-'362,362,362,361,361,361,361,361,361,361,361,,361,,,,361,363,361,361',
-'361,361,361,361,361,823,823,823,823,823,823,823,823,,823,,,,823,838',
-'823,823,823,823,823,823,823,,,,,360,360,360,360,360,360,360,360,,360',
-',,,360,835,360,360,360,360,360,360,360,811,811,811,811,811,811,811,811',
-',811,,,,811,362,811,811,811,811,811,811,811,669,669,669,669,,424,,,',
-'669,669,424,,,361,424,,,669,669,,,,,,,,,,,,,,,,,823,54,54,54,54,54,54',
-'54,54,54,54,54,,,,478,478,,478,,,,,,,478,360,,,,,,,669,,,,,,54,54,54',
-'54,54,54,54,,,811,478,478,478,478,478,478,478,478,478,478,478,478,478',
-'478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,150,,150',
-',,478,478,478,478,478,478,478,478,,,,,,,,,,,,,,,,,,,,,150,150,150,150',
+'207,207,207,207,207,207,207,207,207,823,496,496,496,496,207,207,207',
+'207,207,207,207,207,748,748,748,748,748,748,748,748,139,748,493,493',
+'141,748,144,748,748,748,748,748,748,748,151,152,207,859,859,859,859',
+'859,859,859,859,159,859,160,164,165,859,167,859,859,859,859,859,859',
+'859,575,575,575,575,575,575,575,575,168,575,169,173,174,575,175,575',
+'575,575,575,575,575,575,748,177,178,179,183,184,257,257,257,257,257',
+'257,257,257,189,257,195,198,206,257,748,257,257,257,257,257,257,257',
+'226,581,581,581,581,581,581,581,581,748,581,227,581,228,581,229,581',
+'581,581,581,581,581,581,729,729,729,729,729,729,729,729,235,729,236',
+'859,240,729,242,729,729,729,729,729,729,729,256,584,584,584,584,584',
+'584,584,584,266,584,575,584,271,584,272,584,584,584,584,584,584,584',
+'274,276,147,147,147,147,147,147,147,147,280,147,281,282,283,147,257',
+'147,147,147,147,147,147,147,284,591,591,591,591,591,591,591,591,285',
+'591,306,307,309,591,581,591,591,591,591,591,591,591,719,719,719,719',
+'719,719,719,719,324,719,326,719,327,719,729,719,719,719,719,719,719',
+'719,334,288,147,602,246,246,246,288,335,602,337,288,338,602,342,584',
+'246,246,246,246,246,246,147,343,368,714,714,714,714,714,714,714,714',
+'380,714,381,382,383,714,147,714,714,714,714,714,714,714,384,710,710',
+'710,710,710,710,710,710,394,710,395,396,401,710,591,710,710,710,710',
+'710,710,710,706,706,706,706,706,706,706,706,402,706,407,408,409,706',
+'719,706,706,706,706,706,706,706,504,504,504,504,504,504,504,504,410',
+'504,411,412,413,504,414,504,504,504,504,504,504,504,416,419,425,365',
+'365,365,365,365,365,365,365,426,365,428,431,432,365,714,365,365,365',
+'365,365,365,365,827,827,827,827,437,442,443,446,450,827,827,783,783',
+'783,783,710,454,460,827,827,783,783,504,504,461,4,696,462,373,783,783',
+'4,696,146,373,4,696,706,373,146,463,465,504,146,472,630,630,630,630',
+'630,630,630,630,480,630,483,630,498,630,504,630,630,630,630,630,630',
+'630,499,500,827,364,364,364,364,364,364,364,364,501,364,783,502,525',
+'364,365,364,364,364,364,364,364,364,908,908,908,908,908,908,908,908',
+'526,908,529,530,531,908,533,908,908,908,908,908,908,908,341,341,341',
+'341,341,341,341,341,534,341,535,536,537,341,538,341,341,341,341,341',
+'341,341,543,739,739,739,739,544,548,88,424,557,739,739,739,88,424,630',
+'559,88,424,739,739,565,570,572,578,583,347,347,347,347,347,347,347,347',
+'586,347,588,598,600,347,364,347,347,347,347,347,347,347,345,345,345',
+'345,345,345,345,345,604,345,605,606,607,345,908,345,345,345,345,345',
+'345,345,739,162,162,162,162,162,162,162,162,162,162,162,608,610,341',
+'611,616,619,632,345,345,345,345,345,345,345,345,345,345,345,345,345',
+'345,345,345,345,345,345,345,345,345,345,345,345,345,345,345,634,636',
+'637,638,640,345,345,345,345,345,345,345,345,641,643,347,260,260,260',
+'260,260,260,260,348,348,348,348,348,348,348,348,644,348,646,648,651',
+'348,345,348,348,348,348,348,348,348,349,349,349,349,349,349,349,349',
+'658,349,662,663,664,349,665,349,349,349,349,349,349,349,350,350,350',
+'350,350,350,350,350,666,350,668,671,673,350,688,350,350,350,350,350',
+'350,350,351,351,351,351,351,351,351,351,689,351,693,694,695,351,697',
+'351,351,351,351,351,351,351,699,700,701,707,352,352,352,352,352,352',
+'352,352,711,352,718,725,727,352,348,352,352,352,352,352,352,352,353',
+'353,353,353,353,353,353,353,730,353,731,746,749,353,349,353,353,353',
+'353,353,353,353,354,354,354,354,354,354,354,354,750,354,755,760,761',
+'354,350,354,354,354,354,354,354,354,355,355,355,355,355,355,355,355',
+'763,355,764,766,767,355,351,355,355,355,355,355,355,355,768,769,770',
+'771,356,356,356,356,356,356,356,356,772,356,773,775,776,356,352,356',
+'356,356,356,356,356,356,357,357,357,357,357,357,357,357,780,357,781',
+'793,799,357,353,357,357,357,357,357,357,357,359,359,359,359,359,359',
+'359,359,810,359,814,815,816,359,354,359,359,359,359,359,359,359,149',
+'149,149,149,149,149,149,149,817,149,821,149,822,149,355,149,149,149',
+'149,149,149,149,828,833,836,837,474,474,474,474,474,474,474,474,840',
+'474,845,846,850,474,356,474,474,474,474,474,474,474,290,290,290,290',
+'290,290,290,290,,290,,,,290,357,290,290,290,290,290,290,290,848,848',
+'848,848,848,848,848,848,,848,,,,848,359,848,848,848,848,848,848,848',
+'806,806,806,806,806,806,806,806,,806,,,,806,149,806,806,806,806,806',
+'806,806,245,,,,,,245,,,253,245,669,669,669,669,253,,,474,253,669,669',
+',,,848,,,,669,669,170,170,170,170,170,170,170,,,290,,,,,848,,,403,403',
+'403,403,403,403,403,403,,403,,,,403,848,403,403,403,403,403,403,403',
+'513,513,513,513,513,513,513,513,,513,669,,,513,806,513,513,513,513,513',
+'513,513,212,212,212,212,212,212,212,212,,212,,,,212,,212,212,212,212',
+'212,212,212,211,211,211,211,211,211,211,211,,211,,,,211,,211,211,211',
+'211,211,211,211,,,,464,464,464,464,464,464,464,464,464,464,464,,,,,403',
+',,,,,,54,54,54,54,54,54,54,54,54,54,54,,,,,513,464,464,464,464,464,464',
+'464,,,,478,478,,478,,,,,,,478,212,54,54,54,54,54,54,54,36,36,36,36,36',
+'36,36,36,36,36,36,36,36,36,211,478,478,478,478,478,478,478,478,478,478',
+'478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478,478',
+'478,582,,582,,,478,478,478,478,478,478,478,478,,,,,,,,,,,,,,,,,,,,,582',
+'582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582',
+'582,582,582,582,582,582,582,582,582,582,150,,150,,,582,582,582,582,582',
+'582,582,582,,,,,,,,,,,,,,,,,,,,,150,150,150,150,150,150,150,150,150',
 '150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150',
-'150,150,150,150,150,150,150,582,,582,,,150,150,150,150,150,150,150,150',
-',,,,,,,,,,,,,,,,,,,,582,582,582,582,582,582,582,582,582,582,582,582',
-'582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,372',
-',,,,582,582,582,582,582,582,582,582,,,,,,,,,,,,,,,,,,,372,372,372,372',
+'150,150,372,,,,,150,150,150,150,150,150,150,150,,,,,,,,,,,,,,,,,,,372',
 '372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372',
-'372,372,372,372,372,372,372,459,,,,,372,372,372,372,372,372,372,372',
-'372,,,,,,,,,,,,,,,,,,459,459,459,459,459,459,459,459,459,459,459,459',
-'459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,250',
-',,,,459,459,459,459,459,459,459,459,,,,,,,,,,,,,,,,,,,250,250,250,250',
+'372,372,372,372,372,372,372,372,372,372,293,,,,,372,372,372,372,372',
+'372,372,372,372,,,,,,,,,,,,,,,,,,293,293,293,293,293,293,293,293,293',
+'293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,293',
+'293,293,444,293,,,,293,293,293,293,293,293,293,293,,,,,,,,,,,,,,,,,',
+',444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444',
+'444,444,444,444,444,444,444,444,444,444,444,445,,,,,444,444,444,444',
+'444,444,444,444,,,,,,,,,,,,,,,,,,,445,445,445,445,445,445,445,445,445',
+'445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445',
+'445,445,550,,,,,445,445,445,445,445,445,445,445,,,,,,,,,,,,,,,,,,,550',
+'550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550',
+'550,550,550,550,550,550,550,550,550,550,554,550,,,,550,550,550,550,550',
+'550,550,550,,,,,,,,,,,,,,,,,,,554,554,554,554,554,554,554,554,554,554',
+'554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554',
+'554,566,554,,,,554,554,554,554,554,554,554,554,,,,,,,,,,,,,,,,,,,566',
+'566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566,566',
+'566,566,566,566,566,566,566,566,566,566,71,566,,,,566,566,566,566,566',
+'566,566,566,,,,,,,,,,,,,,,,,,,71,71,71,71,71,71,71,71,71,71,71,71,71',
+'71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,386,,,,,71,71,71,71,71',
+'71,71,71,,,,,,,,,,,,,,,,,,,386,386,386,386,386,386,386,386,386,386,386',
+'386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386',
+'459,386,,,,386,386,386,386,386,386,386,386,,,,,,,,,,,,,,,,,,,459,459',
+'459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459,459',
+'459,459,459,459,459,459,459,459,459,251,,,,,459,459,459,459,459,459',
+'459,459,,,,,,,,,,,,,,,,,,,251,251,251,251,251,251,251,251,251,251,251',
+'251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251',
+'250,251,,,,251,251,251,251,251,251,251,251,,,,,,,,,,,,,,,,,,,250,250',
 '250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250',
-'250,250,250,250,250,250,250,293,,,,,250,250,250,250,250,250,250,250',
-',,,,,,,,,,,,,,,,,,293,293,293,293,293,293,293,293,293,293,293,293,293',
-'293,293,293,293,293,293,293,293,293,293,293,293,293,293,293,445,293',
-',,,293,293,293,293,293,293,293,293,,,,,,,,,,,,,,,,,,,445,445,445,445',
-'445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445,445',
-'445,445,445,445,445,445,445,251,,,,,445,445,445,445,445,445,445,445',
-',,,,,,,,,,,,,,,,,,251,251,251,251,251,251,251,251,251,251,251,251,251',
-'251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,444,251',
-',,,251,251,251,251,251,251,251,251,,,,,,,,,,,,,,,,,,,444,444,444,444',
-'444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444,444',
-'444,444,444,444,444,444,444,156,,,,,444,444,444,444,444,444,444,444',
-',,,,,,,,,,,,,,,,,,156,156,156,156,156,156,156,156,156,156,156,156,156',
-'156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,386,,,,',
-'156,156,156,156,156,156,156,156,,,,,,,,,,,,,,,,,,,386,386,386,386,386',
-'386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386,386',
-'386,386,386,386,386,386,71,386,,,,386,386,386,386,386,386,386,386,,',
-',,,,,,,,,,,,,,,,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71',
-'71,71,71,71,71,71,71,71,71,71,550,,,,,71,71,71,71,71,71,71,71,,,,,,',
-',,,,,,,,,,,,550,550,550,550,550,550,550,550,550,550,550,550,550,550',
-'550,550,550,550,550,550,550,550,550,550,550,550,550,550,554,550,,,,550',
-'550,550,550,550,550,550,550,,,,,,,,,,,,,,,,,,,554,554,554,554,554,554',
-'554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554',
-'554,554,554,554,554,566,554,,,,554,554,554,554,554,554,554,554,,,,,',
-',,,,,,,,,,,,,566,566,566,566,566,566,566,566,566,566,566,566,566,566',
-'566,566,566,566,566,566,566,566,566,566,566,566,566,566,,566,,,,566',
-'566,566,566,566,566,566,566,464,464,464,464,464,464,464,464,464,464',
-'464,,,,,,,,,,,,,,,,,,,,,,,,,,,,464,464,464,464,464,464,464,244,244,244',
+'250,250,250,250,250,250,250,250,250,156,,,,,250,250,250,250,250,250',
+'250,250,,,,,,,,,,,,,,,,,,,156,156,156,156,156,156,156,156,156,156,156',
+'156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156',
+',,,,,156,156,156,156,156,156,156,156,622,622,622,622,622,622,622,622',
+'622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622,622',
+'622,622,622,,,,,,622,622,622,622,622,622,622,622,40,40,40,40,40,40,40',
+'40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,,,,,',
+'40,40,40,40,40,40,40,40,705,705,705,705,705,705,705,705,705,705,705',
+'705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705',
+',,,,,705,705,705,705,705,705,705,705,244,244,244,244,244,244,244,244',
 '244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244',
-'244,244,244,244,244,244,244,244,,,,,,244,244,244,244,244,244,244,244',
-'40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40',
-'40,40,40,40,40,,,,,,40,40,40,40,40,40,40,40,289,289,289,289,289,289',
-'289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289',
-'289,289,289,289,289,,,,,,289,289,289,289,289,289,289,289,709,709,709',
+'244,244,244,,,,,,244,244,244,244,244,244,244,244,519,519,519,519,519',
+'519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519',
+'519,519,519,519,519,519,,,,,,519,519,519,519,519,519,519,519,709,709',
 '709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709,709',
-'709,709,709,709,709,709,709,709,,,,,,709,709,709,709,709,709,709,709',
-'519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519,519',
-'519,519,519,519,519,519,519,519,519,519,519,,,,,,519,519,519,519,519',
-'519,519,519,622,622,622,622,622,622,622,622,622,622,622,622,622,622',
-'622,622,622,622,622,622,622,622,622,622,622,622,622,622,,,,,,622,622',
-'622,622,622,622,622,622,705,705,705,705,705,705,705,705,705,705,705',
-'705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705,705',
-',,,,,705,705,705,705,705,705,705,705,239,239,239,239,239,239,239,239',
-'239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239',
-'239,239,239,,,,,,239,239,239,239,239,239' ]
-        racc_action_check = arr = ::Array.new(3623, nil)
+'709,709,709,709,709,709,709,709,709,,,,,,709,709,709,709,709,709,709',
+'709,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289',
+'289,289,289,289,289,289,289,289,289,289,289,289,,,,,,289,289,289,289',
+'289,289,289,289,239,239,239,239,239,239,239,239,239,239,239,239,239',
+'239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,,,,,,239',
+'239,239,239,239,239' ]
+        racc_action_check = arr = ::Array.new(3593, nil)
         idx = 0
         clist.each do |str|
@@ -967,95 +968,95 @@
 
 racc_action_pointer = [
-   nil,  1442,    -1,  1586,  1989,   nil,   nil,   nil,   602,   527,
-   nil,   nil,   nil,   nil,   nil,   nil,  1993,   nil,   nil,   nil,
+   nil,   613,    -1,   620,  1492,   nil,   nil,   nil,   612,   627,
+   nil,   nil,   nil,   nil,   nil,   nil,   680,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,  1340,   nil,  1985,   nil,
-  3295,   123,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,  2182,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  1974,  1964,
-  1919,  2991,  1910,  1890,  1888,   198,  1876,  1866,   nil,  1806,
-  1852,   nil,   679,   nil,  1816,   122,   655,   nil,   607,   174,
-   nil,   nil,   190,   nil,  1786,  1766,   nil,   nil,   nil,   nil,
-  1821,  1744,   550,   nil,  1805,   nil,  1804,   nil,  1788,   nil,
-  1787,   nil,   nil,   nil,  1784,   587,   nil,  1775,  1774,  1772,
-   nil,   nil,  1771,  1714,  1711,    77,  1706,   350,  1627,  1628,
-   nil,  1558,   nil,  1538,   nil,   nil,  1592,  1477,  1549,  1481,
-   nil,  1480,   nil,   nil,  1539,   nil,  1663,  1133,   285,  1177,
-  2340,  1531,  1520,   nil,    27,   nil,  2873,    45,   nil,  1495,
-  1520,   271,  1895,   nil,  1502,  1505,  1481,  1500,  1478,  1312,
-  1607,   538,   476,  1423,  1344,  1343,   525,  1328,  1300,  1260,
-   nil,   692,   nil,  1287,  1290,   184,   nil,   156,   nil,  1276,
-   450,   nil,    -6,   nil,   -65,  1277,   nil,   nil,  1159,   nil,
-   nil,   nil,   nil,   nil,   nil,   nil,  1232,  1709,   nil,   nil,
-   437,  1801,  1823,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   590,   741,   751,   893,   767,  1204,  1186,  1174,  1157,
-   774,   nil,   nil,   nil,  1915,  1178,  1155,   nil,   nil,  3541,
-  1157,   nil,  1124,   nil,  3254,  1665,  1017,   nil,   nil,   nil,
-  2578,  2755,   nil,   592,   612,   nil,  1131,   414,   149,   nil,
-  1324,   nil,   248,   nil,   332,   814,  1135,   271,   nil,   599,
-   nil,  1102,  1119,   nil,  1081,   nil,  1079,   nil,   430,   nil,
-  1069,  1098,  1060,  1088,  1055,  1035,   176,   nil,  1322,  3336,
-  1687,    97,   nil,  2637,   291,   nil,   nil,   802,   nil,   nil,
-   nil,   nil,   nil,    80,   nil,   nil,  1002,   984,   177,   980,
-   nil,   nil,   nil,   nil,   nil,   183,   nil,   nil,   797,   nil,
-   nil,   nil,   nil,   nil,   961,   199,   900,   857,   nil,    -2,
-   nil,   nil,   nil,   254,   858,   787,   nil,   840,   838,   nil,
-   206,  1503,   829,   811,   nil,  1367,   nil,  1300,  1253,  1208,
-  1155,  1110,   993,   971,   949,   926,   857,   787,   720,   695,
-  2191,  2143,  2121,  2051,  2029,  2007,   447,   nil,   811,   nil,
-   nil,   nil,  2460,  1321,   nil,   342,   nil,   nil,   nil,   nil,
-   804,   792,   788,   770,   754,   nil,  2932,   nil,   nil,   806,
-   nil,   nil,   330,   nil,   654,   643,   524,   nil,   nil,   nil,
-   nil,   516,   470,   461,   nil,   nil,   nil,   458,   381,   423,
-   383,   308,   359,   271,    69,   nil,  2032,   nil,   nil,  2032,
-   nil,   nil,   -37,   nil,  2233,  2029,  1981,   nil,  1967,   nil,
-  1078,  1893,  1965,   nil,     0,   nil,   nil,  2008,   nil,   nil,
-   nil,   nil,  1911,  2005,  2814,  2696,  1999,    73,   nil,   nil,
-   -32,   nil,   599,   nil,    31,   nil,   nil,   nil,   nil,  2519,
-   -16,   155,   192,   255,  3160,   328,   nil,   nil,   nil,    -8,
-    81,   nil,   370,   nil,   439,   nil,   596,   537,  2279,   495,
-   474,   nil,   nil,   484,   nil,   nil,   nil,   741,   526,   849,
-   861,   871,   900,   912,   935,   856,   717,   951,   671,   671,
-   676,   685,   710,   nil,   553,   995,   nil,   nil,   nil,   nil,
-  1660,   253,   197,   651,  1959,  1459,   nil,   nil,  1664,  3418,
-   634,  1551,  1573,  1595,   nil,   874,   891,   nil,   892,   877,
-   925,   930,   nil,   940,   953,   940,   975,   947,   992,   977,
-   nil,   nil,   nil,   969,  1006,   nil,  1084,   638,  1027,   587,
-  3050,   nil,   nil,   310,  3109,   nil,   nil,  1003,    78,  1081,
-    13,   284,   nil,    92,   642,  1096,  3168,   nil,   305,   nil,
-  1109,   nil,   996,    77,   nil,  1893,   -11,   130,  1108,   nil,
-   484,  1617,  2401,  1159,  1937,   nil,  1179,   nil,  1178,   nil,
-   nil,  1867,   nil,   nil,   nil,   nil,    14,    26,  1211,   356,
-  1222,   nil,  1079,   nil,  1234,  1235,  1237,  1250,  1252,   448,
-   nil,  1198,   nil,     0,   nil,   nil,  1277,   nil,   nil,  1279,
-   nil,   nil,  3459,   nil,   nil,   346,   524,   nil,   nil,   nil,
-    12,    79,  1272,   nil,  1300,   nil,  1305,  1286,  1289,   nil,
-  1319,  1326,    25,  1304,  1305,   nil,  1337,   nil,  1315,   nil,
-   nil,  1231,   nil,   465,   nil,   nil,   nil,   577,  1337,   nil,
-   nil,   nil,  1364,  1365,  1256,  1350,  1377,   nil,  1398,  2235,
-   nil,  1426,   nil,  1430,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,  1525,   nil,   387,   nil,   nil,   nil,  1409,  1437,
-   nil,  1454,  1456,  1432,  1463,  1451,   887,  1479,   nil,  1480,
-  1457,  1500,   nil,    24,   nil,  3500,  1345,  1448,   nil,  3377,
-  1275,  1523,   nil,   nil,  1231,   nil,   496,   nil,  1540,  1063,
-   384,    76,   nil,   nil,   nil,  1521,   nil,  1549,   nil,  1041,
-  1437,  1544,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   888,
-   nil,   nil,  1026,  1049,   nil,   nil,  1595,   nil,  1018,  1594,
-   nil,   548,   nil,   nil,   nil,  1587,   262,   nil,   nil,   nil,
-  1591,  1626,   nil,  1632,  1632,   nil,  1634,  1613,  1614,  1641,
-  1531,  1656,  1633,  1674,   nil,  1648,  1683,    75,   352,   nil,
-  1686,  1678,   115,  1665,   344,   nil,   nil,   nil,   nil,   nil,
-   nil,   nil,   nil,  1729,   nil,   nil,   834,   812,   nil,  1742,
-   nil,   547,   nil,   nil,   nil,   nil,   765,   nil,   330,   nil,
-  1753,  2213,   229,   nil,  1783,  1784,  1672,  1761,   nil,   nil,
-   nil,  1674,  1771,  2165,     8,   nil,   nil,  1322,  1791,   nil,
-   nil,   nil,   nil,  1824,   544,  2099,  1828,  1815,  2073,    89,
-  1819,   598,   nil,   -13,   nil,  1838,  1865,   nil,   673,   nil,
-  1843,   205,  1879,  1883,   nil,  1854,    -9,   nil,   nil,   628,
-  1892,  1867,   575,  1917,   nil,   nil,   464,   nil,   nil,  1887,
-   nil,   nil,  1932,  1936,  1936,   nil,  1959,  1900,  1932,   591,
-   399,  1944,  1945,  1928,   nil,   nil,   nil,   nil,   nil,   521,
-   nil,   nil,   nil,    11,   539,   100,   nil,   595,   581,   nil,
-   nil,   614,  1845,   nil,   650,   765,   966,   nil,  1643,  1577,
+   nil,   nil,   nil,   nil,   nil,   nil,  2268,   nil,   694,   nil,
+  3265,   123,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,  2185,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   702,   712,
+   721,  2888,   717,   719,   729,   115,   738,   742,   nil,   704,
+   770,   nil,   921,   nil,   755,    75,   359,   nil,  1610,   174,
+   nil,   nil,    89,   nil,   730,   742,   nil,   nil,   nil,   nil,
+   807,   755,   496,   nil,   827,   nil,   836,   nil,   840,   nil,
+   858,   nil,   nil,   nil,   862,   586,   nil,   877,   889,   891,
+   nil,   nil,   905,   909,   917,    27,   922,   606,   866,   870,
+   nil,   892,   nil,   903,   nil,   nil,   979,   888,   983,  1040,
+   nil,  1044,   nil,   nil,  1106,   nil,  1500,  1268,   484,  2000,
+  2416,  1115,  1107,   nil,    26,   nil,  3183,   448,   nil,  1094,
+  1123,    97,  1591,   nil,  1124,  1129,   575,  1127,  1143,  1031,
+  2017,   282,   350,  1146,  1147,  1149,   335,  1163,  1164,  1134,
+   nil,   848,   nil,  1163,  1168,   184,   nil,   156,   nil,  1171,
+   218,   nil,    -6,   nil,   -65,  1178,   nil,   nil,  1081,   nil,
+   nil,   nil,   nil,   nil,   nil,   nil,  1179,  1019,   nil,   nil,
+   437,  2228,  2206,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   880,   687,   729,   989,   767,  1182,  1177,  1178,  1179,
+   132,   nil,   nil,   nil,   553,  1222,  1220,   nil,   nil,  3511,
+  1225,   nil,  1196,   nil,  3347,  2107,  1268,   nil,   nil,   nil,
+  3124,  3065,   nil,  2116,   612,   nil,  1230,  1176,   130,   nil,
+  1615,   nil,   480,   nil,   367,   767,  1244,    76,   nil,    -1,
+   nil,  1217,  1245,   nil,  1227,   nil,  1228,   nil,   524,   nil,
+  1237,  1270,  1241,  1271,  1252,  1261,   197,   nil,  1329,  3470,
+  2048,   271,   nil,  2534,   291,   nil,   nil,   778,   nil,   nil,
+   nil,   nil,   nil,   177,   nil,   nil,  1232,  1233,   198,  1234,
+   nil,   nil,   nil,   nil,   nil,   183,   nil,   nil,   867,   nil,
+   nil,   nil,   nil,   nil,  1252,    10,  1197,  1313,   nil,    -2,
+   nil,   nil,   nil,   190,  1328,  1274,   nil,  1337,  1339,   nil,
+   206,  1588,  1336,  1345,   nil,  1658,   nil,  1636,  1750,  1772,
+  1794,  1816,  1842,  1864,  1886,  1908,  1934,  1956,   651,  1978,
+   695,   720,   787,   673,  1544,  1452,   325,   nil,  1350,   nil,
+   nil,   nil,  2475,  1495,   nil,   692,   nil,   nil,   nil,   nil,
+  1361,  1363,  1364,  1365,  1375,   nil,  2947,   nil,   nil,   936,
+   nil,   nil,   342,   nil,  1384,  1386,  1387,   nil,   nil,   nil,
+   nil,  1382,  1400,  2162,   nil,   nil,   nil,  1402,  1347,  1404,
+  1426,  1368,  1429,  1430,  1428,   nil,  1440,   nil,   nil,  1442,
+   nil,   nil,   -37,   nil,  1611,  1443,  1422,   nil,  1424,   nil,
+   476,  1355,  1426,   nil,   599,   nil,   nil,  1471,   nil,   nil,
+   nil,   nil,  1373,  1467,  2593,  2652,  1441,   -11,   nil,   nil,
+  1444,   nil,   601,   nil,  1483,   nil,   nil,   nil,   nil,  3006,
+  1385,  1485,  1488,  1501,  2163,  1477,   nil,   nil,   nil,    -8,
+   254,   nil,  1509,   nil,  2026,   nil,   593,   597,  2294,   628,
+  1516,   nil,   nil,  1521,   nil,   nil,   nil,   877,   954,   791,
+   804,   855,   890,  1087,   596,   978,  1063,   815,  1515,  1509,
+  1509,  1518,  1518,   nil,  1427,   709,   nil,   nil,   nil,   nil,
+   958,    81,   261,  2184,   949,    12,   nil,   nil,   592,  3388,
+   590,   461,   495,   521,   nil,  1544,  1563,   nil,    80,  1536,
+  1568,  1570,   nil,  1572,  1588,  1559,  1591,  1562,  1593,   318,
+   nil,   nil,   nil,  1572,  1604,   nil,   937,   937,  1603,   857,
+  2711,   nil,   nil,   310,  2770,   nil,   nil,  1547,    79,  1613,
+    13,   355,   nil,    92,   900,  1618,  2829,   nil,   437,   nil,
+  1620,   nil,  1507,   344,   nil,  1148,    73,   433,  1597,   nil,
+   541,  1199,  2355,  1627,  1244,   nil,  1636,   nil,  1635,   nil,
+   nil,  1291,   nil,   nil,   nil,   nil,    14,    27,  1639,   430,
+  1640,   nil,  1331,   nil,  1658,  1660,  1661,  1657,  1680,   240,
+  1587,  1626,   nil,     0,   nil,   nil,  1687,   nil,   nil,  1689,
+   nil,   nil,  3224,   nil,   nil,   332,   578,   nil,   nil,   nil,
+  1519,    78,  1660,   nil,  1716,   nil,  1721,  1689,  1692,   nil,
+  1720,  1733,    75,  1703,  1720,   nil,  1753,   nil,  1723,   nil,
+   nil,  1638,   nil,   521,   nil,   nil,   nil,   577,  1742,   nil,
+   nil,   nil,  1769,  1770,  1661,  1747,  1789,   nil,  1795,  2125,
+   nil,  1794,   nil,  1798,   nil,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   743,   nil,   844,   nil,   nil,   nil,  1768,  1811,
+   nil,   176,   256,  1788,  1819,  1790,  1493,  1817,   nil,  1825,
+  1801,  1829,   nil,    74,   nil,  3306,  1405,  1772,   nil,  3429,
+  1383,  1837,   nil,   nil,  1360,   nil,   587,   nil,  1845,  1313,
+   384,    76,   nil,   nil,   nil,  1815,   nil,  1842,   nil,  1221,
+  1746,  1837,   nil,   nil,   nil,   nil,   nil,   nil,   nil,  1611,
+   nil,   nil,  1006,   482,   nil,   nil,  1867,   nil,  1101,  1864,
+  1788,   447,   nil,   nil,   nil,  1858,   596,   nil,   nil,   nil,
+  1859,  1885,   nil,  1908,  1909,   nil,  1911,  1882,  1891,  1918,
+  1808,  1920,  1902,  1933,   nil,  1907,  1934,    -9,   284,   nil,
+  1951,  1927,   199,  1485,   576,   nil,   nil,   nil,   nil,   nil,
+   nil,   nil,   nil,  1954,   nil,   nil,   904,   812,   nil,  1930,
+   nil,   513,   nil,   nil,   nil,   nil,  2092,   nil,   330,   nil,
+  1947,   835,   240,   nil,  1975,  1976,  1864,  1970,   nil,   nil,
+   nil,  1884,  1974,   982,     8,   nil,   nil,  1474,  1982,   nil,
+   nil,   nil,   nil,  2014,   525,   927,  2015,  1987,   857,   253,
+  1996,   399,   nil,   -13,   nil,  1997,  2024,   nil,  2070,   nil,
+  2000,   205,    -5,    30,   nil,    52,    25,   nil,   nil,  1126,
+   117,    97,   765,   197,   nil,   nil,   180,   nil,   nil,   217,
+   nil,   nil,   279,   291,   379,   nil,   418,   367,   433,   534,
+   412,   454,   467,   460,   nil,   nil,   nil,   nil,   nil,   439,
+   nil,   nil,   nil,    11,   533,   100,   nil,   539,   512,   nil,
+   nil,   558,   414,   nil,   576,   594,   567,   nil,  1566,   606,
    nil ]
 
@@ -1200,5 +1201,5 @@
    665,   nil,   nil,   nil,   nil,   nil,   671,   596,   597,   588,
    nil,   nil,   553,   557,   673,   nil,   238,   nil,   763,   622,
-   853,   nil,   766,   nil,   nil,   nil,   530,   553,   nil,   nil,
+   853,   nil,   766,   nil,   610,   nil,   530,   553,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   664,   nil,
@@ -1216,5 +1217,5 @@
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   696,
    nil,   873,   nil,   792,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,   464,   nil,   nil,   339,   nil,   nil,   nil,   nil,   nil,
+   nil,   464,   nil,   nil,   339,   nil,   nil,   750,   610,   nil,
    nil,   769,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,   894,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
@@ -1280,5 +1281,5 @@
     23,   nil,   nil,   nil,   nil,   nil,    23,     4,     4,    23,
    nil,   nil,    45,    45,    55,   nil,    28,   nil,     6,    47,
-    84,   nil,     6,   nil,   nil,   nil,     5,    45,   nil,   nil,
+    84,   nil,     6,   nil,     4,   nil,     5,    45,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    47,   nil,
@@ -1296,5 +1297,5 @@
    nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    25,
    nil,     6,   nil,    32,   nil,   nil,   nil,   nil,   nil,   nil,
-   nil,    45,   nil,   nil,    22,   nil,   nil,   nil,   nil,   nil,
+   nil,    45,   nil,   nil,    22,   nil,   nil,     4,     4,   nil,
    nil,    47,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    nil,     6,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
@@ -2943,5 +2944,5 @@
   def _reduce_104(val, _values, result)
     			# tag が無い場合、内部名を与える
-			result = StructType.new( :"$TAG_#{@@no_struct_tag_num}" )
+			result = StructType.new( :"TAG__#{@@no_struct_tag_num}__" )
 			@@no_struct_tag_num += 1
 			StructType.set_define( true )
@@ -3749,5 +3750,5 @@
 module_eval(<<'.,.,', 'bnf.y.rb', 802)
   def _reduce_233(val, _values, result)
-    	result = [val[0].val]		
+    	result = [val[0]]		
     result
   end
@@ -3756,5 +3757,5 @@
 module_eval(<<'.,.,', 'bnf.y.rb', 804)
   def _reduce_234(val, _values, result)
-    	result << val[2].val		
+    	result << val[2]		
     result
   end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.y.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.y.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/bnf.y.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2016 by TOPPERS Project
+#   Copyright (C) 2008-2018 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -379,5 +379,5 @@
 		{
 			# tag が無い場合、内部名を与える
-			result = StructType.new( :"$TAG_#{@@no_struct_tag_num}" )
+			result = StructType.new( :"TAG__#{@@no_struct_tag_num}__" )
 			@@no_struct_tag_num += 1
 			StructType.set_define( true )
@@ -800,8 +800,8 @@
 
 region_name_list
-        : IDENTIFIER
-		{	result = [val[0].val]		}
-        | region_name_list ',' IDENTIFIER
-		{	result << val[2].val		}
+        : namespace_identifier
+		{	result = [val[0]]		}
+        | region_name_list ',' namespace_identifier
+		{	result << val[2]		}
 
 const_statement
@@ -1807,5 +1807,5 @@
                   string += line
                   # この位置では error メソッドは使えない (token 読出し前)
-                  puts "error: #{file} line #{lineno}: string literal has newline without escape"
+                  puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape"
                   @@n_error += 1
                 end
@@ -1848,8 +1848,9 @@
                   b_in_string = true
                   # この位置では error メソッドは使えない (token 読出し前) # mikan cdl_error ではない
-                  puts "error: #{file} line #{lineno}: string literal has newline without escape"
+                  puts "#{file}:#{lineno}:#{col}: error: string literal has newline without escape"
                   @@n_error += 1
                 # 山括弧で囲まれた文字列
-                when /\A<[0-9A-Za-z_\. \/]+>/   # AB: angle bracke
+                # when /\A<[0-9A-Za-z_\. \/]+>/   # AB: angle bracke
+                when /\A<(?:[^>\\]|\\.)*>/   # これはうまく行くようだ
                   @q << [:AB_STRING_LITERAL, Token.new($&, file, lineno, col)]
                 # 行コメント
@@ -1981,5 +1982,5 @@
       end
       if locale then
-        Console.puts "error: #{locale[0]}: line #{locale[1]} #{msg}"
+        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: error: #{msg}"
       else
         Console.puts "error: #{msg}"
@@ -2014,5 +2015,5 @@
       end
       if locale then
-        Console.puts "warning: #{locale[0]}: line #{locale[1]} #{msg}"
+        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: warning: #{msg}"
       else
         Console.puts "warning: #{msg}"
@@ -2047,5 +2048,5 @@
       end
       if locale then
-        Console.puts "info: #{locale[0]}: line #{locale[1]} #{msg}"
+        Console.puts "#{locale[0]}:#{locale[1]}:#{locale[2]}: info: #{msg}"
       else
         Console.puts "info: #{msg}"
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/componentobj.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/componentobj.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/componentobj.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2017 by TOPPERS Project
+#   Copyright (C) 2008-2019 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -149,5 +149,5 @@
     end
 
-    set_descriptor_list
+    # set_descriptor_list ##
 
     if @generate then
@@ -364,4 +364,14 @@
   end
 
+  @@set_descriptor_list = {}
+  def self.set_descriptor_list
+    Namespace.get_root.travers_all_signature{ |sig|
+      if @@set_descriptor_list[ sig ] == nil then
+        @@set_descriptor_list[ sig ] = true
+        sig.set_descriptor_list
+      end
+    }
+  end
+
   #== Signature# 引数で参照されている Descriptor 型のリストを作成する
   def set_descriptor_list
@@ -538,7 +548,9 @@
 # @ct_factory_list::    Factory[] :    celltype factory
 # @cell_list:: Cell[] : 定義のみ (V1.0.0.2 以降)
+# @ordered_cell_list:: Cell[] : ID 順に順序付けされたセルリスト、最適化以降有効 (リンク単位ごとに生成されなおす)
 # @singleton:: bool
 # @idx_is_id:: bool
 # @idx_is_id_act:: bool: actual value
+# @b_need_ptab:: bool: true if having cells in multi-domain
 # @active:: bool
 # @b_reuse:: bool :  reuse 指定されて import された(template 不要)
@@ -654,8 +666,11 @@
     if $idx_is_id then
       @idx_is_id = true
+      @idx_is_id_act = true
+      @b_need_ptab = true
     else
       @idx_is_id = false
-    end
-    @idx_is_id_act = @idx_is_id
+      @idx_is_id_act = false
+      @b_need_ptab = false
+    end
 
     Namespace.new_celltype( self )
@@ -700,5 +715,5 @@
     end
 
-    check_dynamic_join
+    # check_dynamic_join ##
 
     @@current_object = nil
@@ -886,4 +901,5 @@
         @idx_is_id = true
         @idx_is_id_act = true
+        @b_need_ptab = true
       when :ACTIVE
         @active = true
@@ -899,4 +915,5 @@
     if @singleton then
       @idx_is_id_act = false
+      @b_need_ptab = false
     end
   end
@@ -999,6 +1016,17 @@
   end
 
+  @@dynamic_join_checked_list = {}
+  def self.check_dynamic_join
+    Namespace.get_root.travers_all_celltype{ |ct|
+      if @@dynamic_join_checked_list[ ct ] == nil then
+        @@dynamic_join_checked_list[ ct ] = true
+        ct.check_dynamic_join
+      end
+    }
+  end
+
   #=== Celltype#dynamic の適合性チェック
   def check_dynamic_join
+    return if ! $verbose
     @port.each{ |port|
       signature = port.get_signature
@@ -1038,5 +1066,5 @@
               end
             end
-            cdl_warning( 'W9999 "$1" cannot handle Descriptor "$2" infromation for port "$3"', @name, param.get_name, port.get_name )
+            cdl_warning( 'W9999 "$1" cannot handle Descriptor "$2" information for port "$3"', @name, param.get_name, port.get_name )
           }
         end
@@ -1143,12 +1171,14 @@
   #     呼び口（ただし、最適化で不要となるものは除く）
   def has_INIB?
-#    print "name=#{@name} @n_attribute_ro=#{@n_attribute_ro}  @n_var_size_is=#{@n_var_size_is} @n_call_port=#{@n_call_port} @n_call_port_omitted_in_CB=#{@n_call_port_omitted_in_CB} @n_entry_port_array_ns=#{@n_entry_port_array_ns}\n"
-    return $rom &&
-      (@n_attribute_ro > 0 ||
-       @n_var_size_is > 0 ||
-       ( @n_call_port - @n_call_port_omitted_in_CB - (@n_call_port_dynamic-@n_call_port_array_dynamic) ) > 0 ||
-       $ram_initializer && @n_call_port_dynamic ||
-       @n_entry_port_array_ns > 0)
-#    return $rom && (@n_attribute_ro > 0 || ( @n_call_port - @n_call_port_omitted_in_CB ) > 0)
+
+    result = $rom &&
+             (@n_attribute_ro > 0 ||
+              @n_var_size_is > 0 ||
+              ( @n_call_port - @n_call_port_omitted_in_CB - (@n_call_port_dynamic-@n_call_port_array_dynamic) ) > 0 ||
+              $ram_initializer && @n_call_port_dynamic > 0 ||
+              @n_entry_port_array_ns > 0)
+    # print "name=#{@name} n_attribute_ro=#{@n_attribute_ro}  n_var_size_is=#{@n_var_size_is} n_call_port=#{@n_call_port} n_call_port_omitted_in_CB=#{@n_call_port_omitted_in_CB} n_call_port_dynamic=#{@n_call_port_dynamic} n_call_port_array_dynamic=#{@n_call_port_array_dynamic} n_entry_port_array_ns=#{@n_entry_port_array_ns} has_INIB?=#{result}\n"
+
+    return result
   end
 
@@ -1231,4 +1261,8 @@
   def idx_is_id_act?
     @idx_is_id_act
+  end
+
+  def multi_domain?
+    @b_need_ptab
   end
 
@@ -1353,4 +1387,5 @@
 #                                               逆require ポートに対して複数の結合がないかチェックする
 # @generate:: [ Symbol, String, Plugin ]  = [ PluginName, option, Plugin ] Plugin は生成後に追加される
+# @b_post_code_generated:: Bool: true if generated in tmp_plugin_post_code.cdl
 #
 # composite のためインスタンス変数
@@ -1375,5 +1410,7 @@
 # @id:: Integer : コード生成直前に設定  (プロトタイプ宣言の場合は -1 のまま放置)
 # @id_specified::Integer : 指定された id
-# @restrict_list::{ entry_name => { func_name, [ region_name, ... ] } }
+# @restrict_list::{ entry_name => { func_name, [ region_path_str, ... ] } }
+# @restrict_list2::{ entry_name => { func_name, [ domain_root_region, ... ] } }
+# @b_restrict_referenced::Bool: restrict_list が参照れた
 
 =begin
@@ -1459,4 +1496,7 @@
     @referenced_port_list = {}
     @restrict_list = {}
+    @restrict_list2 = {}
+    @b_restrict_referenced = false
+    @b_post_code_generated = false
 
     @cell_list = {}
@@ -1803,4 +1843,7 @@
       set_specifier_list( Generator.get_statement_specifier )
     end
+    if TECSGEN.post_coded?
+      @b_post_code_generated = true
+    end
     set_f_def f_def
 
@@ -1820,6 +1863,7 @@
     if ! @in_composite then
       # if @celltype.instance_of? Celltype then
+      if @celltype then  # composite でも呼びだす, エラー時 nil
         @celltype.new_cell self
-      # end
+      end
       @@cell_list << self
     end
@@ -2132,4 +2176,18 @@
   end
 
+  #=== Cell# composite のセルか？
+  def is_of_composite?
+    if @celltype.kind_of? CompositeCelltype
+      return true
+    else
+      return false
+    end
+  end
+
+  #=== Cell# tmp_plugin_post_code.cdl で生成されたセルか？
+  def post_code_generated?
+    @b_post_code_generated
+  end
+
   # composite cell の port に対応する内部の cell の port の名前（リンク時に必要な名前）
   def get_real_global_name port_name
@@ -2219,4 +2277,6 @@
 
       # セルタイプ内で port_name の CompositeCelltypeJoin を探す（コード生成段階では必ず見つかる）
+      # print "get_real_cell: cell=#{@name} port=#{port_name}\n"
+      # pp @cell_list
       cj = @celltype.find_export( port_name )
 
@@ -2230,4 +2290,13 @@
   end
 
+  #=== Cell#get_real_celltype
+  #
+  def get_real_celltype( port_name )
+    if @celltype.instance_of?( CompositeCelltype ) then
+      return @celltype.get_real_celltype port_name
+    else
+      return @celltype
+    end
+  end
 
   #=== Cell# 受け口のport の参照カウントをアップする
@@ -2270,4 +2339,16 @@
       return "#{@global_name}_#{port_name}"
     end
+  end
+
+  #Cell#属性の初期値を得る
+  #attr_name::Symbol  必ず初期化されていないと Ruby 例外となる
+  def get_attr_initializer attr_name
+    val = @join_list.get_item( attr_name )
+    if val == nil then
+      val = (@celltype.find  attr_name).get_initializer
+    else
+      val = val.get_rhs
+    end
+    return val
   end
 
@@ -2520,6 +2601,12 @@
         else
           cell = j.get_rhs_cell2
-          next if cell == nil     # 右辺が見つからなかった．既にエラー
+          next if cell == nil || cell.get_celltype == nil     # 右辺が見つからなかった．既にエラー
           port = cell.get_celltype.find( j.get_rhs_port2 )
+          if port == nil then
+            dbgPrint "set_port_ref: #{@name}.#{j.get_name} = #{cell.get_name}.#{j.get_rhs_port2}\n"
+            # through プラグインで生成されたセルの受け口が見つからないケース (のハズ)
+            cdl_error( "entry '$1' not found in '$2' refered from $3.$4", j.get_rhs_port2, cell.get_name, @name, j.get_name )
+            next
+          end
           dbgPrint( "set_port_reference_count: #{@name}.#{j.get_name} => #{cell.get_name}.#{port.get_name}\n")
           cell.port_referenced port
@@ -2966,72 +3053,111 @@
   #=== Cell#restrict を追加
   def add_restrict( entry_name, func_name, region_name_list )
-    if @restrict_list[ entry_name ] then
-      if @restrict_list[ entry_name ][ func_name ] then
-        @restrict_list[ entry_name ][ func_name ].each{ |rn|
-          if region_name_list.include? rn then
-            # p func_name
-            name = func_name ? entry_name : entry_name+"."+func_name
-            cdl_warning( "W9999 $1 restrict region duplicate $2", name, rn )
+    if @restrict_list[ entry_name ] == nil then
+      @restrict_list[ entry_name ] = {}
+      @restrict_list2[ entry_name ] = {}
+    end
+    if @restrict_list[ entry_name ][ func_name ] == nil then
+      @restrict_list[ entry_name ][ func_name ] = []
+      @restrict_list2[ entry_name ][ func_name ] = []
+    end
+    region_name_list.each { |rp|
+      @restrict_list[ entry_name ][ func_name ] << rp
+      # p "Class: " + rp.to_s
+      obj = Namespace.find rp
+      if ( obj.kind_of? Region ) then
+        @restrict_list2[ entry_name ][ func_name ] << obj.get_domain_root
+      else
+        cdl_error( "S9999 $1 not found or not region", rp.to_s )
+      end
+    }
+  end
+
+  #=== Cell#check_restrict_list
+  def check_restrict_list
+    # p "check_restrict_list"
+    @restrict_list.each{ |entry_name, func_hash|
+      func_hash.each{ |func_name, region_list|
+        region_list.each{ |rp|
+          obj = Namespace.find rp
+          if ( obj.kind_of? Region ) then
+            if obj.get_domain_root != @region.get_domain_root then
+            else
+              cdl_info( "I9999 $1: restrict calling domain to $2, which is same domain as the cell locates", @name, rp.to_s )
+              # restrict を同じドメインを指定してもよいこととする (HRP3)
+              # KernelDoamin 内のセルに対し、KernelDomain に restrict している場合、
+              # 無所属経由で結合されているが、KernelDomain から呼出すことを想定した許可
+            end
+          else
+            cdl_error( "S9999 $1 not region", rp.to_s )
+          end
+        }
+      }
+    }
+  end
+
+  #=== Cell#callable?
+  def callable?( callee_cell, entry_name, func_name )
+    # p "callable? #{@name}"
+    res = callee_cell.callable_from?( entry_name, func_name, self )
+    dbgPrint "callable? #{callee_cell.get_namespace_path}.#{entry_name}.#{func_name} from #{@NamespacePath} is #{res}\n"
+    return res
+  end
+
+  #=== Cell#callable_from? (private)
+  def callable_from?( entry_name, func_name, caller_cell )
+    @b_restrict_referenced = true
+    if @restrict_list.length == 0 then
+      return true
+    end
+
+    dr = caller_cell.get_region.get_domain_root
+    if @restrict_list[entry_name] then
+      if @restrict_list[entry_name][func_name] then
+        @restrict_list2[entry_name][func_name].each{ |region|
+          if dr == region then
+            return true
+          end
+        }
+      elsif @restrict_list[entry_name][nil] then
+        @restrict_list2[entry_name][nil].each{ |region|
+          if dr == region then
+            return true
           end
         }
       else
-        @restrict_list[ entry_name ][ func_name ] = region_name_list
-      end
-    else
-      func_list = { }
-      func_list[ func_name ] = region_name_list
-      @restrict_list[ entry_name ] = func_list
-    end
-    # pp @restrict_list
-  end
-
-  #=== Cell#check_restrict_list
-  def check_restrict_list
-    @restrict_list.each{ |entry_name, func_hash|
-      func_hash.each{ |func_name, region_list|
-        region_list.each{ |rn|
-          obj = Namespace.find [ rn ]
-          if ( obj.kind_of? Region ) then
-            if obj.get_domain_root != @region.get_domain_root then
-            else
-              cdl_warning( "W9999 $1 in same domain", rn )
-            end
-          else
-            cdl_error( "S9999 $1 not region", region )
-          end
-        }
-      }
-    }
-  end
-
-  #=== Cell#callable?
-  def callable?( callee_cell, entry_name, func_name )
-    res = callee_cell.callable_from?( entry_name, func_name, self )
-    dbgPrint "callable? #{callee_cell.get_namespace_path}.#{entry_name}.#{func_name} from #{@NamespacePath} is #{res}\n"
-    return res
-  end
-
-  #=== Cell#callable_from? (private)
-  def callable_from?( entry_name, func_name, caller_cell )
-    if @restrict_list.length == 0 then
+        return false
+      end
+    else
+      return false
+    end
+  end
+
+  #=== Cell#get_callable_regions( entry_name, func_name )
+  # func_name=nil の場合、entry_name の可否をチェック数る
+  # nil が返る場合、制限されていないことを意味する
+  def get_restricted_regions( entry_name, func_name )
+    # p "get_restricted_regions #{@name}"
+    @b_restrict_referenced = true
+    if @restrict_list[entry_name] then
+      if @restrict_list[entry_name][func_name] then
+        return @restrict_list2[entry_name][func_name]
+      else
+        return @restrict_list2[entry_name][nil]
+      end
+    end
+    return nil
+  end
+
+  #=== Cell#has_ineffective_restrict_specifier
+  # restrict 指定子が指定されていて、参照されていない場合 true
+  # 参照は、HRPSVCPlugin のみ
+  def has_ineffective_restrict_specifier
+    if @restrict_list.length != 0 && @b_restrict_referenced == false then
       return true
-    end
-
-    if @restrict_list[entry_name] then
-      if @restrict_list[entry_name][nil] &&
-         @restrict_list[entry_name][nil].include?( caller_cell.get_region.get_domain_root.get_name )then
-        return true
-      end
-      if @restrict_list[entry_name][func_name] &&
-         @restrict_list[entry_name][func_name].include?( caller_cell.get_region.get_domain_root.get_name )then
-        return true
-      else
-        return false
-      end
-    else
-      return true
-    end
-  end
-  
+    else
+      return false
+    end
+  end
+
   def show_tree( indent )
     indent.times { print "  " }
@@ -3709,4 +3835,8 @@
   end
 
+  def get_global_name
+    @global_name
+  end
+
   def get_port_list
     @port_list
@@ -3723,4 +3853,16 @@
   def get_internal_allocator_list
     @internal_allocator_list
+  end
+
+  #== CompositeCelltype#get_real_celltype
+  # port_name に接続されている内部のセルタイプを得る
+  def get_real_celltype( port_name )
+    cj = find_export port_name
+    inner_celltype = cj.get_cell.get_celltype
+    if inner_celltype.instance_of? CompositeCelltype then
+      return inner_celltype.get_real_celltype
+    else
+      return inner_celltype
+    end
   end
 
@@ -3936,5 +4078,5 @@
     else
       # entry port optimize
-      if $unopt then
+      if $unopt || $unopt_entry then
         # 最適化なし
         @b_VMT_useless = false                     # VMT 不要 (true の時 VMT を介することなく呼出す)
@@ -4260,9 +4402,21 @@
 
   def is_VMT_useless?                     # VMT 関数テーブルを使用しない
-   @b_VMT_useless
+    if @port_type == :ENTRY && $unopt_entry == true then
+      # プラグインから $unopt_entry を設定するケースのため
+      # ここで読み出すときに、false を返す (reset_optimize での設定変更は速すぎる)
+      return false
+    else
+      return @b_VMT_useless
+    end
   end
 
   def is_skelton_useless?                 # スケルトン関数不要   (true の時、受け口関数を呼出す)
-    @b_skelton_useless
+    if @port_type == :ENTRY && $unopt_entry == true then
+      # プラグインから $unopt_entry を設定するケースのため
+      # ここで読み出すときに、false を返す (reset_optimize での設定変更は速すぎる)
+      return false
+    else
+      return @b_skelton_useless
+    end
   end
 
@@ -4801,7 +4955,7 @@
       if ! c.get_f_def then   # Namespace の @cell_list にはプロトタイプが含まれるケースあり
         if c.get_f_ref then
-          cdl_error( "S1093 $1 : undefined cell" , c.get_namespace_path.get_path_str )
+          c.cdl_error( "S1093 $1 : undefined cell" , c.get_namespace_path.get_path_str )
         elsif $verbose then
-          cdl_warning( "W1006 $1 : only prototype, unused and undefined cell" , c.get_namespace_path.get_path_str )
+          c.cdl_warning( "W1006 $1 : only prototype, unused and undefined cell" , c.get_namespace_path.get_path_str )
         end
       else
@@ -4810,5 +4964,8 @@
         # if c.get_f_ref == false && c.is_generate? && ct && ct.is_inactive? then
         if c.get_f_ref == false && ct && ct.is_inactive? then
-          cdl_warning( "W1007 $1 : non-active cell has no entry join and no factory" , c.get_namespace_path.get_path_str )
+          c.cdl_warning( "W1007 $1 : non-active cell has no entry join and no factory" , c.get_namespace_path.get_path_str )
+        end
+        if c.has_ineffective_restrict_specifier then
+          c.cdl_warning( "W9999: $1 has ineffective restrict specifier", c.get_namespace_path.get_path_str )
         end
       end
@@ -5005,4 +5162,16 @@
   end
 
+  #== Namespace (Region) に属するセルのリスト
+  def get_cell_list
+    @cell_list
+  end
+
+  #== Namespace (Region)# 子リージョンのリスト
+  #
+  # リージョンは Namespace クラスで namespace として記憶されている
+  def get_region_list
+    @namespace_list
+  end
+  
   def show_tree( indent )
     indent.times { print "  " }
@@ -5601,4 +5770,5 @@
           next_cell_nsp       = @through_generated_list[ i + 1 ].get_cell_namespace_path
           next_port_name      = @through_generated_list[ i + 1 ].get_through_entry_port_name
+          next_port_subscript = @through_generated_list[ i + 1 ].get_through_entry_port_subscript
         rescue Exception => evar
           cdl_error( "S1124 $1: plugin function failed: \'get_through_entry_port_name\'" , plugin_name )
@@ -5619,4 +5789,5 @@
         next_cell      = @cell
         next_port_name = @port_name
+        next_port_subscript = @rhs_subscript
 
         if next_cell == nil then
@@ -5630,5 +5801,5 @@
         # region から @cell_name.@port_name への through がないか探す
         # rp = @through_list[i][3].find_cell_port_through_plugin( @cell_name, @port_name ) #762
-        rp = @through_list[i][3].find_cell_port_through_plugin( @cell.get_global_name, @port_name )
+        rp = @through_list[i][3].find_cell_port_through_plugin( @cell.get_global_name, @port_name, @rhs_subscript )
            # @through_list[i] と @region_through_list[i-cp_len] は同じ
         # 共用しないようにするには、見つからなかったことにすればよい
@@ -5643,5 +5814,5 @@
         plClass = load_plugin( plugin_name, ThroughPlugin )
         if( plClass ) then
-          gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, plClass )
+          gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, next_port_subscript, plClass )
         end
       else
@@ -5656,5 +5827,5 @@
           # 生成したものを region(@through_list[i][3]) のリストに追加
           # @through_list[i][3].add_cell_port_through_plugin( @cell_name, @port_name, @through_generated_list[i] ) #762
-          @through_list[i][3].add_cell_port_through_plugin( @cell.get_global_name, @port_name, @through_generated_list[i] )
+          @through_list[i][3].add_cell_port_through_plugin( @cell.get_global_name, @port_name, @rhs_subscript, @through_generated_list[i] )
         end
       end
@@ -5690,5 +5861,5 @@
 
   #=== Join# through プラグインを呼び出して CDL 生成させるとともに、import する
-  def gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, plClass )
+  def gen_through_cell_code_and_parse( plugin_name, i, next_cell, next_port_name, next_port_subscript, plClass )
 
     through = @through_list[ i ]
@@ -5717,5 +5888,7 @@
 
     begin
-      plugin_object = plClass.new( "#{generating_cell_name}".to_sym, plugin_arg.to_s, next_cell, "#{next_port_name}".to_sym, @definition.get_signature, @celltype, caller_cell )
+      plugin_object = plClass.new( generating_cell_name.to_sym, plugin_arg.to_s,
+                                   next_cell, next_port_name.to_sym, next_port_subscript,
+                                   @definition.get_signature, @celltype, caller_cell )
       plugin_object.set_locale @locale
     rescue Exception => evar
@@ -5912,5 +6085,12 @@
   end
 
-  def get_rhs_subscript
+  # 末尾数字1 : CDL で指定された、右辺のセルを返す
+  def get_rhs_cell1   # get_cell と同じ
+    @cell
+  end
+  def get_rhs_port1   # get_port_name 同じ
+    @port_name
+  end
+  def get_rhs_subscript1
     @rhs_subscript
   end
@@ -5922,7 +6102,5 @@
     # through 指定あり？
     if @through_list[0] then
-      # mikan through で生成したものが root namespace 限定
       # through で生成されたセルを探す
-#      cell = Namespace.find( [ "::", @through_generated_list[0].get_cell_name.to_sym ] )    #1
       cell = Namespace.find( @through_generated_list[0].get_cell_namespace_path )    #1
       # cell のプラグインで生成されたポート名のポートを探す (composite なら内部の繋がるポート)
@@ -5931,4 +6109,16 @@
       # ポートを返す(composite なら内部の繋がるポートを返す)
       return @cell.get_real_port( @port_name )
+    end
+  end
+
+  #=== Join# 右辺の配列添数を得る
+  #    右辺が through の場合は挿入されたセルの添数
+  #    右辺が composite の場合は、内部の繋がるセルのポートの添数 (composite では変わらない)
+  #    このメソッドは get_rhs_cell,  と対になっている
+  def get_rhs_subscript
+    if @through_list[0] then
+      return @through_generated_list[0].get_through_entry_port_subscript
+    else
+      return @rhs_subscript
     end
   end
@@ -6568,5 +6758,5 @@
 end
 
-#== Domain
+#== DomainType
 #
 # region の domain を記憶するクラス
@@ -6607,4 +6797,5 @@
       return if pluginClass == nil
       @plugin = pluginClass.new( @region, @name, @option )
+      @plugin.set_locale @locale
     end
   end
@@ -6624,5 +6815,5 @@
   end
 
-  #== Domain リージョンの Hash を得る
+  #== DomainType リージョンの Hash を得る
   # @@domain_regions の説明参照
   def self.get_domain_regions
@@ -6636,4 +6827,10 @@
   def get_option
     @option
+  end
+
+  #== DomainType#ドメイン種別を得る
+  #return::Symbol :kernel, :user, :OutOfDomain
+  def get_kind
+    @plugin.get_kind
   end
 
@@ -6697,4 +6894,5 @@
 
     if @@domain_name then
+      dbgPrint "Region=#{name} domain_type=#{@@domain_name} option=#{@@domain_option}\n"
       domain_option = CDLString.remove_dquote @@domain_option.to_s
       @domain_type = DomainType.new( self, @@domain_name, domain_option )
@@ -6945,4 +7143,10 @@
   end
 
+  #== Region# ルートリージョン
+  # ルートリージョンは、namespace のルートと同じインスタンス
+  def selfget_root
+    Namespace.get_root
+  end
+
   def next_in_through_count
     @in_through_count += 1
@@ -6978,10 +7182,16 @@
   #=== Region# through プラグインで、この region から cell_name.port_name へのプラグインオブジェクトを登録
   # mikan namesppace 対応 (cell_name)
-  def add_cell_port_through_plugin( cell_name, port_name, through_plugin_object )
-    @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}" ] = through_plugin_object
-  end
-
-  def find_cell_port_through_plugin( cell_name, port_name )
-    return @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}" ]
+  def add_cell_port_through_plugin( cell_name, port_name, subscript, through_plugin_object )
+    if subscript then
+      subscript = '[' + subscript.to_s + ']'
+    end
+    @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}#{subscript}" ] = through_plugin_object
+  end
+
+  def find_cell_port_through_plugin( cell_name, port_name, subscript )
+    if subscript then
+      subscript = '[' + subscript.to_s + ']'
+    end
+    return @cell_port_throug_plugin_list[ "#{cell_name}.#{port_name}#{subscript}" ]
   end
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/ctypes.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/ctypes.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/ctypes.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -122,5 +122,6 @@
       #   TECS には long double を表現する手段がない (double80_t を定義すればよいか?)
 #      cdl_warning( "C1003 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.class, another.class, self.class )
-      cdl_warning( "W9999 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.get_type_str, another.get_type_str, self.get_type_str )
+#      cdl_warning( "W9999 $1 & $2 incompatible (\'long double\' is not supported.). Treated as $3." , self.get_type_str, another.get_type_str, self.get_type_str )
+      self.to_long      
       return self
     else
@@ -185,4 +186,11 @@
   end
 
+  def to_long
+    if @bit_size != -64 then
+      cdl_warning( "W9999 long specified for $1" , get_type_str )
+    else
+      @bit_size = -128  # @bit_size = -128 : long double
+    end
+  end
 end
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/expression.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/expression.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/expression.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/generate.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/generate.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/generate.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2017 by TOPPERS Project
+#   Copyright (C) 2008-2019 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -122,4 +122,5 @@
 
 class Namespace
+  @@domain_gen_factory_list = nil
   def generate
 
@@ -135,4 +136,7 @@
           return
         end
+        if instance_of? Region then
+          @@domain_gen_factory_list = {}   # create hash
+        end
       end
 
@@ -141,4 +145,13 @@
       gen_global_header
 
+      if ( instance_of? Region ) && get_domain_type != nil then
+        # p "*******************  domain_type: #{get_domain_type.get_name}  ****************"
+        domain_type = get_domain_type
+        if @@domain_gen_factory_list[ domain_type ] == nil then
+          @@domain_gen_factory_list[ domain_type ] = self
+          domain_type.gen_factory
+        end
+      end
+      
       # signature のコードを生成
       @signature_list.each { |s|
@@ -455,5 +468,5 @@
       }
     end
-	f.print "	rm -f $(CELLTYPE_COBJS) $(TECSGEN_COBJS) $(PLUGIN_COBJS) $(OTHER_OBJS) $(TARGET) #{timestamp}\n"
+	  f.print "	rm -f $(CELLTYPE_COBJS) $(TECSGEN_COBJS) $(PLUGIN_COBJS) $(OTHER_OBJS) $(TARGET) #{timestamp}\n"
     if $generating_region == @@root_namespace then
       f.print "	rm -rf $(GEN_DIR)\n"
@@ -465,7 +478,6 @@
       f.print "tecs : $(PRE_TECSGEN_TARGET) $(TIMESTAMP) $(POST_TECSGEN_TARGET)\n\n"
       f.print "$(TIMESTAMP) : $(TECS_IMPORTS)\n"
-      f.print "	$(TECSGEN) #{TECSGEN.subst_tecspath( $arguments, true )}\n"
+      f.print "	$(TECSGEN) #{TECSGEN.subst_tecspath( $arguments, true )}\n\n"
       # f.print "	touch $(TIMESTAMP)\n\n"
-
     else
       f.print "tecs:\n"
@@ -473,4 +485,44 @@
     end
 
+    # tecsflow:, tcflow ターゲット
+    if $generating_region.get_n_cells != 0 || $generating_region == @@root_namespace then
+      f.print "#####  TECSFlow targets  #####\n"
+    end
+
+    if Region.get_link_roots.length > 1 && $generating_region == @@root_namespace then
+      tecsflow_target = "tecsflow_sub"
+      if $generating_region.get_n_cells > 0 then
+        f.print "tecsflow: tecs tecsflow_sub\n"
+      else
+        f.print "tecsflow:\n"
+      end
+      Region.get_link_roots.each {|region|
+        if region.get_n_cells > 0 then
+          f.print "\tcd #{region.get_global_name}; make tecsflow\n"
+        end
+      }
+      f.print "\n"
+    else
+      tecsflow_target = "tecsflow"
+    end
+
+    if $generating_region.get_n_cells != 0 then
+      f.print "#{tecsflow_target} : $(GEN_DIR)/tecsgen.rbdmp tcflow\n"
+      f.print "\ttecsflow -g $(GEN_DIR)\n\n"
+      f.print "tecsflow_u : $(GEN_DIR)/tecsgen.rbdmp tcflow\n"
+      f.print "\ttecsflow -g $(GEN_DIR) -U\n\n"
+      f.print "$(GEN_DIR)/tecsgen.rbdmp : tecs\n\n"
+      f.print "tcflow : tecs\n"
+      f.print "\tmake tcflow_exec\n\n"
+      f.print "tcflow_exec : $(GEN_DIR)/tcflow.rbdmp\n"
+      f.print "$(GEN_DIR)/tcflow.rbdmp : $(CELLTYPE_SRCS) $(PLUGIN_CELLTYPE_SRCS)\n"
+      f.print "\ttcflow -g $(GEN_DIR) -c '$(CC) -E -DTECSFLOW -DTECSGEN $(CFLAGS) -I ./' $^\n"
+    end
+
+    if $generating_region.get_n_cells != 0 || $generating_region == @@root_namespace then
+      f.print "#####  end TECSFlow targets  #####\n\n"
+    end
+
+    # generic %.o : %.c
     f.print "# generic target for objs\n"
     f.print "$(_TECS_OBJ_DIR)%.o : %.#{$c_suffix}\n"
@@ -492,4 +544,46 @@
     ### Makefile.tecsgen の生成
     f = AppFile.open( "#{$gen}/Makefile.tecsgen" )
+
+    f.print <<EOT
+# generated automatically by tecsgen.
+# This file is not intended to modify.
+#
+# Makefile variables below are defined.
+#  TECS_IMPORT_CDLS          .cdl files improted by import statement
+#  SIGNATURE_HEADERS         .h files of signature
+#  CELLTYPE_TECSGEN_HEADERS  .h files of celltype
+#  CELLTYPE_FACTORY_HEADERS  .h files of celltype's factory
+#  TECS_HEADERS              summary of .h files above
+#  TECS_INLINE_HEADERS       .h files of celltype inline header
+#  PLUGIN_INLINE_HEADERS     .h files of plugin generated inline header
+#
+#  TECS_COBJS                .o files of TECS
+#                            = $(TECSGEN_COBJS)+$(PLUGIN_COBJS)+$(CELLTYPE_COBJS)
+#                            = $(TECS_KERNEL_COBJS)+$(TECS_KERNEL_COBJS)+$(TECS_OUTOFDOMAIN_COBJS)
+#                            = $(TECSGEN_domain_COBJS)+$(PLUGIN_domain_COBJS)+$(CELLTYPE_domain_COBJS) for each domain
+#
+#  TECSGEN_COBJS             .o files of celltype_tecsgen.c
+#  CELLTYPE_COBJS            .o files of celltype.c (celltype code)
+#  PLUGIN_COBJS              .o files of plugin generated .c files
+#
+#  TECSGEN_SRCS              .c files of celltype_tecsgen.c
+#  CELLTYPE_SRCS             .c files of celltype.c (celltype code)
+#  PLUGIN_SRCS               .c files of plugin generated
+#  PLUGIN_CELLTYPE_SRCS      .c files of plugin generated celltype.c (celltype code)
+#  PLUGIN_TECSGEN_SRCS       .c files of plugin generated celltype_tecsgen.c
+#
+# Variables for domain
+#  TECS_DOMAINS             domain names
+#  TECS_KERNEL_COBJS        .o files of kernel domain (tecsgen, celltype, plugin)
+#  TECS_USER_COBJS          .o files of user domain (tecsgen, celltype, plugin)
+#  TECS_OUTOFDOMAIN_COBJS   .o files of OutOfDomain (tecsgen, celltype, plugin)
+#  TECSGEN_domain_COBJS     .o files of celltype_tecsgen.c files for each domain
+#  PLUGIN_domain_COBJS      .o files of plugin generated .c files for each domain
+#  CELLTYPE_domain_COBJS    .o files of celltype.c files for each domain
+#  TECSGEN_domain_SRCS      .c files of celltype_domain_tecsgen.c
+#  PLUGIN_domain_SRCS       .c files of plugin generated .c files for each domain
+#  CELLTYPE_domain_SRCS     .c files of celltype.c files for each domain
+
+EOT
 
     f.print( "TECS_IMPORT_CDLS =" )
@@ -546,4 +640,5 @@
     DomainType.get_domain_regions.each{ |dt, regions|
       # domain_type は一つのノードには、一つしかないので、このループは、必ず一回しか回らない
+        ###   mikan 複数のノードがあり、異なる domain_type が指定される可能性はある
       domain_regions = regions
       domain_type = dt
@@ -588,5 +683,38 @@
       f.print( "\n\n" )
 
-      f.print( "# TECS_COBJS: objects from sources which are automatically generated by tecsgen\n" )
+      f.print( "# TECS_KERNEL_COBJS: objects belong to kernel domain\n" )
+      f.print( "TECS_KERNEL_COBJS = \\\n" )
+      domain_regions.each{ |r|
+        if r.get_domain_type.get_kind == :kernel then
+          f.print( "	$(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
+          f.print( "	$(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
+          f.print( "	$(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
+        end
+      }
+      f.print( "# TECS_KERNEL_COBJS terminator\n\n" )
+
+      f.print( "# TECS_USER_COBJS: objects belong to user domain\n" )
+      f.print( "TECS_USER_COBJS = \\\n" )
+      domain_regions.each{ |r|
+        if r.get_domain_type.get_kind == :user then
+          f.print( "	$(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
+          f.print( "	$(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
+          f.print( "	$(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
+        end
+      }
+      f.print( "# TECS_USER_COBJS terminator\n\n" )
+
+      f.print( "# TECS_OUTOFDOMAIN_COBJS: objects belong to OutOfDomain\n" )
+      f.print( "TECS_OUTOFDOMAIN_COBJS = \\\n" )
+      domain_regions.each{ |r|
+        if r.get_domain_type.get_kind == :OutOfDomain then
+          f.print( "	$(TECSGEN#{decideDomainNameProc.call r}_COBJS) \\\n" )
+          f.print( "	$(PLUGIN#{decideDomainNameProc.call r}_COBJS) \\\n" )
+          f.print( "	$(CELLTYPE#{decideDomainNameProc.call r}_COBJS) \\\n" )
+        end
+      }
+      f.print( "# TECS_OUTOFDOMAIN_COBJS terminator\n\n" )
+      
+      f.print( "# TECSGEN_COBJS: objects from sources which are automatically generated by tecsgen\n" )
       f.print( "TECSGEN_COBJS = \\\n" )
       domain_regions.each{ |r|
@@ -622,5 +750,5 @@
 
     ###
-    f.print( "# TECS_COBJS: objects from sources which are automatically generated by tecsgen\n" )
+    f.print( "# TECSGEN_COBJS: objects from sources which are automatically generated by tecsgen\n" )
     domain_regions.each{ |r|
       nsp = decideDomainNameProc.call( r )
@@ -656,12 +784,32 @@
 
     f.print( "# PLUGIN_SRCS: sources automatically generated by plugin\n" )
+    f.print( "PLUGIN_CELLTYPE_SRCS = \\\n" )
     domain_regions.each{ |r|
       nsp = decideDomainNameProc.call( r )
-      f.print( "PLUGIN#{nsp}_SRCS = \\\n" )
-      gen_celltype_names_domain( f, "	$(GEN_DIR)/", "_tecsgen.#{$c_suffix} \\\n", domain_type, r, true )
-      gen_celltype_names_domain2( f, "	$(GEN_DIR)/", ".#{$c_suffix} \\\n", domain_type, r, true, false )
-      f.print( "# PLUGIN#{nsp}_SRCS terminator\n\n" )
-    }
-
+      f.print( "  $(PLUGIN#{nsp}_CELLTYPE_SRCS)\\\n" )
+    }
+    f.print( "# PLUGIN_CELLTYPE_SRCS terminator\n\n" )
+    f.print( "PLUGIN_TECSGEN_SRCS = \\\n" )
+    domain_regions.each{ |r|
+      nsp = decideDomainNameProc.call( r )
+      f.print( "  $(PLUGIN#{nsp}_TECSGEN_SRCS)\\\n" )
+    }
+    f.print( "# PLUGIN_TECSGEN_SRCS terminator\n\n" )
+    domain_regions.each{ |r|
+      nsp = decideDomainNameProc.call( r )
+      f.print( "PLUGIN#{nsp}_SRCS = $(PLUGIN#{nsp}_CELLTYPE_SRCS) $(PLUGIN#{nsp}_TECSGEN_SRCS)\n\n" )
+      f.print( "PLUGIN#{nsp}_CELLTYPE_SRCS = \\\n" )
+      gen_celltype_names_domain2( f, "", ".#{$c_suffix} \\\n", domain_type, r, true, false )
+      f.print( "# PLUGIN#{nsp}_CELLTYPE_SRCS terminator\n\n" )
+      nsp = decideDomainNameProc.call( r )
+      f.print( "PLUGIN#{nsp}_TECSGEN_SRCS = \\\n" )
+      gen_celltype_names_domain( f, "", "_tecsgen.#{$c_suffix} \\\n", domain_type, r, true )
+      f.print( "# PLUGIN#{nsp}_TECSGEN_SRCS terminator\n\n" )
+    }
+
+    f.print( "# CELLTYPE_SRCS: sources of celltype code written by user\n" )
+     f.print( "CELLTYPE_SRCS = \\\n" )
+     gen_celltype_names( f, "	", ".#{$c_suffix} \\\n", false, false )
+      f.print( "# CELLTYPE_SRCS terminator\n\n" )
     f.close
 
@@ -779,4 +927,23 @@
     @namespace_list.each{ |ns|
       ns.travers_all_signature_proc proc
+    }
+  end
+
+  #=== Namespace#すべてのセルタイプをたどる
+  def travers_all_celltype # ブロック引数 { |celltype|  }
+    proc = Proc.new    # このメソッドのブロック引数
+    @celltype_list.each{ |ct|
+      proc.call ct
+    }
+    @namespace_list.each{ |ns|
+      ns.travers_all_celltype_proc proc
+    }
+  end
+  def travers_all_celltype_proc proc
+    @celltype_list.each{ |ct|
+      proc.call ct
+    }
+    @namespace_list.each{ |ns|
+      ns.travers_all_celltype_proc proc
     }
   end
@@ -1023,5 +1190,9 @@
     gen_ph_get_cellcb f
     gen_ph_attr_access f          if @n_attribute_rw > 0 || @n_attribute_ro > 0 || @n_var > 0
-    gen_ph_cp_fun_macro f         if @n_call_port > 0
+    f.print "#ifndef TECSFLOW\n"
+    gen_ph_cp_fun_macro f, false  if @n_call_port > 0
+    f.print "#else  /* TECSFLOW */\n"
+    gen_ph_cp_fun_macro f, true   if @n_call_port > 0
+    f.print "#endif /* TECSFLOW */\n"
 #    gen_ph_abstract_ep_des_type f
 
@@ -1247,4 +1418,6 @@
   def gen_ph_info f
 
+    yn_multi_domain = "no"
+    yn_multi_domain = "yes" if multi_domain?
     yn_idx_is_id = "no"
     yn_idx_is_id = "yes"  if @idx_is_id
@@ -1255,4 +1428,8 @@
     yn_rom       = "no"
     yn_rom       = "yes"  if $rom
+    yn_has_CB    = "no"
+    yn_has_CB    = "yes"  if has_CB?
+    yn_has_INIB  = "no"
+    yn_has_INIB  = "yes"  if has_INIB?
     yn_cb_init   = "no"
     yn_cb_init   = "yes"  if need_CB_initializer?
@@ -1263,8 +1440,9 @@
  * celltype          :  #{@name}
  * global name       :  #{@global_name}
+ * multi-domain      :  #{yn_multi_domain}
  * idx_is_id(actual) :  #{yn_idx_is_id}(#{yn_idx_is_id_act})
  * singleton         :  #{yn_singleton}
- * has_CB            :  #{has_CB?}
- * has_INIB          :  #{has_INIB?}
+ * has_CB            :  #{yn_has_CB}
+ * has_INIB          :  #{yn_has_INIB}
  * rom               :  #{yn_rom}
  * CB initializer    :  #{yn_cb_init}
@@ -1595,5 +1773,5 @@
       f.print( "#define #{@global_name}_GET_CELLCB(idx) ((void *)0)\n" )
     elsif @idx_is_id_act then   # mikan 単一のセルの場合の最適化, idx_is_id でない場合
-      f.print( "#define #{@global_name}_GET_CELLCB(idx) (#{@global_name}_CB_tab[(idx) - #{@global_name}_ID_BASE])\n" )
+      f.print( "#define #{@global_name}_GET_CELLCB(idx) (#{@global_name}_CB_ptab[(idx) - #{@global_name}_ID_BASE])\n" )
     else
       f.print( "#define #{@global_name}_GET_CELLCB(idx) (idx)\n" )
@@ -1799,6 +1977,6 @@
   end
 
-  def gen_ph_cp_fun_macro f
-    if @n_call_port >0 then
+  def gen_ph_cp_fun_macro f, b_flow
+    if @n_call_port >0 && b_flow == false then
       f.printf( TECSMsg.get( :CPM_comment ) , "#_CPM_#" )
     end
@@ -1856,5 +2034,7 @@
 
         # 関数名の出力(標準：受け口ディスクリプタから VMT の関数名、最適化：受け口関数 or 受け口ディスクリプタ)
-        if ! p.is_VMT_useless? then
+        if b_flow then
+          f.print( "\t  (p_that)->#{p.get_name}#{subsc}.#{fun.get_name}__T( \\\n" )
+        elsif ! p.is_VMT_useless? then
           # 標準コード
           if @singleton then
@@ -1891,5 +2071,6 @@
 
         # 受け口情報の出力(標準：受け口ディスクリプタ、最適化：IDX など)
-        if ! p.is_skelton_useless? && ! p.is_cell_unique? then
+        if b_flow then
+        elsif ! p.is_skelton_useless? && ! p.is_cell_unique? then
           # 標準コード
           if @singleton then
@@ -1969,5 +2150,5 @@
         p_cellcb = "    #{@global_name}_CB *p_cellcb = p_that;\n"
         delim = ", "
-        cb = "p_that#{inib}->"
+        cb = "p_cellcb#{inib}->"
       end
 
@@ -2616,23 +2797,45 @@
         f.print "extern  #{@global_name}_INIB  #{@global_name}_SINGLE_CELL_INIB;\n"
       end
-
-#     @ordered_cell_list.each{ |c|
-#        f.print "extern  #{@global_name}_CB  #{@global_name}_#{c.get_name}_CB;\n"
-#      }
-
       f.print "\n"
-    elsif @idx_is_id_act then
-      f.print "extern #{@global_name}_CB  *#{@global_name}_CB_tab[];\n"
+    elsif @b_need_ptab then
+      f.printf( TECSMsg.get( :SCP_comment ),  "#_MCPP_#" )
+      if has_CB? then
+        f.print "extern #{@global_name}_CB  *const #{@global_name}_CB_ptab[];\n"
+        @ordered_cell_list.each{ |c|
+          if c.is_generate? then                           # 生成対象か？
+            name_array = get_name_array c
+            f.print "extern #{@global_name}_CB  #{name_array[4]};\n"
+          end
+        }
+      elsif has_INIB?
+        f.print "extern #{@global_name}_INIB  *const #{@global_name}_INIB_ptab[];\n"
+        @ordered_cell_list.each{ |c|
+          if c.is_generate? then                           # 生成対象か？
+            name_array = get_name_array c
+            f.print "extern #{@global_name}_INIB  #{name_array[11]};\n"
+          end
+        }
+      end
     else
-      f.print "extern #{@global_name}_CB  #{@global_name}_CB_tab[];\n"
+      f.printf( TECSMsg.get( :SCP_comment ),  "#_MCPB_#" )
+      if has_CB? then
+        f.print "extern #{@global_name}_CB  #{@global_name}_CB_tab[];\n"
+      elsif has_INIB?
+        f.print "extern #{@global_name}_INIB  #{@global_name}_INIB_tab[];\n"
+      end
     end
   end
 
   def gen_ph_INIB_as_CB f
-
+    # ここは、手抜きである。本来なら INIB を出力すべき
     if ! has_CB? && has_INIB? then
       f.printf( TECSMsg.get( :DCI_comment ),  "#_DCI_#" )
-      f.print "#define #{@global_name}_CB_tab           #{@global_name}_INIB_tab\n"
-      f.print "#define #{@global_name}_SINGLE_CELL_CB   #{@global_name}_SINGLE_CELL_INIB\n"
+      if @singleton then
+        f.print "#define #{@global_name}_SINGLE_CELL_CB   #{@global_name}_SINGLE_CELL_INIB\n"
+      elsif @b_need_ptab then
+        f.print "#define #{@global_name}_CB_ptab           #{@global_name}_INIB_ptab\n"
+      else
+        f.print "#define #{@global_name}_CB_tab           #{@global_name}_INIB_tab\n"
+      end
       f.print "#define #{@global_name}_CB               #{@global_name}_INIB\n"
       f.print "#define tag_#{@global_name}_CB           tag_#{@global_name}_INIB\n"
@@ -2658,13 +2861,15 @@
       f.printf( TECSMsg.get( :FEC_comment ), "#_FEC_#" )
 
-      if @idx_is_id_act then
+      if @b_need_ptab then
         amp = ''
+        tab = 'ptab'
       else
         amp = '&'
+        tab = 'tab'
       end
       f.print <<EOT
 #define FOREACH_CELL(i,p_cb)   \\
     for( (i) = 0; (i) < #{@global_name}_N_CELL; (i)++ ){ \\
-       #{necessity}(p_cb) = #{amp}#{@global_name}_CB_tab[i];
+       #{necessity}(p_cb) = #{amp}#{@global_name}_CB_#{tab}[i];
 
 #define END_FOREACH_CELL   }
@@ -2799,6 +3004,6 @@
         if @singleton then
           f.print "\t#{that}_inib = &#{@global_name}_SINGLE_CELL_INIB;\n\n"
-        elsif @idx_is_id_act
-          f.print "\t#{that}_inib = #{@global_name}_INIB_tab[(i)];\n\n"
+        elsif @b_need_ptab then
+          f.print "\t#{that}_inib = #{@global_name}_INIB_ptab[(i)];\n\n"
         else
           f.print "\t#{that}_inib = &#{@global_name}_INIB_tab[(i)];\n\n"
@@ -3397,5 +3602,5 @@
         fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_SINGLE_CELL_INIB = \n" }
         indent = 0
-      elsif ! @idx_is_id_act then
+      elsif ! @b_need_ptab then
         fs.each{ |r, f| f.print "#{@global_name}_INIB #{@global_name}_INIB_tab[] = {\n" }
         indent = 1
@@ -3418,5 +3623,5 @@
 
         print_indent( f, indent )
-        if @idx_is_id_act then
+        if @b_need_ptab then
           f.print "const #{@global_name}_INIB #{name_array[5]} = "
         end
@@ -3428,5 +3633,5 @@
         unless @singleton then
           # 1 つの cell INIB の終わり
-          if @idx_is_id_act then
+          if @b_need_ptab then
             f.print( "};\n\n" )
           else
@@ -3435,5 +3640,5 @@
         end
       }
-      if ! @idx_is_id_act then
+      if ! @b_need_ptab then
         fs.each{ |r, f| f.print( "};\n\n" ) }
       end
@@ -3450,5 +3655,5 @@
           fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB = \n" }
           indent = 0
-        elsif ! @idx_is_id_act then
+        elsif ! @b_need_ptab then
           fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_CB_tab[] = {\n" }
           indent = 1
@@ -3471,5 +3676,5 @@
 
           print_indent( f, indent )
-          if @idx_is_id_act then
+          if @b_need_ptab then
             f.print "#{@global_name}_CB #{name_array[2]} = "
           end
@@ -3493,5 +3698,5 @@
           unless @singleton then
             # 1 つの cell CB の終わり
-            if @idx_is_id_act then
+            if @b_need_ptab then
               f.print( "};\n\n" )
             else
@@ -3500,5 +3705,5 @@
           end
         }
-        if ! @idx_is_id_act then
+        if ! @b_need_ptab then
           fs.each{ |r, f| f.print( "};\n\n" ) }
         end
@@ -3507,5 +3712,5 @@
           fs.each{ |r, f| f.print "struct tag_#{@global_name}_CB #{@global_name}_SINGLE_CELL_CB;\n" }
           indent = 0
-        elsif @idx_is_id_act then
+        elsif @b_need_ptab then
           @ordered_cell_list.each{ |c|
             next if ! c.is_generate?
@@ -3526,5 +3731,5 @@
   def gen_cell_cb_tab f
     indent = 0
-    if @idx_is_id_act then
+    if @b_need_ptab then
       if has_INIB? && ( $ram_initializer || ! has_CB? ) then
         f.print "/* ID to INIB table #_INTAB_# */\n"
@@ -3537,5 +3742,5 @@
         }
 
-        f.print "#{@global_name}_INIB *#{@global_name}_INIB_tab[] ={\n"
+        f.print "#{@global_name}_INIB *const #{@global_name}_INIB_ptab[] ={\n"
         @ordered_cell_list.each{ |c|
           if c.is_generate? then                           # 生成対象か？
@@ -3557,5 +3762,5 @@
         }
 
-        f.print "#{@global_name}_CB *#{@global_name}_CB_tab[] ={\n"
+        f.print "#{@global_name}_CB *const #{@global_name}_CB_ptab[] ={\n"
         @ordered_cell_list.each{ |c|
           if c.is_generate? then                           # 生成対象か？
@@ -3586,4 +3791,5 @@
   #   name_array[9] = @global_name    # celltype global name
   #   name_array[10] = cell.get_global_name # cell global name
+  #   name_array[11] = cell_INIB_proto #INIB name for proto type
   
   def get_name_array( cell )
@@ -3594,7 +3800,8 @@
       cell_CB_proto = "#{@global_name}_SINGLE_CELL_CB"
       cell_INIB_name = "#{@global_name}_SINGLE_CELL_INIB"
+      cell_INIB_proto = cell_INIB_name
       cell_ID = 0
     else
-      if ! @idx_is_id_act then
+      if ! @b_need_ptab then
         index = cell.get_id - cell.get_celltype.get_id_base
         cell_CB_name = "#{@global_name}_CB_tab[#{index}]"
@@ -3602,4 +3809,5 @@
         cell_CB_proto = "#{@global_name}_CB_tab[]"
         cell_INIB_name = "#{@global_name}_INIB_tab[#{index}]"
+        cell_INIB_proto = "#{@global_name}_INIB_tab[]"
       else
         cell_CB_name = "#{cell.get_global_name}_CB"
@@ -3607,11 +3815,7 @@
         cell_CB_proto = cell_CB_name
         cell_INIB_name = "#{cell.get_global_name}_INIB"
+        cell_INIB_proto = cell_INIB_name
       end
       cell_ID = cell.get_id
-    end
-    if @idx_is_id_act then
-      cell_IDX = cell_ID
-    else
-      cell_IDX = "&#{cell_CB_name}"
     end
 
@@ -3622,4 +3826,10 @@
     else
       cell_CBP = "NULL"    # CB も INIB もなければ NULL に置換
+    end
+
+    if @idx_is_id_act then
+      cell_IDX = cell_ID
+    else
+      cell_IDX = cell_CBP
     end
 
@@ -3636,4 +3846,5 @@
     name_array[9] = @global_name    # celltype global name
     name_array[10] = cell.get_global_name # cell global name
+    name_array[11] = cell_INIB_proto # INIB name for prototype
 
     return name_array
@@ -3820,6 +4031,6 @@
               c = j.get_rhs_cell                    # 呼び先セル
               ct = c.get_celltype                   # 呼び先セルタイプ
+              name_array = ct.get_name_array( c )   # 呼び先セルタイプで name_array を得る
               if ct.has_INIB? || ct.has_CB? then
-                name_array = ct.get_name_array( c )   # 呼び先セルタイプで name_array を得る
                 f.printf( "%-40s /* %s #_CCP2_# */\n", "#{name_array[7]},", p.get_name )
               else
@@ -4107,6 +4318,7 @@
       f = fs[ c.get_region.get_domain_root ]
 
-      ct = c.get_celltype
+      ct = c.get_celltype     # ct = self でも同じ
       jl = c.get_join_list
+      name_array = get_name_array( c )
 
       port = ct.get_port_list
@@ -4143,16 +4355,18 @@
               else
                 if has_CB? then
-                  if @singleton then
-                    f.print "    &#{@global_name}_SINGLE_CELL_CB,        /* CB */\n"
-                  else
-                    # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
-                    f.print "    &#{@global_name}_CB_tab[#{index}],      /* CB */\n"
-                  end
+                  # if @singleton then
+                  #   f.print "    &#{@global_name}_SINGLE_CELL_CB,        /* CB 1 */\n"
+                  # else
+                  #   # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
+                  #   f.print "    &#{@global_name}_CB_tab[#{index}],      /* CB 2 */\n"
+                  # end
+                  f.print "    #{name_array[8]},      /* CB 1 */\n"
                 elsif has_INIB? then
-                  if @singleton then
-                    f.print "    &#{@global_name}_SINGLE_CELL_INIB,      /* INIB */\n"
-                  else
-                    f.print "    &#{@global_name}_INIB_tab[#{index}],    /* INIB */\n"
-                  end
+                  # if @singleton then
+                  #   f.print "    &#{@global_name}_SINGLE_CELL_INIB,      /* INIB 1 */\n"
+                  # else
+                  #   f.print "    &#{@global_name}_INIB_tab[#{index}],    /* INIB 2 */\n"
+                  # end
+                  f.print "    &#{name_array[5]},      /* INIB 1 */\n"
                 else
                   f.print "    0,\n"
@@ -4178,16 +4392,18 @@
             else
               if has_CB? then
-                if @singleton then
-                  f.print "    &#{@global_name}_SINGLE_CELL_CB,       /* CB */\n"
-                else
-                  f.print "    &#{@global_name}_CB_tab[#{index}],     /* CB */\n"
-                  # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
-                end
+                # if @singleton then
+                #   f.print "    &#{@global_name}_SINGLE_CELL_CB,       /* CB 3 */\n"
+                # else
+                #   f.print "    &#{@global_name}_CB_tab[#{index}],     /* CB 4 */\n"
+                #   # f.print "    &#{@global_name}_#{c.get_name}_CB,\n"
+                # end
+                f.print "    #{name_array[8]},      /* CB 3 */\n"
               elsif has_INIB? then
-                if @singleton then
-                  f.print "    &#{@global_name}_SINGLE_CELL_INIB,     /* INIB */\n"
-                else
-                  f.print "    &#{@global_name}_INIB_tab[#{index}],   /* INIB */\n"
-                end
+                # if @singleton then
+                #   f.print "    &#{@global_name}_SINGLE_CELL_INIB,     /* INIB 3 */\n"
+                # else
+                #   # f.print "    &#{@global_name}_INIB_tab[#{index}],   /* INIB 4 */\n"
+                # end
+                f.print "    &#{name_array[5]},      /* INIB 3 */\n"
               else
                 f.print "    0,\n"
@@ -4550,4 +4766,5 @@
   def generate_inline_template_code
     return if @n_entry_port_inline == 0
+    return if @b_reuse && ! $generate_all_template
     if ! ( @plugin && @plugin.gen_ep_func? ) then
       return if @b_reuse && ! $generate_all_template
@@ -4927,13 +5144,13 @@
   #  str に以下の置換を行う
   #-   $ct$ ⇒ セルタイプ名(ct)
-  #-   $cell$ ⇒ セル名(cell)   cell が nil ならば3つの置換は行われない
+  #-   $cell$ ⇒ セル名(cell)   cell が nil ならば以下の置換は行われない
   #-   $cb$ ⇒ CB の C 言語名(cb)
   #-   $cbp$ ⇒ CB へのポインタ(cbp)
   #-   $cb_proto$ ⇒ CB の C 言語名プロトタイプ宣言用(cb_proto)
-  #-   $id$ ⇒ ct_cell
+  #-   $id$ ⇒ $ct$_$cell_global$    # ct_cell  before or same V1.5.2
   #-   $idx$ ⇒ idx
   #-   $ID$ ⇒ id (整数の番号)
   #-   $ct_global$ ⇒ セルタイプ名(ct)
-  #-   $cell_global$ ⇒ セル名(cell)   cell が nil ならば3つの置換は行われない
+  #-   $cell_global$ ⇒ セル名(cell)
   #-   $$   ⇒ $
   def subst_name( str, name_array )
@@ -4950,13 +5167,14 @@
 
     str = str.gsub( /(^|[^\$])\$ct\$/, "\\1#{ct}" )
+    str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" )
     if cell then
       str = str.gsub( /(^|[^\$])\$cell\$/, "\\1#{cell}" )
       str = str.gsub( /(^|[^\$])\$cb\$/, "\\1#{cb}" )
-      str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell}" )
+      # str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell}" )
+      str = str.gsub( /(^|[^\$])\$id\$/, "\\1#{ct}_#{cell_global}" )
       str = str.gsub( /(^|[^\$])\$cb_proto\$/, "\\1#{cb_proto}" )
       str = str.gsub( /(^|[^\$])\$ID\$/, "\\1#{id}" )
       str = str.gsub( /(^|[^\$])\$idx\$/, "\\1#{idx}" )
       str = str.gsub( /(^|[^\$])\$cbp\$/, "\\1#{cbp}" )
-      str = str.gsub( /(^|[^\$])\$ct_global\$/, "\\1#{ct_global}" )
       str = str.gsub( /(^|[^\$])\$cell_global\$/, "\\1#{cell_global}" )
     end
@@ -5078,2 +5296,9 @@
   end
 end
+
+class DomainType < Node
+  def gen_factory
+    # p "DomainType: gen_factory"
+    @plugin.gen_factory
+  end
+end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/location.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/location.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/location.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/messages.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/messages.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/messages.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/optimize.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/optimize.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/optimize.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2018 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -178,4 +178,5 @@
 
   def set_domain
+    domain_cells = {}
     @cell_list.each{ |c|
       if c.is_generate? then
@@ -191,4 +192,9 @@
           @domain_roots[ dn ] = [ dr ]
         end
+        if domain_cells[ dr ]  then
+          domain_cells[ dr ] << c
+        else
+          domain_cells[ dr ] = [ c ]
+        end
       end
     }
@@ -196,10 +202,21 @@
     @domain_roots.each{ |dn, drs|
       drs.uniq!
-      if ! $debug then
-        dbgPrint "domains celltype:#{@name} domain=#{dn} "
+      if $verbose && dn then
+        print "[domain] celltype=#{@name} domainType=#{dn} domainRootRegions={"
+        delim = ""
         drs.each{ |r|
-          dbgPrint " region=#{r.get_name}"
+          print delim, r.get_name
+          delim = ", "
         }
-        dbgPrint "\n"
+        print "}\n"
+        drs.each{ |r|
+          print "[domain] celltype=#{@name} domainRootRegion=#{r.get_name} domainType=#{dn} domainKind=#{r.get_domain_root.get_domain_type.get_kind} domainCells={"
+          delim = ""
+          domain_cells[r].each{ |c|
+            print delim, c.get_name
+            delim = ", "
+          }
+          print "}\n"
+        }
       end
     }
@@ -212,9 +229,12 @@
       # domain_type は一つのノードに一つしかないので、一つの要素を無条件で取り出す
       if regions.length > 1 then
-        cdl_info( "I9999 celltype:#{@name} has cells in multi domain.\n" )
-        if @idx_is_id == false then
-          cdl_info( "I9999 celltype:#{@name} forcely set idx_is_id\n" )
-        end
-        @idx_is_id_act = true
+        if $verbose then
+          cdl_info( "I9999 celltype '$1' has cells in multi-domain.\n", @name )
+        end
+        # if @idx_is_id == false then
+        #   cdl_info( "I9999 celltype '$1' forcely set idx_is_id\n", @name )
+        # end
+        @b_need_ptab = true
+        # @idx_is_id_act = true
       end
     }
@@ -228,4 +248,12 @@
     end
 
+    optimize_call
+    if $unopt_entry == false then
+      optimize_entry
+    end
+  end
+
+  #=== Celltype#呼び口最適化
+  def optimize_call
     @port.each{ |port|
       next if port.get_port_type != :CALL
@@ -361,5 +389,9 @@
       dbgPrint "#{port.get_name} : # of cells : #{port_cells.length}  # of ports : #{port_ports.length}\n"
     }
-
+  end
+
+  #=== Celltype#受け口最適化
+  # optimize_entry は、呼び口最適化の結果を使用している
+  def optimize_entry
     # 受け口最適化の設定
     @port.each{ |port|
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/plugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/plugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/plugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -160,5 +160,5 @@
       #  識別子取得
       if arg =~ /\A[a-zA-Z_]\w*/ then
-        ident = $~
+        ident = $~.to_s    # 
         arg = $'
       else
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/pluginModule.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/pluginModule.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/pluginModule.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/syntaxobj.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/syntaxobj.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/syntaxobj.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2016 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -685,4 +685,11 @@
   end
 
+  #=== Decl# print_flowinfo
+  def print_flowinfo file
+    if @kind == :VAR then
+      file.write "#{@identifier} "
+    end
+  end
+
   def show_tree( indent )
     indent.times { print "  " }
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsgen.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsgen.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsgen.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -250,4 +250,8 @@
     Cell.create_reverse_join
 
+    DescriptorType.check_signature
+    Signature.set_descriptor_list
+    Celltype.check_dynamic_join
+
     #0 set_definition_join は2回呼び出される（1回目）
     dbgPrint( "## Checking all join\n")
@@ -450,4 +454,68 @@
   end # finalize
 
+  def dump_tecsgen_rbdmp
+    dbgPrint "dump_tecsgen_rbdmp 0:\n"
+    #### unjoin_plugin 後に行う必要があるため、コード生成後にダンプを行う
+    #### Region link root ごとにオプティマイズしてダンプ ####
+    Namespace.get_root.unjoin_plugin
+    Namespace.get_root.find_plugin 0, []
+
+    Region.get_link_roots.each { |region|
+      dbgPrint "dump_tecsgen_rbdmp 1: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
+
+      n_cells = region.get_n_cells
+
+      if $region_list.length > 0 then
+        if $region_list[ region.get_namespace_path.get_path_str ] == false then
+          $region_list[ region.get_namespace_path.get_path_str ] = true
+        else
+          next
+        end
+      end
+
+      dbgPrint "dump_tecsgen_rbdmp 2: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
+      # セルが一つもなければ生成しない
+      # セルの生成がない場合
+      if region.get_n_cells == 0 then
+        # if $region_list.length > 0 then
+        #   Generator.warning( "W9999 $1: specified to generate but has no cell", region.get_name )
+        # end
+        if region != @root_namespace then
+          next
+        end
+      end
+
+      dbgPrint "dump_tecsgen_rbdmp 3: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
+      $generating_region = region
+      if Region.get_link_roots.length > 1 then
+        if region.get_name == "::" then
+          $gen = $gen_base
+        else
+          $gen = $gen_base + "/" + region.get_global_name.to_s
+        end
+      else
+        $gen = $gen_base
+      end
+
+      dbgPrint "dump_tecsgen_rbdmp 4: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
+      dbgPrint( "## Unset optimize variables\n")
+      @root_namespace.reset_optimize   # 最適化をリセットする
+
+      #  if Generator.get_n_error == 0 then
+      #   # エラーが発生していたら、ここへは来ない
+         dbgPrint( "## Set cell id\n")
+        @root_namespace.set_cell_id_and_domain      # セルの ID とドメイン情報を設定（linkunit 毎に0からつける）
+
+        # エラーが発生していたら、最適化は実施しない
+        if ! $unopt then
+          dbgPrint( "## Optimizing: Link Region=#{@root_namespace.get_name}\n")
+          @root_namespace.optimize
+        end
+      # end
+      dbgPrint "dump_tecsgen_rbdmp final: Region.path_str: #{region.get_namespace_path.get_path_str}\n"
+      File.write( "#{$gen}/tecsgen.rbdmp", Marshal.dump(Namespace.get_root) )
+    }
+  end
+  
   def self.post_coded?
     @@b_post_coded
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsinfo.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsinfo.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tecsinfo.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2017 by TOPPERS Project
+#   Copyright (C) 2017-2018 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -49,5 +49,7 @@
 #{indent0}region rTECSInfo {
 EOT
-    # mikan 全部生成するのではなく、region 下のセルのセルタイプと、そこから参照されるシグニチャ、セルタイプに限定して出力する．
+    Type.reset_print_info
+
+    # mikan 全部生成するのではなく、region 下のセルのセルタイプと、そこから参照されるシグニチャ、セルタイプに限定して出力すべき
     # しかし、意味解析後に出力するため、これは容易ではない．最適化とコード生成は、リンクルートごとに行われる．
     Namespace.print_info f, indent
@@ -149,4 +151,7 @@
                  "#{tag.get_ID_str}_#{decl.get_name}",
                  "(uint32_t)(intptr_t)&(((#{tag.get_type_str}#{tag.get_type_str_post}*)0)->#{decl.get_name})"
+        f.printf "#define PLACE_OF_%-30s  (%s)\n",
+                 "#{tag.get_ID_str}_#{decl.get_name}",
+                 "VARDECL_PLACE_STRUCT"
       }
     }
@@ -191,4 +196,17 @@
     }
   end
+
+  def print_entry_define f
+    @celltype_list.each { |ct|
+      if ct.get_cell_list.length > 0 then
+        ct.print_entry_define f
+      end
+    }
+    @namespace_list.each { |ns|
+      if ns.instance_of? Namespace then   # region を含めない
+        ns.print_entry_define f
+      end
+    }
+  end
 end
 
@@ -200,10 +218,28 @@
       name = @global_name
     end
+    # p "region:#{get_name}"
     f.print "\n#{indent}/*** #{get_namespace_path} region information cell ***/\n"
     f.print <<EOT
 #{indent}cell nTECSInfo::tRegionInfo #{name}RegionInfo{
 #{indent}    name = "#{@name}";
-#{indent}};
-EOT
+EOT
+    @cell_list.each{ |cell|
+        # print "cell class="+cell.get_celltype.class.name+", " + cell.get_celltype.get_name.to_s + " 1\n"
+      if ! cell.exclude_info? then
+        # print "cell class="+cell.get_celltype.class.name+", " + cell.get_celltype.get_name.to_s + " 2\n"
+        f.print "#{indent}    cCellInfo[] = #{cell.get_global_name}CellInfo.eCellInfo;\n"
+      end
+    }
+    @namespace_list.each { |region|
+      if region.instance_of? Region then
+        f.print "#{indent}    cRegionInfo[] = #{region.get_global_name}RegionInfo.eRegionInfo;\n"
+       end
+    }
+    f.print "#{indent}};\n"
+    @cell_list.each{ |cell|
+      if ! cell.exclude_info? then
+        cell.print_info f, indent
+      end
+    }
   end
 
@@ -221,4 +257,83 @@
     self.print_info_region f, indent
   end
+
+  def self.print_cell_define f
+    region.get_link_root.print_cell_define f
+    region.get_link_root.get_region{ |region|
+      if region.instance_of? Region then
+        region.print_cell_define_offset f
+      end
+
+    }
+  end
+
+  def print_cell_define f
+    ct_list = {}
+    @cell_list.each{ |cell|
+      next if cell.exclude_info_factory?
+      ct_list[ cell.get_celltype ] = true
+    }
+    f.print "#define TOPPERS_CB_TYPE_ONLY\n"
+    ct_list.each{ |ct, val|
+      f.print "#include \"#{ct.get_global_name}_tecsgen.h\"\n"
+    }
+    f.print "\n"
+    @cell_list.each{ |cell|
+      next if cell.exclude_info_factory?
+      name_array = cell.get_celltype.get_name_array cell
+      if cell.get_celltype.has_CB?
+        cb = "(void*)#{name_array[8]}"
+        cb_proto = "extern #{cell.get_celltype.get_global_name}_CB #{name_array[4]};\n"
+      else
+        cb = "0"
+        cb_proto = ""
+      end
+      if cell.get_celltype.has_INIB?
+        inib = "(void*)&#{name_array[5]}"
+        inib_proto = "extern #{cell.get_celltype.get_global_name}_INIB #{name_array[11]};\n"
+      else
+        inib = "0"
+        inib_proto = ""
+      end
+      if ! cell.exclude_info_factory? then
+        f.print <<EOT
+#{cb_proto}#define  #{cell.get_global_name}__CBP   #{cb}
+#{inib_proto}#define  #{cell.get_global_name}__INIBP #{inib}
+EOT
+      end
+    }
+    @namespace_list.each { |region|
+      if region.instance_of? Region then
+        region.print_cell_define f
+      end
+    }
+  end
+
+  def print_entry_descriptor_define f
+    @cell_list.each{ |cell|
+      next if cell.exclude_info_factory?
+
+      signatures = {}
+      cell.get_celltype.get_port_list.each{ |port|
+        next if port.get_port_type != :ENTRY
+
+        if signatures[ port.get_signature ] == nil then
+          f.print "#include \"#{port.get_signature.get_global_name}_tecsgen.h\"\n"
+        end
+        if cell.get_celltype.get_global_name == :nTECSInfo_tRawEntryDescriptorInfo then
+          f.print "const struct tag_#{cell.get_celltype.get_global_name}_#{port.get_name}_DES "
+          f.print "#{cell.get_global_name}_#{port.get_name}_des;\n"
+        else
+          f.print "extern struct tag_#{port.get_signature.get_global_name}_VDES "
+          f.print "#{cell.get_global_name}_#{port.get_name}_des;\n"
+        end
+      }
+    }
+    @namespace_list.each { |region|
+      if region.instance_of? Region then
+        region.print_entry_descriptor_define f
+      end
+    }
+  end
 end
 
@@ -227,11 +342,11 @@
     f.print <<EOT
 #{indent}cell nTECSInfo::tCelltypeInfo #{@global_name}CelltypeInfo {
-#{indent}    name            = "#{@name}";
-#{indent}    b_singleton     = #{@singleton};
-#{indent}    b_IDX_is_ID_act = C_EXP( "#{@global_name}__IDX_is_ID_act" );
-#{indent}    b_hasCB         = C_EXP( "#{@global_name}__hasCB" );
-#{indent}    b_hasINIB       = C_EXP( "#{@global_name}__hasINIB" );
-#{indent}    n_cellInLinUnit = C_EXP( "#{@global_name}__NCELLINLINKUNIT" );
-#{indent}    n_cellInSystem  = #{@cell_list.length};
+#{indent}    name             = "#{@name}";
+#{indent}    b_singleton      = #{@singleton};
+#{indent}    b_IDX_is_ID_act  = C_EXP( "#{@global_name}__IDX_is_ID_act" );
+#{indent}    sizeOfCB         = C_EXP( "#{@global_name}__sizeOfCB" );
+#{indent}    sizeOfINIB       = C_EXP( "#{@global_name}__sizeOfINIB" );
+#{indent}    n_cellInLinkUnit = C_EXP( "#{@global_name}__NCELLINLINKUNIT" );
+#{indent}    n_cellInSystem   = #{@cell_list.length};
 EOT
     @port.each{ |port|
@@ -273,8 +388,8 @@
     }
     @attribute.each{ |decl|
-      decl.print_info f, @global_name, indent
+      decl.print_info f, @global_name, indent, :DECLTYPE_ATTR
     }
     @var.each{ |decl|
-      decl.print_info f, @global_name, indent
+      decl.print_info f, @global_name, indent, :DECLTYPE_VAR
     }
   end
@@ -295,16 +410,21 @@
         if ! decl.is_omit? then
           offset = "(uint32_t)(intptr_t)&(((#{@global_name}_#{inib_cb}*)0)->#{decl.get_name})"
+          place = inib_cb
         else
           offset = "0xffffffff"
+          place = "NON"
         end
         f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", offset
+        f.printf "#define PLACE_OF_%-30s  VARDECL_PLACE_%s\n", "#{@global_name}_#{decl.get_name}", place
       }
       @var.each{ |decl|
-        if decl.get_size_is then
+        if decl.get_size_is && has_INIB? then
           inib_cb = "INIB"
         else
           inib_cb = "CB"
         end
-          f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", "(uint32_t)(intptr_t)&(((#{@global_name}_#{inib_cb}*)0)->#{decl.get_name})"
+        place = inib_cb
+        f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", "(uint32_t)(intptr_t)&(((#{@global_name}_#{inib_cb}*)0)->#{decl.get_name})"
+        f.printf "#define PLACE_OF_%-30s  VARDECL_PLACE_%s\n", "#{@global_name}_#{decl.get_name}", place
       }
     else
@@ -316,7 +436,9 @@
       @attribute.each{ |decl|
         f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", "0xffffffff"
+        f.printf "#define PLACE_OF_%-30s   VARDECL_PLACE_NON\n", "#{@global_name}_#{decl.get_name}"
       }
       @var.each{ |decl|
         f.printf "#define OFFSET_OF_%-30s  (%s)\n", "#{@global_name}_#{decl.get_name}", "0xffffffff"
+        f.printf "#define PLACE_OF_%-30s   VARDECL_PLACE_NON\n", "#{@global_name}_#{decl.get_name}"
       }
     end
@@ -324,8 +446,27 @@
 
   def print_celltype_define f
-    f.printf "#define %-50s (#{@idx_is_id_act})\n",     "#{@global_name}__IDX_is_ID_act"
-    f.printf "#define %-50s (#{has_CB?})\n",            "#{@global_name}__hasCB"
-    f.printf "#define %-50s (#{has_INIB?})\n",          "#{@global_name}__hasINIB"
-    f.printf "#define %-30s (%d)\n", "#{@global_name}__NCELLINLINKUNIT", @n_cell_gen
+    if has_INIB? then
+      size_INIB = "(sizeof(#{@global_name}_INIB))"
+    else
+      size_INIB = "(0)"
+    end
+    if has_CB? then
+      size_CB = "(sizeof(#{@global_name}_CB))"
+    else
+      size_CB   = "(0)"
+    end
+
+    if @n_cell_gen > 0 then
+      f.printf "\n#include \"#{@global_name}_tecsgen.h\"\n"
+      f.printf "#define %-50s (#{@idx_is_id_act})\n",     "#{@global_name}__IDX_is_ID_act"
+      f.printf "#define %-50s (#{size_CB})\n",            "#{@global_name}__sizeOfCB"
+      f.printf "#define %-50s (#{size_INIB})\n",          "#{@global_name}__sizeOfINIB"
+      f.printf "#define %-30s (%d)\n", "#{@global_name}__NCELLINLINKUNIT", @n_cell_gen
+    else
+      f.printf "#define %-50s (false)\n",                 "#{@global_name}__IDX_is_ID_act"
+      f.printf "#define %-50s (0)\n",                     "#{@global_name}__sizeOfCB"
+      f.printf "#define %-50s (0)\n",                     "#{@global_name}__sizeOfINIB"
+      f.printf "#define %-30s (%d)\n", "#{@global_name}__NCELLINLINKUNIT", @n_cell_gen
+    end
   end
 
@@ -365,5 +506,5 @@
         end
       end
-      if ( port.is_VMT_useless? && port.is_cell_unique? ) || @n_cell_gen == 0 then
+      if ( port.is_VMT_useless? && port.is_cell_unique? ) || port.is_omit? || @n_cell_gen == 0 then
         offset = "0xffffffff"
       else
@@ -375,5 +516,13 @@
         offset = "(uint32_t)(intptr_t)&((#{@global_name}_#{cb_inib}*)0)->#{port.get_name}"
       end
+      array_size = port.get_array_size
+      if array_size == "[]" then
+        array_size = "0xffffffff"
+      elsif array_size == nil then
+        array_size = "0"
+      end
+
       f.printf "#define %-50s (#{offset})\n",                   "#{@global_name}_#{port.get_name}__offset"
+      f.printf "#define %-50s (#{array_size})\n",               "#{@global_name}_#{port.get_name}__array_size"
       f.printf "#define %-50s (#{place})\n",                    "#{@global_name}_#{port.get_name}__place"
       f.printf "#define %-50s (#{port.is_VMT_useless?})\n",     "#{@global_name}_#{port.get_name}__b_VMT_useless"
@@ -382,4 +531,18 @@
     }
   end
+
+  def print_entry_define f
+    @port.each{ |port|
+      next if port.get_port_type == :CALL
+      array_size = port.get_array_size
+      if array_size == "[]" then
+        array_size = "0xffffffff"
+      elsif array_size == nil then
+        array_size = "0"
+      end
+
+      f.printf "#define %-50s (#{array_size})\n",               "#{@global_name}_#{port.get_name}__array_size"
+    }
+  end
 end
 
@@ -393,4 +556,5 @@
 #{indent}    cSignatureInfo  = #{@signature.get_global_name}SignatureInfo.eSignatureInfo;
 #{indent}    b_inline        = #{@b_inline};
+#{indent}    array_size      = C_EXP( "#{ct_global}_#{@name}__array_size" );
 #{indent}};
 EOT
@@ -401,4 +565,5 @@
 #{indent}    cSignatureInfo  = #{@signature.get_global_name}SignatureInfo.eSignatureInfo;
 #{indent}    offset            = C_EXP( "#{ct_global}_#{@name}__offset" );
+#{indent}    array_size        = C_EXP( "#{ct_global}_#{@name}__array_size" );
 #{indent}    b_optional        = #{@b_optional};
 #{indent}    b_omit            = #{@b_omit};
@@ -418,4 +583,83 @@
 end
 
+class Cell
+  def print_info f, indent
+    if exclude_info? then
+      return
+    end
+    f.print <<EOT
+
+#{indent}/*** #{@global_name} cell information ****/
+#{indent}cell nTECSInfo::tCellInfo #{@global_name}CellInfo {
+#{indent}    name            = "#{@name}";
+#{indent}    cbp             = C_EXP( \"#{@global_name}__CBP\" );
+#{indent}    inibp           = C_EXP( \"#{@global_name}__INIBP\" );
+#{indent}    cCelltypeInfo   = #{@celltype.get_global_name}CelltypeInfo.eCelltypeInfo;
+EOT
+    @celltype.get_port_list.each{ |port|
+      next if port.get_port_type != :ENTRY
+
+      f.print <<EOT
+#{indent}    cRawEntryDescriptor[] = #{@global_name}_#{port.get_name}RawEntryDescriptorInfo.eRawEntryDescriptor;
+EOT
+    }
+    f.print "#{indent}};\n"
+
+    # RawEntryDescriptorInfo cells
+    @celltype.get_port_list.each{ |port|
+      next if port.get_port_type != :ENTRY
+
+      size = port.get_array_size
+      if size == nil then
+        size = 1
+      elsif size == "[]" then
+        size = @entry_array_max_subscript[ port ]
+      end
+      if ! port.is_omit? then
+        red = "C_EXP( \"&#{@global_name}_#{port.get_name}_des\" )"
+      else
+        red = "(void *)0"
+      end
+      # mikan 受け口配列
+      f.print <<EOT
+#{indent}cell nTECSInfo::tRawEntryDescriptorInfo #{@global_name}_#{port.get_name}RawEntryDescriptorInfo {
+#{indent}   size = #{size};
+#{indent}   rawEntryDescriptor = { #{red} };
+EOT
+#  #{indent}   cEntryInfo = #{@celltype.get_global_name}_#{port.get_name}EntryInfo.eEntryInfo;
+      f.print "#{indent}};\n"
+    }
+  end
+
+  def exclude_info?
+    # print "exclude_info?: name=" + get_name.to_s
+    if @celltype == nil ||
+       is_of_composite? ||
+       @celltype.get_global_name == :nTECSInfo_tTECSInfoSub ||
+       post_code_generated? ||
+       @b_defined == false then
+      # print ": true celltype_is_of_composite=#{is_of_composite?} celltype_name=#{@celltype.get_global_name} celltype.need_generate=#{@celltype.need_generate?}\n"
+      return true
+    else
+      # print ": false\n"
+      return false
+    end
+  end
+
+  def exclude_info_factory?
+    # print "exclude_info_factory?: name=" + get_name.to_s
+    if @celltype == nil ||
+       is_of_composite? ||
+       @celltype.get_global_name == :nTECSInfo_tTECSInfoSub ||
+       ! @celltype.need_generate? then
+      # print ": true celltype_is_of_composite=#{is_of_composite?} celltype_name=#{@celltype.get_global_name} celltype.need_generate=#{@celltype.need_generate?}\n"
+      return true
+    else
+      # print ": false\n"
+      return false
+    end
+  end
+end
+
 class Signature
   def print_info f, indent
@@ -446,5 +690,5 @@
     f.print <<EOT
 #{indent}cell nTECSInfo::tFunctionInfo #{sig_name}_#{func_name}FunctionInfo {
-#{indent}    name            = "#{@owner.get_global_name}_#{@name}";
+#{indent}    name            = "#{get_name}";
 #{indent}    bOneway         = #{is_oneway?};
 EOT
@@ -502,5 +746,5 @@
 
 class Decl
-  def print_info f, parent_ID_str, indent
+  def print_info f, parent_ID_str, indent, decl_type
     if @size_is then
       size = "\"mikan\"";
@@ -512,6 +756,7 @@
 #{indent}    name            = "#{get_name}";
 #{indent}    sizeIsExpr      = #{size};
-#{indent}    declType        = DECLTYPE_STMEMBER;
+#{indent}    declType        = #{decl_type};
 #{indent}    offset          = C_EXP( "OFFSET_OF_#{parent_ID_str}_#{get_name}" );
+#{indent}    place           = C_EXP( "PLACE_OF_#{parent_ID_str}_#{get_name}" );
 #{indent}    cTypeInfo       = #{get_type.get_ID_str}TypeInfo.eTypeInfo;
 #{indent}};
@@ -523,4 +768,9 @@
 class Type
   @@typeinfo_printed = {}
+
+  def self.reset_print_info
+    @@typeinfo_printed = {}
+  end
+
   def print_info f, indent
     # Type の info は、最後にまとめて出力するので、ここでは記録するだけ
@@ -538,5 +788,5 @@
     elsif self.kind_of? StructType then
       get_members_decl.get_items.each{ |decl|
-        decl.get_type.print_info f, indent
+        decl.print_info f, get_ID_str, indent, :DECLTYPE_STMEMBER
       }
     end
@@ -550,8 +800,4 @@
 
   def print_info_post f, indent
-    bit_size = get_bit_size
-    if bit_size == 0 then
-      bit_size = "C_EXP( \"sizeof(#{get_type_str}#{get_type_str_post})\" )"
-    end
     if self.class.superclass == Type then     # 親クラスが Type の場合 types.rb のクラス
       type_name = self.class.name
@@ -566,17 +812,17 @@
 #{indent}    name           = "#{get_type_str}#{get_type_str_post}";
 #{indent}    typeKind       = TECSTypeKind_#{type_name};
-#{indent}    bitSize        = #{bit_size};
+#{indent}    size           = C_EXP( "sizeof(#{get_type_str}#{get_type_str_post})" );
 #{indent}    b_const        = #{is_const?};
 #{indent}    b_volatile     = #{is_volatile?};
 EOT
     if self.kind_of? PtrType then
-      f.print "#{indent}    cTypeInfo      = #{get_referto.get_ID_str}TypeInfo.eTypeInfo;\n"
+      f.print "#{indent}    cTypeInfo        = #{get_referto.get_ID_str}TypeInfo.eTypeInfo;\n"
     elsif self.kind_of? ArrayType then
-      f.print "#{indent}    cTypeInfo      = #{get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
+      f.print "#{indent}    cTypeInfo        = #{get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
     elsif self.kind_of? DefinedType then
-      f.print "#{indent}    cTypeInfo      = #{get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
+      f.print "#{indent}    cTypeInfo        = #{get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
     elsif self.kind_of? StructType then
       get_members_decl.get_items.each{ |decl|
-        f.print "#{indent}    cTypeInfo[]    = #{decl.get_type.get_ID_str}TypeInfo.eTypeInfo;\n"
+        f.print "#{indent}    cVarDeclInfo[] = #{get_ID_str}_#{decl.get_name}VarDeclInfo.eVarDeclInfo;\n"
       }
     elsif self.kind_of? DescriptorType then
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tool_info.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tool_info.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/tool_info.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/types.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/types.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/types.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #
-#   Copyright (C) 2008-2015 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--  
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -629,5 +629,5 @@
 
 class FloatType < Type
-#  @bit_size::         32, 64, (80), -32, -64
+#  @bit_size::         32, 64, (80), -32, -64, -128
 
   def initialize( bit_size )
@@ -684,4 +684,6 @@
     when -64
       str = "#{str}double"
+    when -128
+      str = "#{str}long double"
     end
     return str
@@ -1558,18 +1560,12 @@
 # 動的結合で渡すデスクリプタ型
 class DescriptorType < Type
-# @sinagure_nsp::NamespacePath
+  # @sinagure_nsp::NamespacePath
+
+  @@descriptors = {}
 
   def initialize( signature_nsp )
-    # p "Desc #{signature_nsp.to_s}"
-    obj = Namespace.find signature_nsp
-    if ! obj.kind_of? Signature then
-      cdl_error( "T9999 '$1': not signature or not found", signature_nsp.to_s )
-      @signature_nsp = signature_nsp
-    else
-      if obj.has_descriptor? then
-       # cdl_error( "T9999 '$1': has Descriptor in function parameter", signature_nsp.to_s )
-      end
-      @signature_nsp = obj.get_namespace_path
-    end
+    @signature_nsp = signature_nsp
+    # check_signature ##
+    @@descriptors[ self ] = false
   end
 
@@ -1595,4 +1591,26 @@
     else
       cdl_error2( locale, "T9999 Descriptor cannot be used for $1", kind)
+    end
+  end
+
+  def self.check_signature
+    @@descriptors.each{ |desc, val|
+      if val != true then
+        desc.check_signature
+        @@descriptors[ desc ] = true
+      end
+    }
+  end
+  
+  def check_signature
+    # p "Desc #{@signature_nsp.to_s}"
+    obj = Namespace.find @signature_nsp
+    if ! obj.kind_of? Signature then
+      cdl_error( "T9999 '$1': not signature or not found", @signature_nsp.to_s )
+    else
+      if obj.has_descriptor? then
+       # cdl_error( "T9999 '$1': has Descriptor in function parameter", @signature_nsp.to_s )
+      end
+      # @signature_nsp = obj.get_namespace_path
     end
   end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/unjoin_plugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/unjoin_plugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/core/unjoin_plugin.rb	(revision 374)
@@ -0,0 +1,218 @@
+# -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2019 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#   $Id$
+#++
+
+# Marshal.dump で不都合な事項への対策
+# Proc は _dump_data が定義されていないため、定義する．
+# plugin 関係は、tecsflow に Plugin クラスが存在しないため、消しておく．
+
+# Proc は、Marshal.dump することができないため _dump_data を定義
+class Proc
+  def _dump_data
+    nil
+  end
+end
+
+class Object
+  @@visited = {}
+  @@n_visited = 0
+  @@n_found = 0
+  @@n_plugin_proxy = 0
+
+  # do nothing now. this function is used to find remained Proxy object.
+    def find_plugin level, object_list
+
+    # find_plugin_1 level, object_list
+    # print "find_plugin: n_visted=", @@n_visited, " (len=", @@visited.length, ")  found=", @@n_found, "  proxy=", @@n_plugin_proxy, "\n"
+  end
+
+  def find_plugin_1 level, object_list
+    if @@visited[ self ] then
+      return
+    end
+    @@visited[ self ] = true
+    @@n_visited += 1
+
+    if kind_of? Expression then
+      # print   # Expression では print が別に定義されている
+      get_elements.each{|ele|
+        ele.find_plugin_1 level+1, object_list
+      }
+      return
+    end
+
+    if level > 100 then    # 100 is enough now, 50 is too small
+      print "reached max level: "
+      if respond_to? :get_name then
+        print "#{get_name}(#{self.class.name})\n"
+      else
+        print "(#{self.class.name})\n"
+      end
+      return
+    end
+
+    object_list.push self                 ##### ここから return 不可
+
+    if (kind_of? Plugin) || (kind_of? HRPSVCPlugin) then
+      @@n_found += 1
+      print "Plugin found: #{self.class.name}\n"
+      object_list.each{ |obj|
+        if obj.respond_to? :get_name then
+          print "#{obj.get_name}(#{obj.class.name}), "
+        else
+          print "(#{obj.class.name}), "
+        end
+      }
+      print "\n"
+    elsif kind_of? Join::ThroughPluginProxy then
+      @@n_plugin_proxy += 1
+    end
+
+    level += 1
+    if kind_of? Array then
+      each{ |val|
+        val.find_plugin_1 level, object_list
+      }
+    elsif kind_of? Hash then
+      each{ |key, val|
+        key.find_plugin_1 level, object_list
+        val.find_plugin_1 level, object_list
+      }
+    else
+      instance_variables.each{|iv|
+        iv_val = instance_variable_get iv
+        iv_val.find_plugin_1 level, object_list
+      }
+    end
+    object_list.pop                       ##### ここまで return 不可
+  end
+end
+
+class Namespace
+  def unjoin_plugin
+    @signature_list.each{ |sig| sig.unjoin_plugin }
+    @celltype_list.each{ |ct| ct.unjoin_plugin }
+    @cell_list.each{ |cell| cell.unjoin_plugin }
+    @namespace_list.each{ |ns| ns.unjoin_plugin}
+  end
+end
+
+class Region < Namespace
+  def unjoin_plugin
+    if @domain_type then
+      @domain_type.unjoin_plugin
+    end
+    @cell_port_throug_plugin_list.each{ |key, po|
+      proxy = Join::ThroughPluginProxy.new po.get_cell_namespace_path, po.get_through_entry_port_name, po.get_through_entry_port_subscript
+      @cell_port_throug_plugin_list[ key ] = proxy
+    }
+    super
+  end
+end
+
+class DomainType < Node
+  def unjoin_plugin
+    @plugin = nil
+  end
+end
+
+class Signature < NSBDNode
+  def unjoin_plugin
+    @generate = nil
+  end
+end
+
+class Celltype < NSBDNode
+  def unjoin_plugin
+    @generate = nil
+    @generate_list = []
+    @plugin = nil
+  end
+end
+
+class Cell < NSBDNode
+  def unjoin_plugin
+    @generate = nil
+    @plugin   = nil
+    @join_list.get_items.each{ |j| j.unjoin_plugin }
+  end
+end
+
+class Join < BDNode
+  class ThroughPluginProxy
+    def initialize namespace_path, entry_port_name, entry_port_subscript
+      @namespace_path = namespace_path
+      @entry_port_name = entry_port_name
+      @entry_port_subscript = entry_port_subscript
+    end 
+    def get_cell_namespace_path
+      @namespace_path
+    end
+    def get_through_entry_port_name
+      @entry_port_name
+    end
+    def get_through_entry_port_subscript
+      @entry_port_subscript
+    end
+  end 
+
+  def unjoin_plugin
+    # @thourhg_generated_list is refered in get_rhs_cell, get_rhs_port
+    @through_generated_list.map!{|po| # po: plugin object
+      ThroughPluginProxy.new po.get_cell_namespace_path, po.get_through_entry_port_name, po.get_through_entry_port_subscript
+    }
+    @region_through_generated_list.map!{|po| # po: plugin object
+      ThroughPluginProxy.new po.get_cell_namespace_path, po.get_through_entry_port_name, po.get_through_entry_port_subscript
+    }
+    if @array_member2 then
+      @array_member2.each{ |j| 
+        if j then
+          j.unjoin_plugin2
+        end
+      }
+    end
+  end
+  def unjoin_plugin2
+    @through_generated_list.map!{|po| # po: plugin object
+      ThroughPluginProxy.new po.get_cell_namespace_path, po.get_through_entry_port_name, po.get_through_entry_port_subscript
+    }
+    @region_through_generated_list.map!{|po| # po: plugin object
+      ThroughPluginProxy.new po.get_cell_namespace_path, po.get_through_entry_port_name, po.get_through_entry_port_subscript
+    }
+  end
+end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_en_US.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_en_US.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_en_US.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_ja_JP.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_ja_JP.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_console_ja_JP.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_en_US.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_en_US.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_en_US.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2018 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -76,5 +76,5 @@
 #  * このファイルを編集して使用することが意図されていますが
 #  * tecsgen の再実行により上書きされてしまうため、通常
-#  *   gen/%s_template.c => src/%s.c
+#  *   gen/%s_templ.c => src/%s.c
 #  * のように名前, フォルダを変更してから修正します
 #  */
@@ -83,5 +83,5 @@
  * This file was automatically generated by tecsgen.
  * Move and rename like below before editing,
- *   gen/%s_template.c => src/%s.c
+ *   gen/%s_templ.c => src/%s.c
  * to avoid to be overwritten by tecsgen.
  */
@@ -335,3 +335,8 @@
 @@comment[ :TEFB_comment ] = "\t/* Put statements here %s */\n"
 
+# @@comment[ :MCPP_comment ] = "/* セル CB プロトタイプ宣言 %s */\n"
+@@comment[ :MCPP_comment ] = "/* cell CB prototype declaration %s */\n"
+
+# @@comment[ :MCPB_comment ] = "/* セル CB プロトタイプ宣言 %s */\n"
+@@comment[ :MCPB_comment ] = "/* cell CB prototype declaration %s */\n"
 end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_ja_JP.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_ja_JP.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/messages/messages_file_ja_JP.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2018 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -65,5 +65,5 @@
  * このファイルを編集して使用することが意図されていますが
  * tecsgen の再実行により上書きされてしまうため、通常
- *   gen/%s_template.c => src/%s.c
+ *   gen/%s_templ.c => src/%s.c
  * のように名前, フォルダを変更してから修正します
  */
@@ -163,4 +163,6 @@
 @@comment[ :TEPF_comment ] = "/* 受け口関数 %s */\n"
 @@comment[ :TEFB_comment ] = "\t/* ここに処理本体を記述します %s */\n"
+@@comment[ :MCPP_comment ] = "/* CB プロトタイプ宣言 %s */\n"
+@@comment[ :MCPB_comment ] = "/* CB プロトタイプ宣言 %s */\n"
 
 end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1AlarmPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1AlarmPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1AlarmPlugin.rb	(revision 374)
@@ -35,5 +35,5 @@
 #   の責任を負わない．
 #  
-#   $Id
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1DelayTaskPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1DelayTaskPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1DelayTaskPlugin.rb	(revision 374)
@@ -35,5 +35,5 @@
 #   の責任を負わない．
 #  
-#   $Id
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ISRPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ISRPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ISRPlugin.rb	(revision 374)
@@ -35,5 +35,5 @@
 #   の責任を負わない．
 #  
-#   $Id
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1KernelPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1KernelPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1KernelPlugin.rb	(revision 374)
@@ -35,5 +35,5 @@
 #   の責任を負わない．
 #  
-#   $Id
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ResourcePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ResourcePlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1ResourcePlugin.rb	(revision 374)
@@ -35,5 +35,5 @@
 #   の責任を負わない．
 #  
-#   $Id
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1TaskPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1TaskPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ATK1TaskPlugin.rb	(revision 374)
@@ -35,5 +35,5 @@
 #   の責任を負わない．
 #  
-#   $Id
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/DomainPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/DomainPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/DomainPlugin.rb	(revision 374)
@@ -46,4 +46,5 @@
   #option::String : domain 指定子の第二引数
   def initialize( region, domain_type_name, option )
+    super()
   end
 
@@ -77,3 +78,14 @@
     return false
   end
+
+  #== ドメイン種別を返す
+  #return::Symbol :kernel, :user, :OutOfDomain
+  def get_kind
+    :kernel
+  end
+
+  #== factory 生成
+  # DomainPlugin の factory は特定のファイルへの出力が想定されていない
+  def gen_factory
+  end
 end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Cache.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Cache.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Cache.rb	(revision 374)
@@ -1,3 +1,4 @@
 # -*- coding: utf-8 -*-
 
+#   $Id$
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2CyclicHandlerPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2CyclicHandlerPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2CyclicHandlerPlugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2012 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2DataqueuePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2DataqueuePlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2DataqueuePlugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2012 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2EventflagPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2EventflagPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2EventflagPlugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2012 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2FixedSizeMemoryPoolPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2FixedSizeMemoryPoolPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2FixedSizeMemoryPoolPlugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2012 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2HandlerPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2HandlerPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2HandlerPlugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2018 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -77,13 +77,13 @@
         elsif @plugin_arg_str == "ISR"
             file.print <<EOT
-#{tab}ATT_ISR({ #{val[:attribute]}, &#{cell_CB_name}, #{val[:interruptNumber]}, tISR_start, #{val[:priority]} });
+#{tab}ATT_ISR({ #{val[:attribute]}, #{cell_CBP}, #{val[:interruptNumber]}, tISR_start, #{val[:priority]} });
 EOT
         elsif @plugin_arg_str == "INIT_ROUTINE"
             file.print <<EOT
-#{tab}ATT_INI({ #{val[:attribute]}, &#{cell_CB_name}, tInitializeRoutine_start });
+#{tab}ATT_INI({ #{val[:attribute]}, #{cell_CBP}, tInitializeRoutine_start });
 EOT
         elsif @plugin_arg_str == "TERM_ROUTINE"
             file.print <<EOT
-#{tab}ATT_TER({ #{val[:attribute]}, &#{cell_CB_name}, tTerminateRoutine_start });
+#{tab}ATT_TER({ #{val[:attribute]}, #{cell_CBP}, tTerminateRoutine_start });
 EOT
         else
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2KernelObjectPlugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2012 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -186,5 +186,5 @@
                 val = {}
                 @celltype.get_attribute_list.each{ |a|
-                    p a.get_name
+                    # p a.get_name
                     if a.get_type.kind_of?( ArrayType )
                         val[a.get_name] = []
@@ -218,5 +218,6 @@
                 if val[:id].nil? != true
                     puts val[:id]
-                    val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
+                    #val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
+                    val[:id] = @celltype.subst_name( val[:id], @celltype.get_name_array( cell ) )
                 end
                 # $cbp$の代わり
@@ -244,6 +245,6 @@
                         file2.puts "}\n"
                     else
-                        print "~~~~~ #{cell.get_region.get_name.to_s} is included in"
-                        p @@region_list
+                        dbgPrint "~~~~~ #{cell.get_region.get_name.to_s} is included in"
+                        # p @@region_list
                     end
                     file3 = AppFile.open( "#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg" )
@@ -260,6 +261,6 @@
                 if !val[:accessPattern].nil?
                     puts "===== begin check regions #{cell.get_name} ====="
-                    p val[:accessPattern]
-                    p val[:accessPattern].class
+                    # p val[:accessPattern]
+                    # p val[:accessPattern].class
 
                     #ep = [ :eTaskActivate, :eTaskControl, :eTaskManage, :eTaskRefer ]
@@ -273,8 +274,8 @@
                         if acptnx != "OMIT"
                             acv << acptnx
-                            p acv[i]
+                            # p acv[i]
                         elsif cell_domain_type.get_option.to_s == "trusted"
                             acv << "TACP_KERNEL"
-                            p acv[i]
+                            # p acv[i]
                         elsif cell_domain_type.get_option.to_s != "OutOfDomain"
                             acv << "TACP(#{cell_domain_root.get_name.to_s})"
@@ -286,5 +287,5 @@
                     }
 
-                    print "acv = "
+                    dbgPrint "acv = "
                     p acv
 
@@ -322,9 +323,9 @@
 
     def self.check_referenced_cells()
-        puts "===== begin check registered celltype ====="
+        dbgPrint "===== begin check registered celltype =====\n"
         self.get_celltype_list.each { |ct|
-            p ct.get_name.to_s
+            dbgPrint( ct.get_name.to_s + "\n" )
         }
-        puts "===== end check registered celltype ====="
+        dbgPrint "===== end check registered celltype =====\n"
 
 =begin
@@ -334,5 +335,5 @@
                 j = cell.get_join_list.get_item(p.get_name)
                 printf "===== check call port : "
-                p p.get_name.to_s
+                # p p.get_name.to_s
                 next if j.nil? # 未結合の場合
                 if @@celltype_list.include?(j.get_celltype)
@@ -341,7 +342,7 @@
                     j.get_cell.set_referenced_cell(cell, j.get_port_name)
                     printf "===== check joined rhs cell : "
-                    p j.get_cell.get_name.to_s
+                    # p j.get_cell.get_name.to_s
                     printf "===== check joined rhs port_name : "
-                    p j.get_port_name
+                    # p j.get_port_name
                 end
             }
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2ObjectPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2ObjectPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2ObjectPlugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Plugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Plugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2Plugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2014 by TOPPERS Project
+#   Copyright (C) 2018 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -44,5 +44,17 @@
 
   def initialize( region, name, option )
+    super
     print "HRP2Plugin: initialize: region=#{region.get_name}, domainName=#{name}, option=#{option}\n"
+    @region = region
+    @name   = name
+
+    case option
+    when "trusted", "nontrusted", "OutOfDomain"
+      # OK
+      @option = option
+    else
+      cdl_error( "HRPPlugin: '$1' is unacceptable domain kind, specify 'trusted' or 'nontrusted'", option )
+      @option = "trusted"   # とりあえず trusted を設定しておく
+    end
   end
 
@@ -108,4 +120,17 @@
   end
 
+  #== ドメイン種別を返す
+  #return::Symbol :kernel, :user, :OutOfDomain
+  def get_kind
+    case @option
+    when "trusted"
+      return :kernel
+    when "nontrusted"
+      return :user
+    when "OutOfDomain"
+      return :OutOfDomain
+    end
+  end
+
   def joinable?(current_region, next_region, through_type )
     print "HRP2Plugin: joinable? from #{current_region.get_name} to #{next_region.get_name} (#{through_type})\n"
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PostHook.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PostHook.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PostHook.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2012 by TOPPERS Project
+#   Copyright (C) 2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PriorityDataqueuePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PriorityDataqueuePlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2PriorityDataqueuePlugin.rb	(revision 374)
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2RPCPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2RPCPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2RPCPlugin.rb	(revision 374)
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
@@ -70,5 +71,5 @@
   #=== RPCPlugin の initialize
   #  説明は ThroughPlugin (plugin.rb) を参照
-  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
     super
     @b_noClientSemaphore = false
@@ -234,5 +235,5 @@
     if cell.get_allocator_list.length > 0 then
 
-      dbgPrint "make allocator"
+      dbgPrint "make allocator\n"
       file.print "#{indent_str}[allocator("
 
@@ -269,8 +270,14 @@
     nest = @end_region.gen_region_str_pre file
     indent_str = "  " * nest
+    nest_str = "  " * nest
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
 
     file.print <<EOT
 #{indent_str}cell #{@rpc_channel_celltype_name}Server #{@cell_name}Body {
-#{indent_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
+#{indent_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
 //#{indent_str}    #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name};
 #{indent_str}  //cTDR         = #{@channelCellName}.eTDR;
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SVCPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SVCPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SVCPlugin.rb	(revision 374)
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
@@ -83,5 +84,5 @@
   @@generated_celltype_header = {}
 
-  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
     super
     @ct_name_body = "#{@ct_name}SVCBody_#{@next_cell.get_name}_#{@next_cell_port_name}".to_sym
@@ -217,4 +218,9 @@
     nest = @end_region.gen_region_str_pre file
     nest_str = "  " * nest
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
 
     # サーバー側チャンネルの生成 
@@ -224,5 +230,5 @@
 #{nest_str}  //  Server Side Channel
 #{nest_str}  cell #{@ct_name_body} #{@cell_name_body}{
-#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
+#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
 #{nest_str}  };
 EOT
@@ -241,4 +247,9 @@
     nest = @start_region.gen_region_str_pre file
     nest_str = "  " * nest
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
 
     # クライアント側チャンネルの生成
@@ -247,5 +258,5 @@
 #{nest_str}  //  Client Side Channel
 #{nest_str}  cell #{@ct_name} #{@cell_name}{
-#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
+#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
 #{nest_str}  };
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SemaphorePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SemaphorePlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2SemaphorePlugin.rb	(revision 374)
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2TaskPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2TaskPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRP2TaskPlugin.rb	(revision 374)
@@ -53,5 +53,6 @@
     # tab  : 
     def print_cfg_cre(file, cell, val, tab)
-        val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
+        #val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_global_name.to_s}" )
+        #val[:id] = @celltype.subst_name( val[:id], @celltype.get_name_array( cell ) )
         # $cbp$の代わり
         index = cell.get_id - @celltype.get_id_base
@@ -59,7 +60,8 @@
         cell_CB_name = "#{index}"
         # CRE_XXX/DEF_XXXの生成
-        print "assign task plugin\n"
+        dbgPrint "assign task plugin\n"
         domainOption = cell.get_region.get_domain_root.get_domain_type.get_option
         # if cell.get_region.get_region_type == :DOMAIN
+# cell.show_tree 1
         if domainOption != "OutOfDomain"
             # 保護ドメインに属する場合
@@ -69,4 +71,5 @@
                     raise "system task cannot have user stack."
                 end
+p "CRE_TSK 0 user=#{val[:userStackSize]} system=#{val[:systemStackSize]}"
                 file.print <<EOT
 #{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:systemStackSize]}, NULL });
@@ -77,4 +80,5 @@
                     raise "user task must have user stack."
                 end
+p "CRE_TSK 1"
                 if val[:systemStackSize] == "OMIT"
                     file.print <<EOT
@@ -82,4 +86,5 @@
 EOT
                 else
+p "CRE_TSK 2"
                     file.print <<EOT
 #{tab}CRE_TSK(#{val[:id]}, { #{val[:taskAttribute]}, #{cell_CB_name}, tTask_start_task, #{val[:priority]}, #{val[:userStackSize]}, NULL, #{val[:systemStackSize]}, NULL });
@@ -138,7 +143,7 @@
                     regions = ct.get_domain_roots
                     regions_hrp2 = regions[ :HRP2 ]
-                    print "HRP2 domain in #{ct.get_name}: "
+                    dbgPrint "HRP2 domain in #{ct.get_name}: "
                     regions_hrp2.each { |reg|
-                        print reg.get_name
+                        dbgPrint reg.get_name
                     }
                     puts ""
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPHandlerPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPHandlerPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPHandlerPlugin.rb	(revision 374)
@@ -0,0 +1,129 @@
+# coding: utf-8
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#++
+
+require_tecsgen_lib "HRPKernelObjectPlugin.rb"
+
+
+#== celltype プラグインの共通の親クラス
+class HRPHandlerPlugin < HRPKernelObjectPlugin
+
+    ##
+    # oyama: add to avoid Ruby exception in code generation phase.
+    def new_cell cell
+        domainOption = cell.get_region.get_domain_root.get_domain_type.get_option
+        if (domainOption == "OutOfDomain") || (domainOption != "kernel")
+          cdl_error( "HRP9999 HRP handler '$1' must belong to kernel domain", cell.get_name )
+        end
+    end
+
+    ##
+    #
+    # file : output file (ex.tecsgen.cfg)
+    # cell : 
+    # val  : 
+    # tab  : 
+    def print_cfg_cre(file, cell, val, tab)
+        if !val[:id].nil?
+            val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
+        end
+        # $cbp$の代わり
+        index = cell.get_id - @celltype.get_id_base
+        #cell_CB_name = "#{@celltype.get_global_name}_CB_tab[#{index}]"
+        name_array = cell.get_celltype.get_name_array cell
+        cell_CBP = name_array[8]
+        # CRE_XXXの生成
+        domainOption = cell.get_region.get_domain_root.get_domain_type.get_option
+        if (domainOption == "OutOfDomain") || (domainOption != "kernel")
+            # 無所属 or ユーザドメインに属する場合
+                raise "#{@plugin_arg_str.to_s.downcase} handler #{val[:id]} must belong to kernel domain."
+        elsif @plugin_arg_str == "CONFIG_INT"
+            file.print <<EOT
+#{tab}CFG_INT( #{val[:interruptNumber]}, { #{val[:attribute]}, #{val[:interruptPriority]} });
+EOT
+        elsif @plugin_arg_str == "ISR"
+            file.print <<EOT
+#{tab}CRE_ISR(#{val[:id]}, { #{val[:attribute]}, #{cell_CBP}, #{val[:interruptNumber]}, tISR_start, #{val[:isrPriority]} });
+EOT
+        elsif @plugin_arg_str == "DEF_INH"
+            name_array = @celltype.get_name_array cell
+            start = @celltype.subst_name( "$id$_start", name_array )
+            file.print <<EOT
+#{tab}DEF_INH(#{val[:interruptHandlerNumber]}, { #{val[:attribute]}, #{start} });
+EOT
+        elsif @plugin_arg_str == "DEF_EXC"
+            name_array = @celltype.get_name_array cell
+            start = @celltype.subst_name( "$id$_start", name_array )
+            file.print <<EOT
+#{tab}DEF_EXC(#{val[:cpuExceptionHandlerNumber]}, { #{val[:attribute]}, #{start} });
+EOT
+        elsif @plugin_arg_str == "INIT_ROUTINE"
+            file.print <<EOT
+#{tab}ATT_INI({ #{val[:attribute]}, #{cell_CBP}, tInitializeRoutine_start });
+EOT
+        elsif @plugin_arg_str == "TERM_ROUTINE"
+            file.print <<EOT
+#{tab}ATT_TER({ #{val[:attribute]}, #{cell_CBP}, tTerminateRoutine_start });
+EOT
+        else
+            raise "#{@plugin_arg_str} is unknown option"
+        end
+    end
+
+    def print_cfg_sac(file, val, acv)
+        if @plugin_arg_str == "CONFIG_INT"
+            # nothing to do
+        elsif @plugin_arg_str == "ISR"
+            # kernel.cdl の tISR で accessPattern1 ～ accessPattern4 が定義されているときの名残。
+            # accessPattern1 が定義されていない場合、こここへは来ない．復活したときに備えて残しておく．
+            # file.puts "SAC_#{@plugin_arg_str}(#{val[:id]}, { #{acv[:accessPattern1]}, #{acv[:accessPattern2]}, #{acv[:accessPattern3]}, #{acv[:accessPattern4]} });"
+            puts "*** Unsupported *** SAC_#{@plugin_arg_str}(#{val[:id]}, { #{acv[:accessPattern1]}, #{acv[:accessPattern2]}, #{acv[:accessPattern3]}, #{acv[:accessPattern4]} });\n"
+        elsif @plugin_arg_str == "DEF_INH"
+            # nothing to do
+        elsif @plugin_arg_str == "DEF_EXC"
+            # nothing to do
+        elsif @plugin_arg_str == "INIT_ROUTINE"
+            # nothing to do
+        elsif @plugin_arg_str == "TERM_ROUTINE"
+            # nothing to do
+        else
+            raise "#{@plugin_arg_str} is unknown option"
+        end
+    end
+
+end
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPKernelObjectManager.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPKernelObjectManager.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPKernelObjectManager.rb	(revision 374)
@@ -0,0 +1,71 @@
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2015-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#
+#   $Id$
+#  
+#++
+# This file has been generated by gen_kernel_celltype.py
+class HRPKernelObjectManager
+	@@kernel_objs = [\
+		:tKernel, \
+		:tTask, \
+		:tSemaphore, \
+		:tEventflag, \
+		:tDataqueue, \
+		:tPriorityDataqueue, \
+		:tMutex, \
+		:tFixedSizeMemoryPool, \
+		:tTimeEventHandler, \
+		:tCyclicNotifier, \
+		:tAlarmNotifier, \
+		:tInterruptRequest, \
+		:tISR, \
+		:tInterruptHandler, \
+		:tCpuExceptionHandler, \
+		:tInitializeRoutine, \
+		:tTerminateRoutine, \
+		:tMessageBuffer, \
+	]
+
+    def initialize()
+        # 
+        #  本クラスはインスタンスを持たない仮想的なクラスである
+        #
+        raise "class #{self.class.name} shall not have instances"
+    end
+    def self.include_celltype?(str)
+        return @@kernel_objs.include?(str)
+    end
+end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPKernelObjectPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPKernelObjectPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPKernelObjectPlugin.rb	(revision 374)
@@ -0,0 +1,336 @@
+# coding: utf-8
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#
+#  $Id$
+#++
+
+#== celltype プラグインの共通の親クラス
+class HRPKernelObjectPlugin < CelltypePlugin
+    # @@obj_hash = {}
+
+    #@celltype:: Celltype
+    #@option:: String     :オプション文字列
+    def initialize( celltype, option )
+        super
+        #
+        #  それぞれのカーネルオブジェクトを解析対象セルタイプに追加
+        #  目的：
+        #   - カーネルオブジェクトのセルをメモリ保護対象外とする
+        #    - カーネルオブジェクト本体の管理はTECSでなくOSで実施するため
+        #   - カーネルオブジェクトのセルへのアクセスを直接関数呼出し
+        #   　とする
+        #    - システムサービス呼出しはOSが提供するため
+        HRPKernelObjectPlugin.set_celltype(celltype)
+    end
+  
+    #=== HRPKernelObjectPlugin#print_cfg_cre
+    # 各種カーネルオブジェクトのCRE_*の出力
+    # file:: FILE:     出力先ファイル
+    # val :: string:   カーネルオブジェクトの属性の解析結果
+    # tab :: string:   インデント用のtab
+    def print_cfg_cre(file, cell, val, tab)
+        raise "called virtual method print_cfg_cre in #{@celltype.get_name} plugin"
+    end
+  
+    #=== HRPKernelObjectPlugin#print_cfg_sac
+    # 各種カーネルオブジェクトのSAC_*の出力
+    # file:: FILE:     出力先ファイル
+    # val :: string:   カーネルオブジェクトの属性の解析結果
+    # acv :: string:   アクセスベクタ
+    def print_cfg_sac(file, val, acv)
+        raise "called virtual method print_cfg_sac in #{@celltype.get_name} plugin"
+    end
+  
+    #
+    #  セルタイププラグインの本体メソッド
+    #   - 静的APIの生成
+    #  file:: FILE:     出力先ファイル
+    #
+    def gen_factory file
+        dbgPrint "===== begin #{@celltype.get_name.to_s} plugin =====\n"
+
+        #
+        # 対象となるすべてのセルについて、受け口に結合されている
+        # セルの所属ドメインを解析
+        #  - 生成すべきcfgファイル名を取得するために必要
+        #
+        if !HRPKernelObjectPlugin.isChecked()
+            HRPKernelObjectPlugin.check_referenced_cells()
+        else
+            dbgPrint "***** already checked\n"
+        end
+
+        # 追記するために AppFile を使う（文字コード変換されない）
+        file2 = AppFile.open( "#{$gen}/tecsgen.cfg" )
+        file2.print "\n/* Generated by #{self.class.name} */\n\n"
+
+        @celltype.get_cell_list.each { |cell|
+            if cell.is_generate?
+                dbgPrint "===== begin check my domain #{cell.get_name} =====\n"
+                #
+                #  カーネルオブジェクトの属性を，valにコピー
+                #
+                val = {}
+                @celltype.get_attribute_list.each{ |a|
+                    # p a.get_name
+                    if a.get_type.kind_of?( ArrayType )
+                        val[a.get_name] = []
+                        if j = cell.get_join_list.get_item(a.get_name)
+                            # セル生成時に初期化する場合
+                            j.get_rhs.each { |elem|
+                                val[a.get_name] << elem.to_s
+                            }
+                        elsif i = a.get_initializer
+                            # セルタイプの初期化値を使う場合
+                            i.each { |elem|
+                                val[a.get_name] << elem.to_s
+                            }
+                        else
+                            raise "attribute is not initialized"
+                        end
+                    else
+                        if j = cell.get_join_list.get_item(a.get_name)
+                            # セル生成時に初期化する場合
+                            val[a.get_name] = j.get_rhs.to_s
+                        elsif i = a.get_initializer
+                            # セルタイプの初期化値を使う場合
+                            val[a.get_name] = i.to_s
+                        else
+                            raise "attribute is not initialized"
+                        end
+                    end
+                }
+                # generate.rbを参考に
+                # $id$を置換
+                if val[:id].nil? != true
+                    name_array = @celltype.get_name_array( cell )
+                    val[:id]   = @celltype.subst_name( val[:id], name_array )
+                end
+                # $cbp$の代わり
+                cell_domain_root = cell.get_region.get_domain_root
+                cell_domain_type = cell.get_region.get_domain_root.get_domain_type
+
+                # CRE_XXX/DEF_XXXの生成
+                if cell_domain_type.get_option.to_s != "OutOfDomain"
+                    # 保護ドメインに属する場合
+                    if !HRPKernelObjectPlugin.include_region(cell_domain_root.get_name.to_s)
+                        # その保護ドメインの.cfgが生成されていない場合
+                        HRPKernelObjectPlugin.set_region_list(cell_domain_root.get_name.to_s)
+                        dbgPrint "~~~~~ #{cell_domain_root.get_name.to_s} is registered!\n"
+
+#                        # if cell.get_region.get_param == :KERNEL_DOMAIN
+#                        if cell_domain_type.get_option.to_s == "kernel"
+#                            file2.print "KERNEL_DOMAIN{\n"
+#                        else
+#                            file2.print "DOMAIN(#{cell_domain_root.get_name.to_s}){\n"
+#                        end
+#                        file2.puts "\tINCLUDE(\"#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg\");" 
+#                        file2.puts "}\n"
+                    else
+                        dbgPrint "~~~~~ #{cell.get_region.get_namespace_path} is included in"
+                        #p @@region_list
+                    end
+                    file3 = AppFile.open( "#{$gen}/tecsgen_#{cell_domain_root.get_global_name}.cfg" )
+                    print_cfg_cre(file3, cell, val,"")
+                    file3.close
+                else
+                    # 無所属の場合
+                    dbgPrint "~~~~~ #{cell_domain_root.get_namespace_path} is OutOfDomain\n"
+                    # print "~~~~~ #{cell_domain_root.get_namespace_path} is OutOfDomain\n"
+                    # p cell_domain_root.get_name
+                    if cell_domain_root.get_name == "::" then
+                      print_cfg_cre(file2, cell, val, "")
+                    else
+#                      if !HRPKernelObjectPlugin.include_region(cell_domain_root.get_name.to_s)
+#                        # その保護ドメインの.cfgが生成されていない場合
+#                        HRPKernelObjectPlugin.set_region_list(cell_domain_root.get_name.to_s)
+#                        file2.puts "INCLUDE(\"#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg\");\n"
+#                      end
+                      file3 = AppFile.open( "#{$gen}/tecsgen_#{cell_domain_root.get_name.to_s}.cfg" )
+                      print_cfg_cre(file3, cell, val,"")
+                      file3.close
+                    end
+
+                end
+
+                dbgPrint "===== end check my domain #{cell.get_name} =====\n"
+
+                #
+                # SAC_XXXの生成
+                #
+                if !val[:accessPattern1].nil?
+                    dbgPrint "===== begin check regions #{cell.get_name} =====\n"
+                    i = 0
+                    acv = { \
+                            :accessPattern1 => val[:accessPattern1], \
+                            :accessPattern2 => val[:accessPattern2], \
+                            :accessPattern3 => val[:accessPattern3], \
+                            :accessPattern4 => val[:accessPattern4] \
+                    }
+                    acv_tmp = []
+                    domain_roots = HRPPlugin.get_inter_domain_join_roots cell
+                    # 結合先セルのドメインを加える
+                    if cell_domain_type.get_kind != :OutOfDomain then
+                      domain_roots << cell_domain_root
+                    end
+                    domain_roots.each{ |dr|
+                      case dr.get_domain_type.get_kind
+                      when :user
+                        acv_tmp << "TACP(#{dr.get_name})"
+                      when :kernel
+                        acv_tmp << "TACP_KERNEL"
+                      when :OutOfDomain
+                        if cell_domain_type.get_kind == :OutOfDomain then
+                          # 呼び元も、呼び先も OutOfDomain の場合
+                          acv_tmp << "TACP_SHARED"
+                        end
+                      end
+                    }
+                    acv_tmp.uniq!
+                    if acv_tmp.length == 0 then
+                      # 呼び先セルが無所属かつ、呼び元も無所属のみ、または結合無しの場合
+                      acv_tmp = [ "TACP_SHARED" ]
+                    end
+                    b_info = false
+                    b_warn = false
+                    acv.each { |key, acp|
+                        if !acp.nil?
+                            if acp != "OMIT"
+                            elsif cell_domain_type.get_kind != :OutOfDomain
+                              # p "UserDomainCell or KernelDomainCell"
+                              domain_roots = HRPPlugin.get_inter_domain_join_roots cell
+                              domain_roots.each{ |dr|
+                                # 
+                                case dr.get_domain_type.get_kind
+                                when :kernel
+                                when :user
+                                  if dr.get_namespace_path != cell.get_region.get_domain_root.get_namespace_path
+                                    # 他のユーザードメインからの結合
+                                    if( b_warn == false ) then
+                                      cdl_error( "HRP9999 '$1': kernel object joined from other user domain. kernel object joined from multi-user-domain must be placed out of domain", cell.get_name )
+                                      b_warn = true
+                                    end
+                                  end
+                                when :OutOfDomain
+                                  if( b_info == false ) then
+                                    # 無所属からの結合
+                                    # cdl_error( "HRP9999 kernel object joined from out of domain" )
+                                    if cell_domain_type.get_kind == :OutOfDomain
+                                      # この情報は、不要と判断する (無所属から無所属へ結合があると、アクセス許可ベクタが設定されない)
+                                      # cdl_info2( cell.get_locale, "HRP9999 '$1': kernel object joined from out of domain, access vector is not set", cell.get_name )
+                                      b_info = true
+                                    end
+                                  end
+                                else
+                                  raise "unknown domain kind"
+                                end
+                              }
+                              # acv[key] = "TACP(#{cell_domain_root.get_name.to_s})"
+                            else
+                              # p "OutOfDomainCell"
+                              # 無所属のセル
+                              # 結合元ドメインに許可する
+                              # 結合元に無所属のセルがあると、TACP_SHARED が設定される. フロー解析してドメインを特定できるのが、あるべき仕様
+                            end
+                            if acp == "OMIT"
+                              acv[key] = acv_tmp.join( '|' )
+                            end 
+                        end
+                    }
+                    #各種SACの生成
+                    domainOption = cell_domain_type.get_option
+                    # p "domain_root ", cell.get_region.get_domain_root.get_name
+                    if domainOption != "OutOfDomain" || cell.get_region.get_domain_root.get_name != "::"
+                        # 保護ドメインに属する場合
+                        file3 = AppFile.open( "#{$gen}/tecsgen_#{cell.get_region.get_name.to_s}.cfg" )
+                        print_cfg_sac(file3, val, acv)
+                        file3.close
+                    else
+                        # 無所属の場合
+                        print_cfg_sac(file2, val, acv)
+                    end
+
+                    dbgPrint "===== end check regions #{cell.get_name} =====\n"
+                end
+            end
+        }
+        dbgPrint "===== end #{@celltype.get_name.to_s} plugin =====\n"
+        file2.close
+    end
+
+    # カーネルオブジェクトセルタイプの管理
+    # HRPKernelObjectPluginクラスに対してメソッド呼出しを行うことを想定
+    @@checked = false
+    @@celltype_list = []
+    @@region_list = []
+
+    def self.isChecked()
+        return @@checked
+    end
+
+    def self.check_referenced_cells()
+        dbgPrint "===== begin check registered celltype =====\n"
+        self.get_celltype_list.each { |ct|
+          dbgPrint( ct.get_name.to_s + "\n" )
+        }
+        dbgPrint "===== end check registered celltype =====\n"
+
+        @@checked = true
+    end
+
+    def self.set_celltype( celltype )
+        @@celltype_list << celltype
+    end
+
+    def self.get_celltype_list
+        return @@celltype_list
+    end
+
+    def self.set_region_list( region )
+        @@region_list << region
+    end
+
+    def self.include_region( region )
+        return @@region_list.include?(region)
+    end
+
+    def self.include_celltype?( celltype )
+        return @@celltype_list.include?(celltype)
+    end
+
+end
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPObjectPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPObjectPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPObjectPlugin.rb	(revision 374)
@@ -0,0 +1,97 @@
+# coding: utf-8
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#  $Id$
+#++
+
+require_tecsgen_lib "HRPKernelObjectPlugin.rb"
+
+
+class HRPObjectPlugin < HRPKernelObjectPlugin
+    @@api = {
+        "SEMAPHORE"=>["SEM", :id, :attribute, :initialCount, :maxCount],
+        "EVENTFLAG"=>["FLG", :id, :attribute, :flagPattern],
+        "DATAQUEUE"=>["DTQ", :id, :attribute, :dataCount, :dataqueueManagementBuffer],
+        "PRIORITY_DATAQUEUE"=>["PDQ", :id, :attribute, :dataCount, :maxDataPriority, :priorityDataqueueManagementBuffer],
+        "FIXED_SIZE_MEMORYPOOL"=>["MPF", :id, :attribute, :blockCount, :blockSize, :memoryPool, :memoryPoolManagementBuffer],
+        "KERNEL"=>["SYS"],
+        "MESSAGE_BUFFER"=>["MBF", :id, :attribute, :maxMessageSize, :bufferSize, :mbfmb],
+        "MUTEX"=>["MTX", :id, :attribute, :ceilingPriority]
+    }
+
+    #=== HRPObjectPlugin#print_cfg_cre
+    # CRE_XXXの出力
+    # file:: FILE:     出力先ファイル
+    # val :: string:   カーネルオブジェクトの属性の解析結果
+    # tab :: string:   インデント用のtab
+    def print_cfg_cre(file, cell, val, tab)
+        if @@api.has_key?(@plugin_arg_str) == false
+            raise "#{@plugin_arg_str} is unknown"
+        elsif @plugin_arg_str != "KERNEL"
+            arg_list = []
+            params = @@api[@plugin_arg_str]
+            if @plugin_arg_str == "MUTEX" && ((val[:attribute] =~ /\bTA_CEILING\b/)==nil)
+              slice_end = -2   # :ceilingPriority を外す
+            else
+              slice_end = -1
+            end
+            # p @plugin_arg_str, slice_end, val[:attribute], (val[:attribute] =~ /\bTA_CEILING\b/)
+            params.slice(2..slice_end).each { |attr|
+                arg_list << "#{val[attr]}"
+            }
+            file.print tab
+            file.puts "CRE_#{@@api[@plugin_arg_str].at(0)}(#{val[:id]}, { #{arg_list.join(", ")} });"
+        end
+    end
+    #=== HRPObjectPlugin#print_cfg_sac
+    # SAC_XXXの出力
+    # file:: FILE:     出力先ファイル
+    # val :: string:   カーネルオブジェクトの属性の解析結果
+    # acv :: string:   アクセスベクタ    
+    def print_cfg_sac(file, val, acv)
+        if @@api.has_key?(@plugin_arg_str) == false
+            raise "#{@plugin_arg_str} is unknown"
+        elsif @plugin_arg_str != "KERNEL"
+            file.puts "SAC_#{@@api[@plugin_arg_str].at(0)}(#{val[:id]}, { #{acv[:accessPattern1]}, #{acv[:accessPattern2]}, #{acv[:accessPattern3]}, #{acv[:accessPattern4]} });"
+        else
+            file.puts "SAC_#{@@api[@plugin_arg_str].at(0)}({ #{acv[:accessPattern1]}, #{acv[:accessPattern2]}, #{acv[:accessPattern3]}, #{acv[:accessPattern4]} });"
+        end
+    end
+
+end
+
+
+  
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPPlugin.rb	(revision 374)
@@ -0,0 +1,355 @@
+# coding: utf-8
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2014-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#  $Id$
+#++
+
+
+require_tecsgen_lib "HRPKernelObjectManager.rb"
+#
+# 各メソッドの役割りは、DomainPlugin.rb を参照のこと
+# HRPカーネル用ドメインプラグイン
+class HRPPlugin < DomainPlugin
+  
+  def initialize( region, name, option )
+    super
+    dbgPrint "HRPPlugin: initialize: region=#{region.get_name}, domainName=#{name}, option=#{option}\n"
+    @region = region
+    @name   = name
+    case option
+    when "kernel", "user", "OutOfDomain"
+      # OK
+      @option = option
+    else
+      cdl_error( "HRPPlugin: '$1' is unacceptable domain kind, specify 'kernel' or 'user'", option )
+      @option = "kernel"   # とりあえず kernel を設定しておく
+    end
+  end
+
+  def add_through_plugin( join, current_region, next_region, through_type )
+    # join.get_owner:Cell  左辺のセル
+    # join.get_definition:Port 呼び口
+    # join.get_subscript:Integer or nil 呼び口配列の添数 (Join::@subscript の説明参照)
+    # join.get_cell:Cell 右辺のセル
+    # join.get_port_name:Symbol 受け口
+    # get_rhs_subscript:Integer or nil 受け口配列の添数 (Join::@rhs_subscript の説明参照)
+    # return []
+    dbgPrint "MyDomainPlugin: add_through_plugin: #{current_region.get_name}=>#{next_region.get_name}, #{join.get_owner.get_name}.#{join.get_definition.get_name}=>#{join.get_cell.get_name}.#{join.get_port_name}, #{through_type}\n"
+
+    #puts "=====Join Check Start====="
+    #puts "caller: #{join.get_owner.get_name.to_s}, callee: #{join.get_cell.get_name.to_s}"
+    #puts "=====Join Check param====="
+    current_domain = current_region.get_domain_root.get_domain_type
+    next_domain = next_region.get_domain_root.get_domain_type
+    #puts current_domain.get_option.to_s
+    # if !next_domain.nil?
+    #     puts next_domain.get_option.to_s
+    # else
+    #     puts "next domain is nil!"
+    # end
+
+    HRPPlugin.add_inter_domain_join_set join
+    # p join.get_cell.get_name
+    # p join.get_cell.get_real_celltype(join.get_rhs_port1).get_name
+    # if HRPKernelObjectManager.include_celltype?(join.get_cell.get_celltype.get_global_name)   #oyama: get_name => get_global_name 
+    if HRPKernelObjectManager.include_celltype?(join.
+                                                 get_cell.
+                                                 get_real_celltype(join.get_rhs_port1).
+                                                 get_global_name)                #oyama: get_name => get_global_name 
+        # 結合先がカーネルオブジェクトセル
+        # @plugin_body = HRP2SVCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
+        # 何もしないthrough
+        # puts "***** #{join.get_cell.get_celltype.get_name} is kernel object"
+        return []
+        # return [ :HRP2SVCPlugin, "channelCelltype=tMessagebufferChannel,noClientSemaphore=true" ]
+    # elsif @end_region.is_root?
+    # elsif next_region.get_option == OutOfDomain
+    # elsif next_domain.nil?
+    elsif next_domain.get_option.to_s == "OutOfDomain"
+    #     # 結合先が無所属
+    #     # 何もしないthrough
+    #     # @plugin_body = HRP2SVCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
+        # puts "***** nil"
+        return []
+    #elsif @start_region.get_param != :KERNEL_DOMAIN && @end_region.get_param == :KERNEL_DOMAIN
+    elsif current_domain.get_option.to_s != "kernel" && next_domain.get_option.to_s == "kernel"
+        # ユーザドメインからカーネルドメインへの結合
+        # @plugin_body = HRP2SVCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
+        # puts "***** svc"
+        return [ :HRPSVCPlugin, "" ]
+    elsif current_domain != next_domain
+        # 別のユーザドメインへの結合
+        # @plugin_body = HRP2RPCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
+        # puts "***** rpc"
+        # return [ :HRPRPCPlugin, "channelCelltype=tMessagebufferChannel,noClientSemaphore=true" ]
+        # puts "HRPPlugin:RPC:PPAllocatorSize=256"
+        return [ :HRPRPCPlugin, "noClientSemaphore=false,PPAllocatorSize=256" ]
+    else
+        # その他
+        # 何もしないthrough
+        # @plugin_body = HRP2SVCPlugin.new(cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell)
+        dbgPrint "warning: at HRP Join Check"
+        return nil
+    end
+
+    # puts "=====Join Check End====="
+  end
+
+  def joinable?(current_region, next_region, through_type )
+    dbgPrint "MyDomainPlugin: joinable? from #{current_region.get_name} to #{next_region.get_name} (#{through_type})\n"
+    return true
+  end
+
+  #== ドメイン種別を返す
+  #return::Symbol :kernel, :user, :OutOfDomain
+  def get_kind
+    return @option.to_sym
+  end
+  
+  def self.gen_post_code file
+  end
+
+  # ATT_MODを生成済みかどうか                   # 2017.8.27
+  @@generate_memory_module = false
+
+  @@include_extsvc_fncd = false  # 17.07.26 暫定
+  # 
+  #  ATT_MODの生成
+  #  gen_factory実行時には，すべてのセルタイププラグインを生成済みのはずなので，
+  #  カーネルAPIコードのメモリ保護を省略できる．
+  #
+  def gen_factory
+    super
+
+    if @@include_extsvc_fncd == false
+      file = AppFile.open( "#{$gen}/tecsgen.cfg" )
+      file.print "/* HRPPlugin 001 */\n"
+      file.print "#include \"extsvc_fncode.h\"\n"   ## 2017.7.26
+      file.close
+      @@include_extsvc_fncd = true
+    end
+
+    if @@generate_memory_module == false
+
+      # INCLUDE を出力
+      #  すべてのドメインに対する cfg を先に生成しておく
+      #  もし、ドメインに属するカーネルオブジェクトも、モジュールもない場合でも、cfg が出力される
+      regions = DomainType.get_domain_regions[ :HRP ]
+      file = AppFile.open( "#{$gen}/tecsgen.cfg" )
+      file.print "/* HRPPlugin 002 */\n"
+      regions.each{ |region|
+        if ! region.is_root? then
+          nsp = "#{region.get_global_name}"
+          file2 = AppFile.open( "#{$gen}/tecsgen_#{nsp}.cfg" )
+          file2.close
+          case region.get_domain_type.get_kind
+          when :kernel
+            pre = "KERNEL_DOMAIN{\n    "
+            post = "}\n"
+          when :user
+            pre = "DOMAIN(#{region.get_name}){\n    "
+            post = "}\n"
+          when :OutOfDomain
+            pre = ""
+            post = "\n"
+          end
+          file.puts "#{pre}INCLUDE(\"#{$gen}/tecsgen_#{nsp}.cfg\");\n#{post}"
+        end
+      }
+      file.print "/* HRPPlugin 002 end */\n\n"
+      file.close
+
+      check_celltype_list = []
+
+      # 
+      #  ATT_MODの生成
+      #
+      Cell.get_cell_list2.each { |cell|
+        # すべてのセルを走査してセルタイプをチェック
+        ct = cell.get_celltype
+        if ct.class == Celltype && check_celltype_list.include?( ct ) == false
+          # チェック済みセルタイプに登録
+          check_celltype_list << ct
+
+          # 未チェックのセルタイプだった場合
+          # puts "check for ATT_MOD : #{ct.classget_global_name}"
+          # puts "check for ATT_MOD : #{ct.get_global_name}"
+
+          # カーネルAPIのコード，データはメモリ保護しない # HRP3 oyama delete by Takada's request
+          # next if HRPKernelObjectManager.include_celltype?( ct.get_name )
+
+          # 必要のないセルタイプのコード，データはメモリ保護しない
+          next if ! ct.need_generate?
+
+          # HRPのドメインリージョンを取得
+          regions = ct.get_domain_roots
+          regions_hrp = regions[ :HRP ]
+          dbgPrint "HRP domain in #{ct.get_name}: "
+          regions_hrp.each { |reg|
+            dbgPrint reg.get_name
+          }
+          # puts ""
+
+          # セル管理ブロックとスケルトンのメモリ保護
+          # gen_celltype_names_domain 相当の処理
+          if regions_hrp.include?( Region.get_root ) == false && regions_hrp.length > 1
+            # ドメインが複数で，OutOfDomainにセルが存在しないセルタイプの場合
+            # 共有のセル管理ブロックとスケルトンコードを登録する
+            file = AppFile.open( "#{$gen}/tecsgen.cfg" )
+            file.printf "%-60s/* HRPPlugin 003 */\n", "ATT_MOD(\"#{ct.get_global_name}_tecsgen.o\");"
+            file.close
+          end
+
+          regions_hrp.each { |reg|
+            if reg.is_root? 
+              nsp = ""
+            else
+              nsp = "_#{reg.get_global_name}"
+            end
+            file = AppFile.open( "#{$gen}/tecsgen#{nsp}.cfg" )
+            file.printf "%-50s/* HRPPlugin 004 */\n", "ATT_MOD(\"#{ct.get_global_name}#{nsp}_tecsgen.o\");"
+            file.close
+          }
+
+          # セルタイプコードがない場合はスキップ
+          next if ct.is_all_entry_inline? && ! ct.is_active?
+
+          # セルタイプコードのメモリ保護
+          # gen_celltype_names_domain2 相当の処理
+          if regions_hrp.include?( Region.get_root ) == true || regions_hrp.length > 1
+            # OutOfDomainにセルが存在するセルタイプの場合
+            # または，複数のドメインにセルが存在するセルタイプの場合
+            # セルタイプコードを共有するように登録する
+            file = AppFile.open( "#{$gen}/tecsgen.cfg" )
+          else
+            # OutOfDomainでない単一のドメインにセルが存在するセルタイプの場合
+            # セルタイプコードを専有するように登録する
+            file = AppFile.open( "#{$gen}/tecsgen_#{regions_hrp[0].get_global_name}.cfg" )
+          end
+
+          file.printf "%-50s/* HRPPlugin 005 */\n", "ATT_MOD(\"#{ct.get_global_name}.o\");"
+          file.close
+        else
+          # 何もしない
+        end
+      }
+
+      @@generate_memory_module = true
+    else
+      # 何もしない
+    end
+  end
+
+  #----- Inter Domain Join Set -----#
+  @@inter_domain_join_set = {}      #{entry_cell =>{domain_root=>count} }  Hash of inter domain join
+  def self.add_inter_domain_join_set join
+    rhs_cell = join.get_cell
+    dbgPrint "--------- add_inter_domain:#{join.get_owner.get_namespace_path} => #{join.get_cell.get_namespace_path}-----\n"
+    domain_root = join.get_owner.get_region.get_domain_root   # lhs cell's domain root
+    if @@inter_domain_join_set[ rhs_cell ] == nil then
+      @@inter_domain_join_set[ rhs_cell ] = []
+    end
+    # 左辺のドメインルートを記録
+    @@inter_domain_join_set[ rhs_cell ] << join
+  end
+  def self.get_inter_domain_join_set rhs_cell
+    if @@inter_domain_join_set[ rhs_cell ] then
+      @@inter_domain_join_set[ rhs_cell ].uniq!
+    else
+      @@inter_domain_join_set[ rhs_cell ] = []
+    end
+    return @@inter_domain_join_set[ rhs_cell ]
+  end
+  def self.get_inter_domain_join_roots rhs_cell
+    dbgPrint "--------- get_inter_domain #{rhs_cell.get_namespace_path} -----\n"
+    domain_roots = []
+    set = get_inter_domain_join_set rhs_cell
+    set.each{ |join|
+      dbgPrint "--------- get_inter_domain:#{join.get_owner.get_namespace_path} => #{join.get_cell.get_namespace_path}-----\n"
+      # if join.get_owner.get_region.get_domain_root.get_domain_type.get_option == "user" then
+        domain_roots << join.get_owner.get_region.get_domain_root
+      # end
+    }
+    return domain_roots.uniq
+  end
+
+  def self.get_sac_str cell
+    domain_roots = self.get_inter_domain_join_roots cell
+    delim = ""
+    acv = ""
+    cell_domain_root = cell.get_region.get_domain_root
+    if cell_domain_root.get_domain_type.get_kind != :OutOfDomain then
+      domain_roots << cell.get_region.get_domain_root  # 結合先のドメインも含める
+    end
+    domain_roots.each{ |dr|
+      case dr.get_domain_type.get_kind
+      when :kernel
+        acv += "#{delim}TACP_KERNEL"
+        delim = "|"
+      when :user
+        acv += "#{delim}TACP(#{dr.get_name})"
+        delim = "|"
+        if cell_domain_root.get_domain_type.get_kind != :OutOfDomain &&
+           dr.get_namespace_path != cell_domain_root.get_namespace_path then
+          cdl_error( "HRP9999 '$1': kernel object joined from other user domain. kernel object joined from multi-user-domain must be placed out of domain", cell.get_name )
+        end
+      when :OutOfDomain
+        if cell_domain_root.get_domain_type.get_kind == :OutOfDomain then
+          acv += "#{delim}TACP_SHARED"
+          delim = "|"
+        end
+      else
+        raise "unkown domain kind"
+      end
+    }
+    if acv == "" then
+      # 呼び先セルが無所属かつ、呼び元も無所属のみ、または結合無しの場合
+      acv = "TACP_SHARED"
+    end
+    sac_str = "{"
+    delim = ""
+    [:accessPattern1, :accessPattern2, :accessPattern3, :accessPattern4].each{ |acp|
+      init = (cell.get_attr_initializer acp).to_s
+      if init != "OMIT"
+        sac_str += delim + init
+      else
+        sac_str += delim + acv
+      end
+      delim = ", "
+    }
+    return sac_str + '}'
+  end
+end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPRPCPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPRPCPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPRPCPlugin.rb	(revision 374)
@@ -0,0 +1,415 @@
+# coding: utf-8
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#  $Id$
+#++
+
+require_tecsgen_lib "lib/GenOpaqueMarshaler.rb"
+require_tecsgen_lib "lib/GenParamCopy.rb"
+
+#= HRPRPCPlugin プラグイン
+# スループラグイン (through)
+# ・OpaqueMarshalerPlugin を使用してマーシャラセルタイプを生成する
+# ・マーシャラ、TDR、チャンネル、メッセージバッファを生成する
+#
+class HRPRPCPlugin < ThroughPlugin
+
+  include GenOpaqueMarshaler
+  include GenParamCopy
+
+  # RPCPlugin 専用のオプション
+  HRPRPCPluginArgProc = RPCPluginArgProc.dup  # 複製を作って元を変更しないようにする
+  HRPRPCPluginArgProc[ "noClientSemaphore"  ] = Proc.new { |obj,rhs| obj.set_noClientSemaphore rhs }
+  HRPRPCPluginArgProc[ "semaphoreCelltype"  ] = Proc.new { |obj,rhs| obj.set_semaphoreCelltype rhs }
+  @@isFirstInstance = true
+
+  #=== RPCPlugin の initialize
+  #  説明は ThroughPlugin (plugin.rb) を参照
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
+    super
+    @b_noClientSemaphore = false
+    @semaphoreCelltype = "tSemaphore"
+    initialize_opaque_marshaler
+
+    # オプション：GenOpaqueMarshaler 参照
+    @plugin_arg_check_proc_tab = HRPRPCPluginArgProc
+    parse_plugin_arg
+
+    @rpc_channel_celltype_name = "tRPCPlugin_#{@TDRCelltype}_#{@channelCelltype}_#{@signature.get_name}"
+    @rpc_channel_celltype_file_name = "#{$gen}/#{@rpc_channel_celltype_name}.cdl"
+
+    if @signature.get_context == "non-task" then
+        cdl_error( "HRP9999 RPC cannot be applied to non-task context signature '$1'", @signature.get_name )
+    elsif @signature.get_context == "any" then
+        cdl_info( "HRP9999 RPC is applied to any context signature '$1'", @signature.get_name )
+    end
+
+    if @signature.need_PPAllocator?(true) then
+      if @PPAllocatorSize == nil then
+        cdl_error( "HRP9999 PPAllocatorSize must be speicified for pointer argments" )
+        # @PPAllocatorSize = 0   # 仮に 0 としておく (cdl の構文エラーを避けるため)
+      end
+    elsif @PPAllocatorSize then
+      cdl_warning( "HRP9999 PPAllocatorSize speicified in spite of PPAllocator unnecessary" )
+      @PPAllocatorSize = nil
+    end
+
+#    @signature.each_param{ |func_decl, param_decl|
+#      if func_decl.get_type.is_oneway? then
+#        if ( param_decl.get_size || param_decl.get_count ) && param_decl.get_string then
+#          cdl_error( "array of string not supported for oneway function in Transparent RPC" )  # mikan 文字列の配列
+#        elsif param_decl.get_string == -1 then
+#          cdl_error( "length unspecified string is not permited for oneway function in Transparent RPC" )  # mikan 長さ未指定文字列
+#        end
+#      end
+#    }
+
+    # 
+    #  tecsgen/tecs/rpcにincludeパスを通す
+    #  #include "tecs_rpc.h" を実現するために必要
+    #    大山:削除 Makefile.tecsgen に vpath, INCLUDES を入れるのは、よくない考え
+    #             TECSGEN.add_search_path で Makefile_templ に入れるのがよい
+    # if @@isFirstInstance
+    #     f = AppFile.open( "#{$gen}/Makefile.tecsgen" )
+    #     f.puts "INCLUDES := $(INCLUDES) -I $(TECSPATH) -I $(TECSPATH)/rpc"
+    #     f.puts "vpath %.c $(TECSPATH) $(TECSPATH)/rpc"
+    #     f.close()
+    #     @@isFirstInstance = false
+    # end
+  end
+
+  #=== plugin の宣言コード (celltype の定義) 生成
+  def gen_plugin_decl_code( file )
+
+    ct_name = "#{@ct_name}_#{@channelCelltype}"
+
+    # このセルタイプ（同じシグニチャ）は既に生成されているか？
+    if @@generated_celltype[ ct_name ] == nil then
+      @@generated_celltype[ ct_name ] = [ self ]
+    else
+      @@generated_celltype[ ct_name ] << self
+      return
+    end
+
+    f = CFile.open( @rpc_channel_celltype_file_name, "w" )
+    # 同じ内容を二度書く可能性あり (AppFile は不可)
+
+    f.print <<EOT
+import( <rpc.cdl> );
+import( <tMessageBufferCEP.cdl> );
+generate( OpaqueMarshalerPlugin, #{@signature.get_namespace_path}, "" );
+
+composite tOpaqueMarshaler_#{@signature.get_global_name}_through {
+  entry #{@signature.get_namespace_path} eThroughEntry;
+  call sTDR       cTDR;
+  [optional]
+    call sSemaphore cLockChannel;
+  [optional]
+    call sRPCErrorHandler cErrorHandler;
+
+  cell tOpaqueMarshaler_#{@signature.get_global_name} Marshaler{
+    cTDR          => composite.cTDR;
+    cLockChannel  => composite.cLockChannel;
+    cErrorHandler => composite.cErrorHandler;
+  };
+  composite.eThroughEntry => Marshaler.eClientEntry;
+};
+
+EOT
+
+    f.close
+  end
+
+  #===  through cell コードを生成
+  #
+  #
+  def gen_through_cell_code( file )
+
+    gen_plugin_decl_code( file )
+    file.print <<EOT
+import( <#{@rpc_channel_celltype_file_name}> );
+EOT
+
+    case @start_region.get_domain_root.get_domain_type.get_kind
+    when :kernel
+      tacp_str = "\"TACP_KERNEL"
+    when :user
+      tacp_str = "\"TACP(#{@start_region.get_domain_root.get_name})"
+    when :OutOfDomain
+      tacp_str = "\"TACP_SHARED"
+    end
+    # p "end_region=#{@end_region.get_name} kind=#{@end_region.get_domain_root.get_domain_type.get_kind}"
+    case @end_region.get_domain_root.get_domain_type.get_kind
+    when :kernel
+      tacp_str += "|TACP_KERNEL\""
+    when :user
+      tacp_str += "|TACP(#{@end_region.get_domain_root.get_name})\""
+    when :OutOfDomain
+      tacp_str += "|TACP_SHARED\""
+    end
+    nest_str = ""
+    file.print <<EOT
+#{nest_str}  //  MessageBuffer client=>server
+#{nest_str}  cell tMessageBuffer #{@clientChannelCell}Body0{
+#{nest_str}      maxMessageSize = 64;      /* This value must be same as MessageBufferCEP's buffer size */
+#{nest_str}      bufferSize     = 128;
+#{nest_str}      accessPattern1 = C_EXP( #{tacp_str} );
+#{nest_str}      accessPattern2 = C_EXP( #{tacp_str} );
+#{nest_str}      accessPattern3 = C_EXP( #{tacp_str} );
+#{nest_str}      accessPattern4 = C_EXP( #{tacp_str} );
+#{nest_str}  };
+EOT
+    file.print <<EOT
+
+#{nest_str}  //  MessageBuffer server=>client
+#{nest_str}  cell tMessageBuffer #{@clientChannelCell}Body1{
+#{nest_str}      maxMessageSize = 64;      /* This value must be same as MessageBufferCEP's buffer size */
+#{nest_str}      bufferSize     = 128;
+#{nest_str}      accessPattern1 = C_EXP( #{tacp_str} );
+#{nest_str}      accessPattern2 = C_EXP( #{tacp_str} );
+#{nest_str}      accessPattern3 = C_EXP( #{tacp_str} );
+#{nest_str}      accessPattern4 = C_EXP( #{tacp_str} );
+#{nest_str}  };
+EOT
+
+    ##### クライアント側のセルの生成 #####
+    nest = @start_region.gen_region_str_pre file
+    nest_str = "  " * nest
+
+    # セマフォの生成
+    if @b_noClientSemaphore == false then
+      file.print <<EOT
+#{nest_str}  //  Semaphore for Multi-task use ("specify noClientSemaphore" option to delete this)
+#{nest_str}  cell #{@semaphoreCelltype} #{@serverChannelCell}_Semaphore{
+#{nest_str}    initialCount = 1;
+#{nest_str}  };
+EOT
+    end
+
+    # クライアント側チャンネル (tMessageBufferCEP)の生成
+    # チャンネルは必ずリージョン下にあるので、 '::' でつなぐ (でなければ、ルートリージョンにないかチェックが必要）
+
+    file.print <<EOT
+#{nest_str}  //  Client Side Channel
+#{nest_str}  cell tMessageBufferCEP #{@clientChannelCell}_CEP{
+#{nest_str}      cMessageBuffer0 = #{@clientChannelCell}Body0.eMessageBuffer;
+#{nest_str}      cMessageBuffer1 = #{@clientChannelCell}Body1.eMessageBuffer;
+#{nest_str}  };
+
+#{nest_str}  //  Client Side TDR
+#{nest_str}  cell tTDR #{@clientChannelCell}_TDR{
+#{nest_str}    cChannel = #{@clientChannelCell}_CEP.eChannel;
+#{nest_str}  };
+
+#{nest_str}  //  Marshaler
+EOT
+
+    # セマフォの結合文
+    if @b_noClientSemaphore == false then
+      semaphore = "#{nest_str}    cLockChannel = #{@serverChannelCell}_Semaphore.eSemaphore;\n"
+    else
+      semaphore = ""
+    end
+
+    ### クライアント側チャンネル (マーシャラ+TDR)の生成 ###
+    cell = @next_cell
+    # アロケータの指定があるか？
+    if cell.get_allocator_list.length > 0 then
+
+      file.print nest_str
+      file.print "[allocator("
+
+      delim = ""
+      cell.get_allocator_list.each do |type, eport, subsc, func, buf, alloc|
+
+        alloc_str = alloc.to_s
+        subst = @substituteAllocator[alloc_str.to_sym]
+        if subst then
+          alloc_str = subst[2]+"."+subst[3]
+        end
+
+        file.print delim
+        delim = ",\n"        # 最終行には出さない
+
+        if subsc then        # 配列添数
+          subsc_str = '[#{subsc}]'
+        else
+          subsc_str = ""
+        end
+
+        eport = "eThroughEntry" #RPCの受け口名に変更
+        file.print nest_str
+        file.print  "#{eport}#{subsc_str}.#{func}.#{buf} = #{alloc_str}"
+      end
+
+      file.puts ")]"
+    end
+
+    if @clientErrorHandler then
+      clientErrorHandler_str = "#{nest_str}    cErrorHandler = #{@clientErrorHandler};\n"
+    else
+      clientErrorHandler_str = ""
+    end
+
+    file.print <<EOT
+#{nest_str}  cell tOpaqueMarshaler_#{@signature.get_global_name}_through #{@cell_name} {
+#{nest_str}    cTDR = #{@clientChannelCell}_TDR.eTDR;
+#{clientErrorHandler_str}#{semaphore}#{nest_str}  };
+EOT
+    ### END: クライアント側チャンネル (マーシャラ+TDR)の生成 ###
+    @start_region.gen_region_str_post file
+    file.print "\n\n"
+
+    ##### サーバー側のセルの生成 #####
+    nest = @end_region.gen_region_str_pre file
+    nest_str = "  " * nest
+
+    if @serverErrorHandler then
+      serverErrorHandler_str = "#{nest_str}    cErrorHandler = #{@serverErrorHandler};\n"
+    else
+      serverErrorHandler_str = ""
+    end
+
+    if @b_genOpener then
+      opener = "#{nest_str}    cOpener       = #{@serverChannelCell}.eOpener;\n"
+    else
+      opener = ""
+    end
+
+    # サーバー側チャンネル (tMessageBufferCEP)
+    if @PPAllocatorSize then
+      alloc_cell =<<EOT
+
+#{nest_str}  cell tPPAllocator #{@serverChannelCell}_PPAllocator {
+#{nest_str}    heapSize = #{@PPAllocatorSize};
+#{nest_str}  };
+EOT
+      alloc_call_port_join = "#{nest_str}    cPPAllocator = #{@serverChannelCell}_PPAllocator.ePPAllocator;\n"
+    else
+      alloc_cell = ""
+      alloc_call_port_join = ""
+    end
+
+    file.print <<EOT
+#{nest_str}  //  Server Side Channel
+#{nest_str}  cell tMessageBufferCEP #{@serverChannelCell}_CEP{
+#{nest_str}      cMessageBuffer0 = #{@clientChannelCell}Body1.eMessageBuffer;
+#{nest_str}      cMessageBuffer1 = #{@clientChannelCell}Body0.eMessageBuffer;
+#{nest_str}  };
+EOT
+
+    # サーバー側TDR
+    file.print <<EOT
+
+#{nest_str}  //  Server Side TDR
+#{nest_str}  cell tTDR #{@serverChannelCell}_TDR{
+#{nest_str}    cChannel = #{@serverChannelCell}_CEP.eChannel;
+#{nest_str}  };
+EOT
+
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
+
+    # サーバー側チャンネル (アンマーシャラ)
+    file.print <<EOT
+#{alloc_cell}
+#{nest_str}  //  Unmarshaler
+#{nest_str}  cell tOpaqueUnmarshaler_#{@signature.get_global_name} #{@serverChannelCell}_Unmarshaler {
+#{nest_str}    cTDR        = #{@serverChannelCell}_TDR.eTDR;
+#{nest_str}    cServerCall = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
+#{alloc_call_port_join}#{serverErrorHandler_str}#{nest_str}  };
+EOT
+
+    # サーバー側タスクメイン
+    file.print <<EOT
+
+#{nest_str}  //  Unmarshaler Task Main
+#{nest_str}  cell #{@taskMainCelltype} #{@serverChannelCell}_TaskMain {
+#{nest_str}    cMain         = #{@serverChannelCell}_Unmarshaler.eService;
+#{opener}#{nest_str}  };
+EOT
+
+    # サーバー側タスク
+    file.print <<EOT
+
+#{nest_str}  //  Unmarshaler Task
+#{nest_str}  cell #{@taskCelltype} #{@serverChannelCell}_Task {
+#{nest_str}    cTaskBody = #{@serverChannelCell}_TaskMain.eMain;
+#{nest_str}    priority  = #{@taskPriority};
+#{nest_str}    stackSize = #{@stackSize};
+#{nest_str}    attribute = C_EXP( "TA_ACT" );  /* mikan : marshaler task starts at beginning */
+#{nest_str}  };
+EOT
+    @end_region.gen_region_str_post file
+  end
+
+
+  #=== プラグイン引数 noClientSemaphore のチェック
+  def set_noClientSemaphore rhs
+    rhs = rhs.to_sym
+    if rhs == :true then
+      @b_noClientSemaphore = true
+    elsif rhs == :false then
+      @b_noClientSemaphore = false
+    else
+      cdl_error( "RPCPlugin: specify true or false for noClientSemaphore" )
+    end
+  end
+
+  #=== プラグイン引数 semaphoreCelltype のチェック
+  def set_semaphoreCelltype rhs
+    @semaphoreCelltype = rhs.to_sym
+    nsp = NamespacePath.analyze( @semaphoreCelltype.to_s )
+    obj = Namespace.find( nsp )
+    if ! obj.instance_of?( Celltype ) && ! obj.instance_of?( CompositeCelltype ) then
+      cdl_error( "RPCPlugin: semaphoreCelltype '#{rhs}' not celltype or not defined" )
+    end
+  end
+
+  #=== NamespacePath を得る
+  # 生成するセルの namespace path を生成する
+  def get_cell_namespace_path
+#    nsp = @region.get_namespace.get_namespace_path
+    nsp = @start_region.get_namespace_path
+    return nsp.append( @cell_name )
+  end
+
+end
+
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPSVCPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPSVCPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPSVCPlugin.rb	(revision 374)
@@ -0,0 +1,861 @@
+# coding: utf-8
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#  $Id$
+#++
+
+# mikan through plugin: namespace が考慮されていない
+# これを利用する場合、以下のように toppers_jsp.cdl sChannel.cdl を指定する必要がある
+# tecsgen toppers_jsp.cdl sChannel.cdl your_description.cdl
+
+# 以下を仮定（制限事項）
+#  呼び元、呼び先のエンディアン、char, short, int_t, long_t, intptr_t のサイズが同じ
+#  有符号、無符号でサイズが同じ
+
+class SVCManage
+    #
+    #  @@id: TECSのプラグインで生成した拡張サービスコールに割り当てるid
+    #        実際の拡張サービスコールIDは，TFN_TECSGEN_ORIGINで下駄を
+    #        履かせた値となる
+    #        TFN_TECSGEN_ORIGINは，hrp3/include/extsvc_fncode.h で定義
+    #        される
+    #  @@func_ids: 拡張サービスコールの関数名と拡張サービスコールIDを
+    #  　　　対応づけるハッシュ
+    #
+    @@id = 0
+    @@func_ids = {}
+    def initialize()
+        # 
+      #  本クラスはインスタンスを持たない仮想的なクラスである
+        #
+        raise "class #{self.class.name} shall not have instances"
+    end
+    def self.get_func_id func_name
+        return @@func_ids[ func_name ]
+    end
+    def self.set_func_id func_name
+        @@func_ids[ func_name ] = self.assign_id
+        # puts @@func_ids[ func_name ]
+    end
+    def self.get_id
+        return @@id
+    end
+    def self.set_id id
+        @@id = id
+    end
+    def self.assign_id
+        assignedId = @@id
+        @@id += 1
+        return assignedId
+    end
+end
+
+#
+#  拡張サービスコールを用いたドメイン間通信の
+#  throughプラグイン
+#  HRPドメインプラグインによって挿入される
+#  前提条件: 呼出し先がカーネルオブジェクトかどうかの判定はHRPドメインプラグイン
+#  　　　　　で実施されるため，ここでは判定しないこととした
+#
+class HRPSVCPlugin < ThroughPlugin
+
+  NUM_SVC_ARG_MAX = 5              # HRP3 の拡張サービスコールで扱うことのできる引数の最大個数
+
+  @@generated_celltype ={}    # セルタイプの重複排除用
+  @@generated_cell = {}       # セルの重複排除用
+
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
+    super
+
+    # 受け口配列の場合、配列添数ごとに別のセルタイプとする
+    # セルタイプをシングルトン化したいため。
+    # さもないと、セルを識別する引数を渡す必要があり、NUM_SVC_ARG_MAX(5) つしか渡せない引数の一つを消費することになるため。
+    if @next_cell_port_subscript then
+      subscript = "__" + @next_cell_port_subscript.to_s
+    else
+      subscript = ""
+    end
+    @ct_name_body = "#{@ct_name}SVCBody_#{@next_cell.get_name}_#{@next_cell_port_name}#{subscript}".to_sym
+    @ct_name = "#{@ct_name}SVCCaller_#{@next_cell.get_name}_#{@next_cell_port_name}#{subscript}".to_sym
+    @cell_name_body = "#{@cell_name}SVCBody".to_sym
+    @cell_name = "#{@cell_name}SVCCaller".to_sym
+    # puts "%%%% "
+    # p @next_cell.get_name
+    # p @caller_cell.get_name
+    @b_printed_include_stdint = false
+    check_signature signature
+  end
+
+  #=== NamespacePath を得る
+  # 生成するセルの namespace path を生成する
+  def get_cell_namespace_path
+#    nsp = @region.get_namespace.get_namespace_path
+    nsp = @start_region.get_namespace_path
+    return nsp.append( @cell_name )
+  end
+
+  def gen_plugin_decl_code( file )
+
+    # このセルタイプ（同じシグニチャ）は既に生成されているか？
+    if @@generated_celltype[ @ct_name_body ] == nil then
+        @@generated_celltype[ @ct_name_body ] = [ self ]
+        file2 = CFile.open( "#{$gen}/#{@ct_name_body}.cdl", "w" )
+        file2.print <<EOT
+import_C( "t_stdlib.h" );
+
+/* HRPSVC0001 */
+[active,singleton]
+celltype #{@ct_name_body} {
+    call #{@signature.get_name} #{@call_port_name};
+    FACTORY {
+		write("$ct$_tecsgen.h", "#include \\"kernel_cfg.h\\"");
+    };
+};
+EOT
+        file2.close
+    else
+      @@generated_celltype[ @ct_name_body ] << self
+    end
+    file.print "import( \"#{$gen}/#{@ct_name_body}.cdl\" );\n"
+
+    # このセルタイプ（同じシグニチャ）は既に生成されているか？
+    if @@generated_celltype[ @ct_name ] == nil then
+        @@generated_celltype[ @ct_name ] = [ self ]
+        file2 = CFile.open( "#{$gen}/#{@ct_name}.cdl", "w" )
+        file2.print <<EOT
+/* HRPSVC0002 */
+celltype #{@ct_name} {
+    entry #{@signature.get_name} #{@entry_port_name};
+    FACTORY {
+		write("$ct$_tecsgen.h", "#include \\"extsvc_fncode.h\\"");
+    };
+};
+EOT
+        file2.close
+    else
+      @@generated_celltype[ @ct_name ] << self
+    end
+    file.print "import( \"#{$gen}/#{@ct_name}.cdl\" );\n"
+
+=begin
+    # TODO: send. receive 対応
+    send_receive = []
+    if @signature != nil then
+      @signature.each_param{ |fd,param|
+        dir =param.get_direction
+        case dir
+        when :SEND, :RECEIVE
+          send_receive << [ dir, fd, param ]
+        end
+      }
+    end
+=end
+
+=begin
+composite #{@ct_name} {
+    entry #{@signature.get_name} #{@entry_port_name};
+    call #{@signature.get_name} #{@call_port_name};
+
+    cell #{@ct_name}Client #{@cell_name}Client{
+    };
+
+    [active]
+    cell #{@ct_name}Server #{@cell_name}Server{
+        #{@call_port_name} => composite.#{@call_port_name};
+    };
+
+    composite.#{@entry_port_name} => #{@cell_name}.#{@entry_port_name};
+};
+=end
+
+  end
+
+  #===  through cell コードを生成
+  #
+  #
+  def gen_through_cell_code( file )
+
+    # gen_plugin_decl_code( file )  this is called from super.
+
+    # セルを探す
+    # path =["::",@next_cell.get_name]  # mikan namespace
+    # cell = Namespace.find( path )
+    # cell = Namespace.find( @next_cell.get_namespace_path )
+
+    ##### クライアント側のセルの生成 #####
+    # file.print "[domain(HRP, \"kernel\")]"
+    nest = @start_region.gen_region_str_pre file
+    nest_str = "  " * nest
+
+    # クライアント側チャンネルの生成
+    # 拡張サービスコール呼出し
+    file.print <<EOT
+/* HRPSVC0003 */
+#{nest_str}  //  Client Side Channel
+#{nest_str}  cell #{@ct_name} #{@cell_name}{
+#{nest_str}  };
+
+EOT
+
+    @start_region.gen_region_str_post file
+    file.print "\n\n"
+
+    ##### サーバー側のセルの生成 #####
+    # print "######  #{@cell_name_body} ... #{@ct_name_body} #{@@generated_cell[ @ct_name_body ].class}  #####\n"
+
+    if @@generated_cell[ @ct_name_body ] then
+      file.print "/* cell #{@ct_name_body} #{@@generated_cell[ @ct_name_body ]}: already generated. */\n"
+    else
+      @@generated_cell[ @ct_name_body ] = @cell_name_body
+      nest = @end_region.gen_region_str_pre file
+      nest_str = "  " * nest
+      if @next_cell_port_subscript then
+        subscript = '[' + @next_cell_port_subscript.to_s + ']'
+      else
+        subscript = ""
+      end
+
+      # サーバー側チャンネルの生成 
+      # 拡張サービスコール本体
+      file.print <<EOT
+
+/* HRPSVC0004 */
+#{nest_str}  //  Server Side Channel
+#{nest_str}  cell #{@ct_name_body} #{@cell_name_body}{
+#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
+#{nest_str}  };
+EOT
+
+      @end_region.gen_region_str_post file
+
+      file2 = AppFile.open( "#{$gen}/tecsgen.cfg" )
+      file2.print "\n/* Generated by HRPSVCPlugin */\n\n"
+      file2.print <<EOT
+/* HRPSVC0005 */
+#include "#{@ct_name_body}_factory.h"
+EOT
+      file2.close
+
+      # callee_cell のget_restricted_regions を呼び出しておく
+      # restrict が参照された印をつけるため
+      @callee_cell.get_restricted_regions( :dummy_entry_name, :dummy_func_name )
+    end
+  end
+
+  #===  受け口関数の本体(C言語)を生成する
+  #     通常であれば、ジェネレータは受け口関数のテンプレートを生成する
+  #     プラグインの場合、変更する必要のないセルタイプコードを生成する
+  #file::           FILE        出力先ファイル
+  #b_singleton::    bool        true if singleton
+  #ct_name::        Symbol
+  #global_ct_name:: string
+  #sig_name::       string
+  #ep_name::        string
+  #func_name::      string
+  #func_global_name:: string
+  #func_type::      class derived from Type
+  def gen_ep_func_body( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+        # puts "generate ep_func for #{ct_name}"
+
+        #
+        #  拡張サービスコール呼出し側の関数生成
+        #
+        #  完成形のイメージ
+        #  
+        # ER_UINT
+        # eThroughEntry_write(CELLIDX idx, const char* buffer, uint_t length)
+        # {
+        #   ER_UINT  retval;
+        #   tHRPSVCPlugin_<Sig>SVCCaller_<Cell>_<Entry>_CB    *p_cellcb;
+        #   if( VALID_IDX( idx ) ){
+        #       p_cellcb = tHRPSVCPlugin_<Sig>SVCBody_<Cell>_<Entry>_GET_CELLCB(idx);
+        #   }else{
+        #       /* エラー処理コードをここに記述 */
+        #   }
+        # 
+        #   retval = (ER_UINT)cal_svc( TFN_TECSGEN_ORIGIN + svcid, 
+        #                              (intptr_t)par1, (intptr_t)par2, 0, 0, 0 );
+        #
+        #   return retval;
+        # }
+
+        if ! func_type.get_type.kind_of?( VoidType ) then
+            file.print( "  #{func_type.get_type_str}  retval;\n" )
+        end
+
+        # p "celltype_name, sig_name, func_name, func_global_name"
+        # p "#{ct_name}, #{sig_name}, #{func_name}, #{func_global_name}"
+
+        delim = ""
+        if ! func_type.get_type.kind_of?( VoidType ) then
+            file.print( "  retval = (#{func_type.get_type_str})" )
+        else
+            file.print( "  " )
+        end
+
+        #file.print( "#{@call_port_name}_#{func_name}(" )
+        SVCManage.set_func_id( "#{@ct_name_body}_#{func_name}" )
+        svcid = SVCManage.get_func_id( "#{@ct_name_body}_#{func_name}" )
+        #file.print( "cal_svc( #{@ct_name_body}_#{func_name}" )
+        file.print( "cal_svc( TFN_TECSGEN_ORIGIN + #{svcid.to_s}" )
+
+        #    if ( ! b_singleton ) then
+        #      file.print( " tecs_this" )
+        #      delim = ","
+        #    end
+
+        i = 0
+        passed_param = {}
+        params.each{ |param|
+            delim = ","
+            file.printf( "#{delim} (intptr_t)#{param.get_name}" )
+            passed_param[i] = param.get_name
+            i += 1
+        }
+
+        while(i < NUM_SVC_ARG_MAX) do
+            delim = ","
+            file.printf( "#{delim} 0" )
+            passed_param[i] = "par#{i+1}"
+            i += 1
+        end
+
+        file.print( " );\n\n" )
+
+        if ! func_type.get_type.kind_of?( VoidType ) then
+            file.print( "  return retval;\n" )
+        end
+
+        #
+        #  拡張サービスコール本体側の関数生成
+        #
+        #  完成形のイメージ
+        #  
+        # ER_UINT
+        # eThroughEntry_write(CELLIDX idx, const char* buffer, uint_t length)
+        # {
+        #   ER_UINT  retval;
+        #   tHRPSVCPlugin_<Sig>SVCBody_<Cell>_<Entry>_CB    *p_cellcb;
+        #   if( VALID_IDX( idx ) ){
+        #       p_cellcb = tHRPSVCPlugin_<Sig>SVCBody_<Cell>_<Entry>_GET_CELLCB(idx);
+        #   }else{
+        #       /* エラー処理コードをここに記述 */
+        #   }
+        # 
+        #   retval = (ER_UINT)cal_svc( TFN_TECSGEN_ORIGIN + svcid, 
+        #                              (intptr_t)par1, (intptr_t)par2, 0, 0, 0 );
+        #
+        #   return retval;
+        # }
+            file2 = AppFile.open( "#{$gen}/#{@ct_name_body}.c" )
+            if @b_printed_include_stdint == false then
+              file2.print <<EOT
+#ifndef SIZE_MAX
+#define  SIZE_MAX   (~0UL)
+#endif
+
+EOT
+              @b_printed_include_stdint = true
+            end
+
+            if func_type.get_type.kind_of?( VoidType ) then
+                retval_assign = ""
+            else
+                retval_assign = "retval = (ER_UINT)"
+            end
+
+            file2.print <<EOT
+/* HRPSVC0006 */
+ER_UINT
+#{@ct_name_body}_#{func_name}(intptr_t #{passed_param[0]}, intptr_t #{passed_param[1]}, intptr_t #{passed_param[2]}, intptr_t #{passed_param[3]}, intptr_t #{passed_param[4]}, ID cdmid)
+{
+    ER_UINT retval = E_OK;
+
+EOT
+
+            # 
+            #  エラーチェック処理の生成
+            #
+
+            # 
+            #  呼出し元ドメインのチェック
+            #   * private method: gen_caller_check_code参照
+            #
+            generated_check_code = gen_caller_check_code(func_name)
+            check_code = generated_check_code["check_code"]
+            user_cannot_callable = generated_check_code["user_cannot_callable"]
+
+            # 
+            #  パラメータにポインタが存在する場合，呼出し元タスクに対する
+            #  アクセス権のチェック処理を出力する
+            #  ※ cdmidがカーネルドメイン(拡張サービスコール呼出し中のユーザ
+            #    ドメインを含む)であればprb_memの処理をスキップし，初段の
+            #    拡張サービスコールのみprb_memを呼出し元タスクに発行する
+            #
+            num = 0
+            params.each{ |param|
+                if param.get_declarator.get_ptr_level > 0 then
+                    align_check_str = "!ALIGN_TYPE(#{passed_param[num]}, #{param.get_type.get_referto.get_type_str}) || "
+                  
+                    if param.get_type.get_referto.kind_of?(IntType) then
+                        case param.get_type.get_referto.get_bit_size
+                        when -11, -1, 8   # char, char_t, int8_t (無符号含む)
+                        #
+                        #  charデータの場合，ALIGN_TYPEは必ずTRUE
+                        #  となるので，エラーチェックを省略
+                        #  char型の@bit_sizeは-11
+                        #  tecsgen/tecslib/core/types.rbを参照
+                        #
+                          align_check_str = ""
+                        end
+                    end
+                    if param.get_direction == :IN then
+                        #
+                        #  入力([in])のポインタパラメータは，呼出し元タスクに
+                        #  TPM_READ(読出し可能)のアクセス権が必要
+                        #
+                        # 二重ポインタが不可のため、size_is と string が同時に設定されることはない
+                        prb_func = "prb_mem"
+                        if param.get_size then
+                          size_str = param.get_size.to_s
+                        elsif param.get_string == -1 then
+                          size_str = "SIZE_MAX"
+                          prb_func = "prb_str"
+                        elsif param.get_string then
+                          size_str = param.get_string.to_s
+                          prb_func = "prb_str"
+                        else
+                          size_str = "1"
+                        end
+                        check_code.concat <<EOT
+        /* HRPSVC0007 */
+        if (#{align_check_str}#{prb_func}((void *)#{passed_param[num]}, sizeof(#{param.get_type.get_referto.get_type_str}) * (#{size_str}), TSK_SELF, TPM_READ) != E_OK) {
+            return E_MACV;
+        }
+EOT
+
+                    elsif param.get_direction == :OUT || param.get_direction == :INOUT then
+                        #
+                        #  出力([out])のポインタパラメータは，呼出し元タスクに
+                        #  TPM_WRITE(書込み可能)のアクセス権が必要
+                        #
+                        prb_func = "prb_mem"
+                        if param.get_size then
+                          size_str = param.get_size.to_s
+                        elsif param.get_string then          # 引数なしの string はない
+                          size_str = param.get_string.to_s
+                          # prb_func = "prb_str"             # out, inout の場合、必ず領域を確保する. prb_mem を用いる
+                        else
+                          size_str = "1"
+                        end
+                        check_code.concat <<EOT
+        /* HRPSVC0008 */
+        if (#{align_check_str}#{prb_func}((void *)#{passed_param[num]}, sizeof(#{param.get_type.get_referto.get_type_str}) * (#{size_str}), TSK_SELF, TPM_WRITE) != E_OK) {
+            return E_MACV;
+        }
+EOT
+
+                    end
+                end
+                num += 1
+            }
+
+            # 
+            #  呼出し元がカーネルドメインのみ許可されている場合，
+            #  すべてのユーザドメインからの呼出しに対し，E_OACVを返す
+            #
+            if user_cannot_callable
+                check_code = "\t\treturn E_OACV;"
+            end
+
+            if check_code != ""
+                # 
+                #  呼出し元がカーネルドメインの場合，アクセス権のチェック
+                #  処理をスキップさせる
+                #
+                file2.print <<eot
+    if (cdmid != TDOM_KERNEL) {
+#{check_code}
+    }
+eot
+            end
+
+            # 
+            #  拡張サービスコール本体(本来の受け口関数)を呼び出す
+            #
+            file2.print"    #{retval_assign}#{@call_port_name}_#{func_name}("
+
+            delim = ""
+            num = 0
+            params.each{ |param|
+                file2.print "#{delim}"
+                delim = ", "
+                file2.print "(#{param.get_type.get_type_str})"
+                file2.print passed_param[num]
+                file2.print param.get_type.get_type_str_post
+                num += 1
+            }
+
+            file2.print ");\n"
+
+            file2.print "\n    return retval;\n"
+            file2.print "}\n\n"
+
+            file2.close
+
+            # 
+            #  拡張サービスコールの登録
+            #
+            file2 = AppFile.open( "#{$gen}/tecsgen.cfg" )
+            file2.print "\n/* Generated by HRPSVCPlugin */\n\n"
+            file2.print <<EOT
+/* HRPSVC0009 */
+KERNEL_DOMAIN{
+    DEF_SVC( TFN_TECSGEN_ORIGIN + #{svcid.to_s}, { TA_NULL, #{@ct_name_body}_#{func_name}, SSZ_#{func_global_name} } );
+}
+EOT
+            file2.close
+
+            # 
+            #  拡張サービスコール登録に必要な情報をヘッダに出力
+            #   - 拡張サービスコール呼出し時のチェックで使用するスタックサイズを出力
+            #   - 拡張サービスコールとして登録する関数名のextern宣言を出力
+            #
+            file2 = AppFile.open( "#{$gen}/#{@ct_name_body}_factory.h" )
+            file2.print "\n/* Generated by HRPSVCPlugin */\n\n"
+            file2.print <<EOT
+/* HRPSVC0010 */
+#ifndef SSZ_#{func_global_name}
+#define SSZ_#{func_global_name}	DefaultExtsvcStackSize
+#endif /* SSZ_#{func_global_name} */
+
+/* HRPSVC0011 */
+extern ER_UINT #{@ct_name_body}_#{func_name}(intptr_t par1, intptr_t par2, intptr_t par3, intptr_t par4, intptr_t par5, ID cdmid);
+EOT
+            file2.close
+  end
+
+  def get_callee_cell
+      return @callee_cell
+  end
+
+  def get_caller_cell
+      return @caller_cell
+  end
+
+  def get_callee_ep_name
+      return @join.get_port_name
+  end
+
+  private
+  # 
+  #  拡張サービスコール本体における，呼出し元チェックのコードを
+  #  出力する
+  #  gen_ep_func_body からのみ呼び出される
+  #  引数: 対象の関数名
+  #  返り値: 下記のハッシュ
+  #    {"check_code"=>出力するエラーチェックコード, 
+  #     "user_cannot_callable"=>ユーザドメインが呼出し不可能かどうかのフラグ}
+  #
+  def gen_caller_check_code(func_name)  
+    dbgPrint "gen_caller_check_code(func_name): #{@callee_cell.get_name}\n"
+      # 
+      #  エラーチェック処理
+      #
+      check_code = ""
+      user_cannot_callable = false
+      all_domain_callable = false
+      caller_unrestricted = false
+
+      # 
+      #  呼出し元ドメインのチェック処理
+      #  callable_domains: 拡張サービスコールを呼出し可能なドメインのリスト
+      #    - 無所属のセルから結合されている場合，すべてのセルに対して，
+      #    　callable?をチェックし，呼出し可能なすべてのドメインを返す
+      #    - 無所属以外のセルから結合されている場合，そのセルに対して
+      #      callable?をチェックし，呼出し可能であれば，そのドメインを返す
+      #
+      callable_domains = []
+      @@generated_celltype[ @ct_name_body ].each { |svcplugin|
+          if svcplugin.get_caller_cell.get_region.get_domain_root.get_domain_type.get_option == "OutOfDomain"
+              # 無所属かつ active な場合も、restrict に従う
+              # if svcplugin.get_caller_cell.get_celltype.is_active?
+              #    #
+              #    #  無所属かつactiveなセルは、TECSから存在が認識されていないのを
+              #    #  含む任意のドメインから呼び出される可能性も存在する
+              #    #
+              #    caller_unrestricted = true
+              # else
+              #     # 
+              #     #  無所属から接続されている場合は，すべてのセルの
+              #     #  restrictをチェック
+              #     #
+              #     Cell.get_cell_list2.each { |cell|
+              #         if cell.callable?(svcplugin.get_callee_cell, svcplugin.get_callee_ep_name, func_name)
+              #             callable_domains << cell.get_region.get_domain_root
+              #         end
+              #     }
+              #     print "callable_domains: "
+              #     callable_domains.each{ |dm| print dm.get_name, " " }
+              #     print "\n"
+              # end
+
+              # restrict 指定がある場合には、それに従う。さもなければ、チェックしない
+              callable_domains = @callee_cell.get_restricted_regions( get_callee_ep_name, func_name )
+              if callable_domains == nil then
+                caller_unrestricted = true
+              end
+              #  print "restrict_list: "
+              #  delim = ""
+              #  callable_domains.each{ |domain|
+              #    print delim, domain
+              #    delim = ", "
+              #  }
+              #  print "\n"
+
+          elsif svcplugin.get_caller_cell.callable?( svcplugin.get_callee_cell, svcplugin.get_callee_ep_name, func_name )
+              # 
+              #  特定のドメインから接続されている場合は，呼出し元セルの
+              #  restrictをチェック
+              #
+              callable_domains << svcplugin.get_caller_cell.get_region.get_domain_root
+          else
+              # 
+              #  無所属から結合されておらず，特定の呼出し元ドメインにアクセス権
+              #  がない場合，callable_domainsは空となる
+              #
+              # pp "#{svcplugin.get_caller_cell.get_name} cannot call #{svcplugin.get_callee_cell.get_name}_#{svcplugin.get_callee_ep_name}_#{func_name}"
+          end
+      }
+
+      if caller_unrestricted
+          # pp "caller_unrestricted: #{@ct_name_body}"
+          return {"check_code"=>"", "user_cannot_callable"=>false}
+      end
+
+      # 
+      #  重複を削除
+      #
+      callable_domains.uniq!
+      # 
+      #  無所属に対するドメインチェックは実施しない
+      #  カーネルドメインに対するドメインチェックは実施しない
+      #
+      callable_domains = callable_domains.select { |domain|
+          ((domain.get_domain_type.get_option != "OutOfDomain") && \
+           (domain.get_domain_type.get_option != "kernel"))
+      }
+      # pp "callable_domains"
+      # pp callable_domains.map{|domain| domain.get_name }
+      # 
+      #  すべてのユーザドメインから呼出し可能な場合，ドメインチェックは
+      #  実施しない
+      #
+      all_domain_regions = DomainType.get_domain_regions[:HRP].select { |reg|
+          ((reg.get_domain_type.get_option != "OutOfDomain") && \
+           (reg.get_domain_type.get_option != "kernel"))
+
+      }
+      # pp "all domains"
+      # pp all_domain_regions.map {|reg| reg.get_name}
+      if all_domain_regions.all? {|reg| callable_domains.include?(reg)}
+          all_domain_callable = true
+      end
+
+      # 
+      #  呼出し元ドメインのチェック処理本体の生成
+      #
+      if callable_domains.length == 0
+        dbgPrint "callable_domain.length = 0\n"
+          # 
+          #  ユーザドメインから呼出し不可能な場合は
+          #  個別のエラーチェックはせず，問答無用でE_OACVを返す
+          #
+          user_cannot_callable = true
+      elsif callable_domains.length == 1
+        dbgPrint "callable_domain.length = 1\n"
+          # 
+          #  呼出し可能なユーザドメインが単一の場合は
+          #  cdmid != <domain名> の形式でチェックする
+          #
+          check_code += "\t/* HRPSVC0012.1 */\n"
+          check_code += "\tif (cdmid != #{callable_domains[0].get_name}) {\n"
+      elsif callable_domains.length > 1 && !all_domain_callable
+        dbgPrint "callable_domain.length > 1 && not all_domains \n"
+          # 
+          #  呼出し可能なユーザドメインが複数の場合は
+          #  TACP(cdmid) & (TACP(<domain名>) | ...) != 0U
+          #  の形式でチェックする
+          #
+          check_code += "\t/* HRPSVC0012.2 */\n"
+          check_code += "\tif((TACP(cdmid) & ("
+          check_code += (callable_domains.map { |domain| "TACP(#{domain.get_name})"}).join("|")
+          check_code += ")) != 0U) {\n"
+      else
+        dbgPrint "callable_all_domains\n"
+      end
+      if check_code != ""
+          # 
+          #  呼出し可能なユーザドメインのチェックがある場合は
+          #  エラーコードを返すためのコードを出力する
+          #
+          check_code += <<EOS
+            /* HRPSVC0013 */
+            return E_OACV;
+        }
+EOS
+      end
+
+      return {"check_code"=>check_code, "user_cannot_callable"=>user_cannot_callable}
+  end
+
+  #---------------------------------------------------------#
+  #=== シグニチャのチェック
+  def check_signature signature
+    signature.get_function_head_array.each{ |fh|
+      type = fh.get_return_type
+      check_return_type signature, fh, type
+      if fh.get_paramlist.get_items.length > NUM_SVC_ARG_MAX then
+        cdl_error( "HSV0005 $1.$2: # of parameter more than #{NUM_SVC_ARG_MAX}", signature.get_name, fh.get_name )
+      end
+      fh.get_paramlist.get_items.each{ |param|
+        check_param signature, fh, param
+      }
+    }
+  end
+  #=== 戻り値の型のチェック
+  # ER, ER_UINT は推奨される型
+  # 整数、ブール、void は可能、他は不可
+  def check_return_type signature, fh, type
+    ot = type.get_original_type
+    if( type.get_type_str == "ER" || type.get_type_str == "ER_UINT" ) then
+      # OK!
+    elsif ot.kind_of?( IntType ) || ot.kind_of?( VoidType ) || ot.kind_of?( BoolType ) then
+      cdl_warning( "HSW0001 $1.$2: $3 return type cannot get access violation error", signature.get_name, fh.get_name, type.get_type_str.downcase )
+      check_intptr "#{signature.get_name}.#{fh.get_name} return type", type
+    else
+      cdl_error( "HSV0001 $1.$2 return type $3 cannot be used", signature.get_name, fh.get_name, type.get_type_str.to_s+type.get_type_str_post.to_s )
+    end
+  end
+  #=== 引数の型のチェック
+  def check_param signature, fh, param
+    type = param.get_type
+    ot = type.get_original_type
+    dir = param.get_direction
+    case dir
+    when :IN
+      if ot.kind_of?( IntType ) || ot.kind_of?( BoolType ) then
+        # OK!
+        check_intptr "#{signature.get_name}.#{fh.get_name}.#{param.get_name}", type
+      elsif ot.kind_of? PtrType then
+        check_ptr signature, fh, param, dir
+      else
+        cdl_error( "HSV0002 $1.$2.$3 $4 param type cannot be used", signature.get_name, fh.get_name, param.get_name, type.get_type_str.to_s+type.get_type_str_post.to_s )
+      end
+    when :OUT, :INOUT
+      if ot.kind_of? PtrType then
+        check_ptr signature, fh, param, dir
+      else
+        # error
+      end
+    when :SEND, :RECEIVE
+      cdl_error( "HSV0008 $1.$2.$3 param direction '$4' cannot be used", signature.get_name, fh.get_name, param.get_name, param.get_direction.to_s.downcase )
+    end
+  end
+  def check_ptr signature, fh, param, dir
+    type = param.get_type.get_referto
+    ot = type.get_original_type
+    if ot.kind_of?( IntType ) || ot.kind_of?( BoolType ) || ot.kind_of?( FloatType ) then
+      # OK!
+      check_intptr "#{signature.get_name}.#{fh.get_name}.#{param.get_name}", type
+    elsif ot.kind_of? PtrType then
+      cdl_error( "HSV0003 $1.$2.$3 multi-pointer type cannot be used", signature.get_name, fh.get_name, param.get_name, type.get_type_str.to_s+type.get_type_str_post.to_s )
+    elsif  ot.kind_of? StructType then
+      check_struct signature, fh, param
+    else
+      cdl_error( "HSV0004 $1.$2.$3 $4 type cannot be used", signature.get_name, fh.get_name, param.get_name, type.get_type_str.to_s+type.get_type_str_post.to_s )
+    end
+    if ( dir == :OUT || dir == :INOUT) && param.get_string == -1 then
+      cdl_error( "HSV0009 $1.$2.$3 string argment is necessary for out/inout parameter", signature.get_name, fh.get_name, param.get_name )
+    end
+  end
+  def check_struct signature, fh, param
+    type = param.get_type.get_referto
+    ot = type.get_original_type
+    ot.get_members_decl.get_items.each{ |decl|
+      type = decl.get_type
+      ot = type.get_original_type
+      if ot.kind_of?( IntType ) || ot.kind_of?( BoolType ) || ot.kind_of?( FloatType ) then
+        # OK!
+        check_intptr "#{signature.get_name}.#{fh.get_name}.#{param.get_name}.#{decl.get_name} member", type
+      else
+        dbgPrint "struct member #{decl.get_name} #{type} #{decl.get_type} #{decl.get_type.get_original_type}\n"
+        if( decl.get_type.get_original_type.kind_of? ArrayType ) then
+          dbgPrint "member array type #{decl.get_type.get_original_type.get_type} #{decl.get_type.get_original_type.get_type.get_original_type}\n"
+          check_struct_member_array signature, fh, param, decl
+        else
+          cdl_error( "HSV0006 $1.$2.$3 $4 type cannot be used as struct member", signature.get_name, fh.get_name, param.get_name, type.get_type_str.to_s+type.get_type_str_post.to_s )
+        end
+      end
+    }
+  end
+  def check_struct_member_array signature, fh, param, member_decl
+    # p "check_struct_member_array: #{member_decl.get_type.get_type_str}"
+    type = member_decl.get_type.get_type
+    ot = type.get_original_type
+    if ot.kind_of?( IntType ) || ot.kind_of?( BoolType ) || ot.kind_of?( FloatType ) then
+      # OK!
+      check_intptr "#{signature.get_name}.#{fh.get_name}.#{param.get_name}.#{member_decl.get_name} member", type
+    else
+      cdl_error( "HSV0007 $1.$2.$3 $4 type cannot be used as struct member", signature.get_name, fh.get_name, param.get_name, type.get_type_str.to_s+type.get_type_str_post )
+    end
+  end
+  def check_intptr msg, type
+    dbgPrint "check_intptr IN\n"
+    t = type
+    while( t.kind_of? DefinedType )
+      dbgPrint "check_intptr #{msg} #{t.get_type_str} #{t.get_original_type.get_type_str}\n"
+      tstr = t.get_type_str
+      tstr.sub!( /const /, "" )
+      tstr.sub!( /volatile /, "" )
+      if tstr == "intptr_t" || tstr == "uintptr_t" then
+        cdl_info( "HSI0001 $1 type '$2' not checked by plugin", msg, type.get_type_str )
+      end
+      t = t.get_type
+    end
+  end
+end
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPTaskPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPTaskPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/HRPTaskPlugin.rb	(revision 374)
@@ -0,0 +1,109 @@
+# coding: utf-8
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#  $Id$
+#++
+
+require_tecsgen_lib "HRPKernelObjectPlugin.rb"
+require_tecsgen_lib "HRPKernelObjectManager.rb"
+#== celltype プラグインの共通の親クラス
+class HRPTaskPlugin < HRPKernelObjectPlugin
+    ##
+    # oyama: add to avoid Ruby exception in code generation phase.
+    def new_cell cell
+      region = cell.get_region
+      dbgPrint "HRPTaskCelltypePlugin new_cell=#{cell.get_name} region=#{region.get_name}\n"
+      domainOption = cell.get_region.get_domain_root.get_domain_type.get_option
+      if domainOption == "OutOfDomain"
+        cdl_error( "HRP9999 HRP task '$1' must belong to a domain", cell.get_name )
+      end
+    end
+
+    # # ATT_MODを生成済みかどうか                   # 2017.8.27
+    # @@generate_memory_module = false
+
+    #
+    #  CRE_TSKの出力
+    #  file:: FILE:     出力先ファイル
+    #  cell :: Cell タスクセルインスタンス
+    #  val :: Hash {attr => string}:   カーネルオブジェクトの属性の解析結果
+    #  tab :: string: タブ
+    #
+    def print_cfg_cre(file, cell, val, tab)
+        val[:id] = val[:id].gsub( /(^|[^\$])\$id\$/, "\\1#{@celltype.get_name.to_s}_#{cell.get_name.to_s}" )
+        # $cbp$の代わり
+        cell_IDX = @celltype.get_name_array(cell)[7]
+        # CRE_TSKの生成
+        dbgPrint "assign task plugin\n"
+        domainOption = cell.get_region.get_domain_root.get_domain_type.get_option
+        # if cell.get_region.get_region_type == :DOMAIN
+        if domainOption != "OutOfDomain"
+            if val[:systemStackSize] == "0"
+                # 
+                #  システムスタックの定義を省略
+                #
+                file.print <<EOT
+CRE_TSK(#{val[:id]}, { #{val[:attribute]}, #{cell_IDX}, tTask_start, #{val[:priority]}, #{val[:stackSize]}, NULL });
+EOT
+            else
+                # 
+                #  システムスタックの定義を追加
+                #
+                file.print <<EOT
+CRE_TSK(#{val[:id]}, { #{val[:attribute]}, #{cell_IDX}, tTask_start, #{val[:priority]}, #{val[:stackSize]}, NULL, #{val[:systemStackSize]}, NULL });
+EOT
+            end
+        else
+            #
+            #  無所属のタスクは存在してはならないため，エラーとする
+            #
+            raise "task #{val[:id]} must belong to a domain."
+        end
+    end
+
+    #
+    #  SAC_TSKの出力
+    #  file:: FILE:     出力先ファイル
+    #  val :: Hash {attr => string}:   カーネルオブジェクトの属性の解析結果
+    #  acv :: Hash {accessPatternx => string}:   アクセス許可ベクタ
+    #
+    def print_cfg_sac(file, val, acv)
+       # pp "SAC_TSK"
+       # pp val
+       file.puts "SAC_TSK(#{val[:id]}, { #{acv[:accessPattern1]}, #{acv[:accessPattern2]}, #{acv[:accessPattern3]}, #{acv[:accessPattern4]} });"
+    end
+end
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCellPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCellPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCellPlugin.rb	(revision 374)
@@ -0,0 +1,267 @@
+# -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2017 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#   $Id$
+#++
+
+#== celltype プラグインの共通の親クラス
+class MrubyBridgeCellPlugin < CellPlugin
+
+  # プラグイン引数名 => Proc
+  MrubyBridgePluginArgProc = { 
+      "ignoreUnsigned" => Proc.new { |obj,rhs| obj.set_ignoreUnsigned rhs },
+      "exclude_port" => Proc.new { |obj,rhs| obj.set_exclude_port rhs },
+      "exclude_port_func" => Proc.new { |obj,rhs| obj.set_exclude_port_func rhs },
+      "auto_exclude" => Proc.new { |obj,rhs| obj.set_auto_exclude rhs },
+  }
+  @@b_gen_post_code_by_dependent = false  # true if gen_post_code is called by MrubyBridgeCelltypePlugin
+  @@cell_list = {}      # gen_cdl_file'ed list to avoid duplicate generation
+  @@signature_list = {}
+
+  require_tecsgen_lib( "MrubyBridgeSignaturePlugin.rb" )
+
+  #@exclude_port::[ String(port_name) ] : 
+  #@exclude_port_func::{ [ String(port_name) ] => [ String(func_name) ] } : 
+  #@port_list::{ String(port_name) => String(include/exclude=func_name) }  : all included port and opt_string
+
+  #=== CellPlugin# initialize
+  #cell::     Cell        セル（インスタンス）
+  # このメソッドは、セルの構文解析が終わったところで呼び出される
+  # この段階では意味解析が終わっていない
+  def initialize( cell, option )
+    dbgPrint "  #{self.class.name}: initialzie=#{cell.get_name} option=#{option}\n"
+    super
+    @cell = cell
+
+    # option
+    @b_ignoreUnsigned = false
+    @exclude_port = []
+    @exclude_port_func = {}
+    @b_auto_exclude = true     # auto_exclude = true by default 
+    MrubyBridgeSignaturePlugin.set_gen_post_code_by_dependent
+
+    @plugin_arg_str = CDLString.remove_dquote option
+    # @plugin_arg_str = option.gsub( /\A"(.*)/, '\1' )    # 前後の "" を取り除く
+    # @plugin_arg_str.sub!( /(.*)"\z/, '\1' )
+    @plugin_arg_list = {}
+    dbgPrint "#{self.class.name}: initialzie: #{cell.get_name}\n"
+    @plugin_arg_check_proc_tab = MrubyBridgePluginArgProc
+    parse_plugin_arg
+
+    @port_list = {}         # set @port_list before return
+    ct = @cell.get_celltype
+    return if ct == nil     # error case
+
+    port_list = ct.get_port_list
+    if @exclude_port.length > 0 then
+      # この実装では、存在しない port を指定されてもチェックできない
+      # print "MRBBridgeCellPlugin: exclude list\n"
+      port_list.each{ |port|
+        if ! @exclude_port.include?( port.get_name.to_s ) then
+          # print "MRBBridgeCellPlugin: #{port.get_name} included\n"
+          @port_list[ port ] = ""
+        else
+          # print "MRBBridgeCellPlugin: #{port.get_name} excluded\n"
+        end
+      }
+    else
+      port_list.each{ |port|
+        @port_list[ port ] = ""
+      }
+    end
+
+    if @exclude_port_func.length > 0 then
+      @port_list.each{ |port, opt_str|
+        delim = ""
+        if @exclude_port_func.include?( port.get_name.to_s ) then
+          @exclude_port_func[ port.get_name.to_s ].each{ |func_name|
+            opt_str += delim + "exclude=" + func_name
+            delim = ","
+          }
+        end
+        @port_list[ port ] = opt_str
+      }
+    end
+  end
+
+  def gen_cdl_file file
+    dbgPrint "#{self.class.name}: gen_cdl_file: #{@cell.get_name}\n"
+
+    file.print <<EOT
+/* MrubyBridgeCellPlugin: generate for cell=#{@cell.get_name} */
+EOT
+
+    if @@cell_list[ @cell ] then
+      file.print <<EOT
+
+/*
+ * generate for #{@cell.get_name} duplicate and ignored.
+ * This might comes from generate for celltype.
+ */
+EOT
+      cdl_info( "MrubyBridgeCellPlugin: generate duplicate for cell '$1'", @cell.get_name )
+      return
+    end
+    @@cell_list[ @cell ] = @cell
+                
+    @port_list.each{ |port, opt_str|
+      next if port.get_signature == nil
+
+      case port.get_signature.get_context
+      when "task", "any"
+      else
+        next
+      end
+
+      if port.get_port_type == :ENTRY then
+        print "  MrubyBridgeCellPlugin: [cell.port] #{@cell.get_name}.#{port.get_name} => [mruby instance] TECS::T#{port.get_signature.get_name}.new( '#{@cell.get_name}#{port.get_name}Bridge' ) \n"
+        if @@signature_list[ port.get_signature ] == nil then
+          opt_str = "ignoreUnsigned=#{@b_ignoreUnsigned}, auto_exclude=#{@b_auto_exclude}, " + opt_str
+          # p "opt_str=#{opt_str}"
+
+          file.print <<EOT
+
+/* cell.port=#{@cell.get_name}.#{port.get_name} */
+generate( MrubyBridgePlugin, #{port.get_signature.get_namespace_path}, "#{opt_str}" );
+EOT
+          @@signature_list[ port.get_signature ] = true
+        end
+
+        # mikan option
+        nest = @cell.get_region.gen_region_str_pre file
+        nest_str = "  " * nest
+
+        file.print <<EOT
+#{nest_str}/* BridgeCell */
+#{nest_str}cell nMruby::t#{port.get_signature.get_name} #{@cell.get_name}#{port.get_name}Bridge {
+#{nest_str}    cTECS = #{@cell.get_namespace_path}.#{port.get_name};
+#{nest_str}};
+EOT
+        @cell.get_region.gen_region_str_post file
+      end
+    }
+  end
+
+  #=== 後ろの CDL コードを生成
+  #プラグインの後ろの CDL コードを生成
+  #file:: File: 
+  def self.gen_post_code( file )
+    dbgPrint "#{self.name}: gen_post_code\n"
+    if ! @@b_gen_post_code_by_dependent then
+      gen_post_code_body file
+    end
+  end
+
+  def self.set_gen_post_code_by_dependent # by MrubyBridgeCelltypePlugin
+    dbgPrint "#{self.name}: set_gen_post_code_by_dependent\n"
+    @@b_gen_post_code_by_dependent = true
+    MrubyBridgeSignaturePlugin.set_gen_post_code_by_dependent
+  end
+
+  def self.gen_post_code_body file
+    # 複数のプラグインの post_code が一つのファイルに含まれるため、以下のような見出しをつけること
+    # file.print "/* '#{self.class.name}' post code */\n"
+    dbgPrint "#{self.name}: gen_post_code_body\n"
+    MrubyBridgeSignaturePlugin.gen_post_code_body file
+  end
+
+  #=== プラグイン引数 ignoreUnsigned
+  def set_ignoreUnsigned rhs
+    if rhs == "true" || rhs == nil then
+      @b_ignoreUnsigned = true
+    end
+  end
+
+  #=== プラグイン引数 exclude_port
+  def set_exclude_port rhs
+    ports = rhs.split ','
+    ct = @cell.get_celltype
+    return if ct == nil    # error case
+    ports.each{ |rhs_port|
+      obj = ct.find( rhs_port.to_sym )
+      if( ( ! obj.instance_of? Port ) || obj.get_port_type != :ENTRY ) then
+        cdl_error( "MRB9999 exclude_port '$1' not found or not entry in celltype '$2'", rhs_port, ct.get_name )
+      else
+        # print "MRBBridgeCellPlugin: exclude #{rhs_port}\n"
+        @exclude_port << rhs_port
+      end
+    }
+  end
+
+  #=== プラグイン引数 exclude_port_func
+  def set_exclude_port_func rhs
+    port_funcs = rhs.split ','
+    ct = @cell.get_celltype
+    return if ct == nil    # error case
+    port_funcs.each{ |rhs_port_func|
+      port_func = rhs_port_func.split '.'
+      if port_func.length != 2 then
+        cdl_error( "MRB9999 exclude_port_func: '$1' not in 'port.func' form", rhs_port_func )
+      end
+      obj = ct.find( port_func[0].to_sym )
+      if( ( ! obj.instance_of? Port ) || obj.get_port_type != :ENTRY ) then
+        cdl_error( "MRB9999 exclude_port_func: port '$1' not found in celltype '$2'", rhs_port, ct.get_name )
+      else
+        signature = obj.get_signature
+        next if signature == nil     # error case
+        if signature.get_function_head port_func[1].to_sym
+          # print "MRBBridgeCellPlugin: #{port_func[0]}.#{port_func[1]} exclude\n"
+          if @exclude_port_func[ port_func[0] ] then
+            @exclude_port_func[ port_func[0] ] <<  port_func[1]
+          else
+            @exclude_port_func[ port_func[0] ] = [ port_func[1] ]
+          end
+        else
+          cdl_error( "MRB9999 exclude_port_func: func '$1' not found in port '$2' celltype $3",
+                     port_func[1], port_func[0], ct.get_name )
+        end
+      end
+    }
+  end
+  #=== プラグイン引数 auto_exclude
+  def set_auto_exclude rhs
+    # print "MrubyBridgeCellPlugin: auto_exclude=#{rhs}\n"
+    if rhs == "false" then
+      @b_auto_exclude = false
+    elsif rhs == "true" then
+      @b_auto_exclude = true     # auto_exclude = true by default 
+    else
+      cdl_warning( "MRB9999 auto_exclude: unknown rhs value ignored. specify true or false" )
+    end
+  end
+
+end
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCelltypePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCelltypePlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCelltypePlugin.rb	(revision 374)
@@ -0,0 +1,294 @@
+# -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2017 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#   $Id$
+#++
+
+require_tecsgen_lib 'tecslib/plugin/lib/MrubyBridgeCelltypePluginModule.rb'
+
+#== MrubyBridgeCompositePlugin
+class MrubyBridgeCelltypePlugin < CompositePlugin
+  dbgPrint "MrubyBridgeCelltypePlugin loaded\n"
+  include MrubyBridgeCelltypePluginModule
+
+  def self.gen_post_code( file )
+    MrubyBridgeCelltypePluginModule.gen_post_code file
+  end
+end
+
+
+#
+##== celltype プラグインの共通の親クラス
+#class MrubyBridgeCelltypePlugin < CelltypePlugin
+#
+#  # プラグイン引数名 => Proc
+#  MrubyBridgePluginArgProc = { 
+#      "ignoreUnsigned" => Proc.new { |obj,rhs| obj.set_ignoreUnsigned rhs },
+#      "include_inner_cell" => Proc.new { |obj,rhs| obj.set_include_inner_cell rhs },
+#      "exclude_cell" => Proc.new { |obj,rhs| obj.set_exclude_cell rhs },
+#      "exclude_port" => Proc.new { |obj,rhs| obj.set_exclude_port rhs },
+#      "exclude_port_func" => Proc.new { |obj,rhs| obj.set_exclude_port_func rhs },
+#      "auto_exclude" => Proc.new { |obj,rhs| obj.set_auto_exclude rhs },
+#  }
+#
+#  require_tecsgen_lib( "MrubyBridgeCellPlugin.rb" )
+#  @@plugin_list = []
+#  @@count = 1
+#
+#  #celltype::     Celltype        セルタイプ（インスタンス）
+#  def initialize( celltype, option )
+#    dbgPrint "#{self.class.name}: initialzie: #{celltype.get_name}\n"
+#
+#    super
+#    @celltype = celltype
+#    @cell_list = []
+#    @include_inner_cell = false
+#    @exclude_cells = []
+#    @exclude_port = []
+#    @exclude_port_func = {}
+#    @b_ignoreUnsigned = false
+#    @b_auto_exclude = true     # auto_exclude = true by default 
+#    @@plugin_list << self
+#
+#    @plugin_arg_check_proc_tab = MrubyBridgePluginArgProc
+#    @plugin_arg_str = CDLString.remove_dquote option
+#    parse_plugin_arg
+#
+#    MrubyBridgeCellPlugin.set_gen_post_code_by_dependent
+#  end
+#
+#  #=== 新しいセル
+#  #cell::        Cell            セル
+#  #
+#  # celltype プラグインを指定されたセルタイプのセルが生成された
+#  # セルタイププラグインに対する新しいセルの報告
+#  # generate 文により呼び出された場合、それまでに定義された cell については、initialize のタイミングで呼び出される
+#  def new_cell( cell )
+#    dbgPrint "MrubyBridgeCelltypePlugin: new_cell: #{cell.get_name}\n"
+#
+#    return if @cell_list.include? cell   # この行は、本来不要のはず
+#    if TECSGEN.post_coded?               # post_code 以降のセルは対象から外す
+#      cdl_info( "I9999 MrubyBridgeCelltypePlugin: $1 is excluded because cell generated after post_coded", cell.get_name )
+#      return
+#    end
+#
+#    # include_inner_cell option
+#    if cell.is_cloned? && @include_inner_cell == false then
+#    #   p "#{cell.get_name} excluded"
+#      cdl_info( "I9999 MrubyBridgeCelltypePlugin: inner cell $1 is excluded", cell.get_name )
+#      return
+#    # else
+#    #   p "#{cell.get_name} included"
+#    end
+#
+#    # exclude_cell option
+#    if @exclude_cells.include?( cell.get_name ) then
+#      return
+#    end
+#
+#    opt_str = "ignoreUnsigned=#{@b_ignoreUnsigned}, auto_exclude=#{@b_auto_exclude}"
+#    @exclude_port.each{ |port|
+#      opt_str += ",exclude_port=#{port}"
+#    }
+#    @exclude_port_func.each{ |port, funcs|
+#      funcs.each{ |func|
+#        opt_str += ",exclude_port_func=#{port}.#{func}"
+#      }
+#    }
+#
+#    # p "MrubyBridgeCelltypePlugin: opt_str=#{opt_str}"
+#
+#    # mikan option, region
+#    fn2 = "#{$gen}/tmp_MrubyBridgeCelltypePlugin_#{@celltype.get_name}_#{@@count}.cdl"
+#    f2 = File.open( fn2, "w" )
+#    f2.print <<EOT
+#/* MrubyBridgeCelltypePlugin: celltype=#{@celltype.get_name} */
+#generate( MrubyBridgeCellPlugin, #{cell.get_namespace_path}, "#{opt_str}" );
+#EOT
+#    f2.close
+#    Import.new "#{fn2}"
+#    @@count += 1
+#  end
+#
+#### 意味解析段階で呼び出されるメソッド ###
+#  #===  CDL ファイルの生成
+#  #      typedef, signature, celltype, cell のコードを生成
+#  #      重複して生成してはならない
+#  #      すでに生成されている場合は出力しないこと。
+#  #      もしくは同名の import により、重複を避けること。
+#  #file::        FILE       生成するファイル
+#  def gen_cdl_file file
+##   この段階で呼びだすと generate 文が呼び出される前のセルのみの出力となる
+#    
+##    dbgPrint "MrubyBridgeCelltypePlugin: gen_cdl_file: #{@celltype.get_name}\n"
+##    file.print <<EOT
+##/* MrubyBridgeCelltypePlugin: celltype=#{@celltype.get_name}
+## *
+## *    cell's generate before celltype's generate
+## */
+##
+##EOT
+##    @celltype.get_cell_list.each { |cell|
+##      @cell_list << cell
+##      # mikan option, region
+##      dbgPrint "MrubyBridgeCelltypePlugin: cell=#{cell.get_name}\n"
+##      file.print <<EOT
+##generate( MrubyBridgeCellPlugin, #{cell.get_namespace_path}, "" );
+##EOT
+##    }
+#
+#  end
+#
+#  #=== tCelltype_factory.h に挿入するコードを生成する
+#  # file 以外の他のファイルにファクトリコードを生成してもよい
+#  # セルタイププラグインが指定されたセルタイプのみ呼び出される
+#  def gen_factory file
+#  end
+#
+#  def get_celltype
+#    @celltype
+#  end
+#
+#  #=== 後ろの CDL コードを生成
+#  #プラグインの後ろの CDL コードを生成
+#  #file:: File: 
+#  def self.gen_post_code( file )
+#    dbgPrint "#{self.name}: gen_post_code_body\n"
+#    print "#{self.name}: gen_post_code_body\n"
+##    この段階で生成すると、同じポストコードで出力される mruby の初期化コードに反映されない
+#    
+##    # MrubyBridgeCelltypePlugin の生成する generate 文は、
+##    fn2 = "#{$gen}/tmp_MrubyBridgeCelltypePlugin_post.cdl"
+##    f2 = File.open( fn2, "w" )
+##    # 複数のプラグインの post_code が一つのファイルに含まれるため、以下のような見出しをつけること
+##    dbgPrint "MrubyBridgeCelltypePlugin: gen_post_code\n"
+##    f2.print "/* '#{self.name}' post code */\n"
+##    @@plugin_list.each{ |plugin|
+##      plugin.get_celltype.get_cell_list.each{ |cell|
+##        # mikan option, region
+##        f2.print <<EOT
+##generate( MrubyBridgeCellPlugin, #{cell.get_namespace_path}, "" );
+##EOT
+##      }
+##    }
+##    f2.close
+##    p Import
+##    Import.new "#{fn2}"
+#
+#    MrubyBridgeCellPlugin.gen_post_code_body file
+#  end
+#
+#  #=== プラグイン引数 
+#
+#  #=== プラグイン引数 ignoreUnsigned
+#  def set_ignoreUnsigned rhs
+#    if rhs == "true" || rhs == nil then
+#      @b_ignoreUnsigned = true
+#    end
+#  end
+#
+#  def set_include_inner_cell rhs
+#    if rhs == "true" || rhs == nil then
+#      @include_inner_cell = true
+#    end
+#  end
+#
+#  def set_exclude_cell rhs
+#    cells = rhs.split ','
+#    cells.each{ |rhs_cell|
+#      rhs_cell.gsub!( /\s/, "" )
+#      @exclude_cells << rhs_cell.to_sym
+#    }
+#  end
+#  def set_exclude_port rhs
+#    ports = rhs.split ','
+#    ct = @cell.get_celltype
+#    return if ct == nil    # error case
+#    ports.each{ |rhs_port|
+#      obj = ct.find( rhs_port.to_sym )
+#      if( ( ! obj.instance_of? Port ) || obj.get_port_type != :ENTRY ) then
+#        cdl_error( "MRB9999 exclude_port '$1' not found or not entry in celltype '$2'", rhs_port, ct.get_name )
+#      else
+#        # print "MRBBridgeCellPlugin: exclude #{rhs_port}\n"
+#        @exclude_port << rhs_port
+#      end
+#    }
+#  end
+#
+#  #=== プラグイン引数 exclude_port_func
+#  def set_exclude_port_func rhs
+#    port_funcs = rhs.split ','
+#    ct = @celltype
+#    return if ct == nil    # error case
+#    port_funcs.each{ |rhs_port_func|
+#      port_func = rhs_port_func.split( '.' )
+#      if port_func.length != 2 then
+#        cdl_error( "MRB9999 exclude_port_func: '$1' not in 'port.func' form", rhs_port_func )
+#      end
+#      obj = ct.find( port_func[0].to_sym )
+#      if( ( ! obj.instance_of? Port ) || obj.get_port_type != :ENTRY ) then
+#        cdl_error( "MRB9999 exclude_port_func: port '$1' not found in celltype '$2'", rhs_port_func, ct.get_name )
+#      else
+#        signature = obj.get_signature
+#        next if signature == nil     # error case
+#        if signature.get_function_head port_func[1].to_sym
+#          # print "MRBBridgeCellPlugin: #{port_func[0]}.#{port_func[1]} exclude\n"
+#          if @exclude_port_func[ port_func[0] ] then
+#            @exclude_port_func[ port_func[0] ] <<  port_func[1]
+#          else
+#            @exclude_port_func[ port_func[0] ] = [ port_func[1] ]
+#          end
+#        else
+#          cdl_error( "MRB9999 include_port_func: func '$1' not found in port '$2' celltype $3",
+#                     port_func[1], port_func[0], ct.get_name )
+#        end
+#      end
+#    }
+#  end
+#
+#  #=== プラグイン引数 auto_exclude
+#  def set_auto_exclude rhs
+#    # print "MrubyBridgeCellPlugin: auto_exclude=#{rhs}\n"
+#    if rhs == "false" then
+#      @b_auto_exclude = false
+#    elsif rhs == "true" then
+#      @b_auto_exclude = true     # auto_exclude = true by default 
+#    else
+#      cdl_warning( "MRB9999 auto_exclude: unknown rhs value ignored. specify true or false" )
+#    end
+#  end
+#end
+#
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCompositePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCompositePlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeCompositePlugin.rb	(revision 374)
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2017 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#   $Id$
+#++
+
+require_tecsgen_lib 'tecslib/plugin/lib/MrubyBridgeCelltypePluginModule.rb'
+
+#== MrubyBridgeCompositePlugin
+class MrubyBridgeCompositePlugin < CompositePlugin
+  dbgPrint "MrubyBridgeCompositePlugin loaded\n"
+  include MrubyBridgeCelltypePluginModule
+
+  def self.gen_post_code( file )
+    MrubyBridgeCelltypePluginModule.gen_post_code file
+  end
+end
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgePlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgePlugin.rb	(revision 374)
@@ -3,5 +3,5 @@
 #  mruby => TECS bridge
 #  
-#   Copyright (C) 2008-2015 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeSignaturePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeSignaturePlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MrubyBridgeSignaturePlugin.rb	(revision 374)
@@ -0,0 +1,1313 @@
+# -*- coding: utf-8 -*-
+#
+#  mruby => TECS bridge
+#  
+#   Copyright (C) 2008-2017 by TOPPERS Project
+#
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#   $Id$
+#
+
+# Todo:
+# 生成するもの
+#  gen_cdl_file
+#    ブリッジ初期化セルタイプ (シグニチャごと)
+#       @@init_celltypes に記録
+#    ブリッジセルタイプ (シグニチャごと)
+#       @@celltypes に記録
+#    構造体セルタイプ
+#       @@struct_list に記録
+#  new_cell
+#    TECS 初期化セル(プロトタイプ宣言)
+#       @@VM_init_cells に記録
+#       @@VM_struct_list に記録
+#       @@VM_ptr_list に記録
+#  gen_post_code
+#    構造体初期化セル
+#    ポインタ初期化セル
+#    TECS 初期化セル
+#
+#   ep_func の作成
+#     signature, ポインタ、構造体 … 初期化受け口＝mruby VM への登録
+#     ポインタ
+#   preamble の作成
+#     ポインタ、構造体 … アクセス用コードの生成
+#     signature … ブリッジ関数のプロトタイプ宣言
+#   postamble の作成
+#     signature … ブリッジ関数の定義
+
+class MrubyBridgeSignaturePlugin < SignaturePlugin
+
+  # プラグイン引数名 => Proc
+  MrubyBridgePluginArgProc = { 
+      "ignoreUnsigned" => Proc.new { |obj,rhs| obj.set_ignoreUnsigned rhs },
+      "include" => Proc.new { |obj,rhs| obj.set_include rhs },
+      "exclude" => Proc.new { |obj,rhs| obj.set_exclude rhs },
+      "auto_exclude" => Proc.new { |obj,rhs| obj.set_auto_exclude rhs },
+  }
+
+  @@b_no_banner = false         #
+  @@b_gen_post_code_by_dependent = false  # true if gen_post_code is called by MrubyBridgeCellPlugin
+  @@celltypes = { }             # {celltype_name => [ BridgePlugin のインスタンスの配列 }
+  @@init_celltypes = { }        # {celltype_name => [ BridgePlugin のインスタンスの配列 }
+  @@struct_list = { }           # {struct_name=>StructType}
+  @@ptr_list = { }              # {ptr_celltype_name=> @@TYPE_MAP の対応するもの}
+  @@VM_list = { }               # VM_name => true
+  @@VM_celltypes = {  }             # VM_name => { @celltype_name => セルの配列 }
+  @@VM_struct_list = { }           # {name=>StructType}
+  @@VM_ptr_list = { }              # { VM_name => {name=> @@TYPE_MAP の対応するもの} }
+  @@TYPE_MAP = {           # type_str   class             GET_SET
+    :char_t            => [:char_t,    "Char",     :Char,  :INT   ],
+    :uchar_t           => [:uchar_t,   "UChar",    :Char,  :INT   ],
+    :schar_t           => [:schar_t,   "SChar",    :Char,  :INT   ],
+
+    :bool_t            => [:bool_t,    "Bool",     :Bool,  :BOOL  ],
+    :int8_t            => [:int8_t,    "Int8",     :Int,   :INT   ],
+    :int16_t           => [:int16_t,   "Int16",    :Int,   :INT   ],
+    :int32_t           => [:int32_t,   "Int32",    :Int,   :INT   ],
+    :int64_t           => [:int64_t,   "Int64",    :Int,   :INT   ],
+    :uint8_t           => [:uint8_t,   "UInt8",    :Int,   :INT   ],
+    :uint16_t          => [:uint16_t,  "UInt16",   :Int,   :INT   ],
+    :uint32_t          => [:uint32_t,  "UInt32",   :Int,   :INT   ],
+    :uint64_t          => [:uint64_t,  "UInt64",   :Int,   :INT   ],
+
+    :int               => [:int,       "Int",      :Int,  :INT   ], 
+    :char              => [:char,      "Char",     :Char, :INT   ],    # char は char_t として扱う
+    :short             => [:short,     "Short",    :Int,  :INT   ],
+    :long              => [:long,      "Long",     :Int,  :INT   ],
+
+    :"unsigned char"   => [:uchar_t,   "UChar",         :Char, :INT   ],
+    :"unsigned int"    => [:"unsigned int",   "UInt",   :Int,  :INT   ],
+    :"unsigned short"  => [:"unsigned short", "UShort", :Int,  :INT   ],
+    :"unsigned long"   => [:"unsigned long",  "ULong",  :Int,  :INT   ],
+    :"signed char"     => [:schar_t,   "SChar",    :Char,  :INT   ],
+    :"signed int"      => [:int,       "Int",      :Int,   :INT   ],
+    :"signed short"    => [:short,     "Short",    :Int,   :INT   ],
+    :"signed long"     => [:long,      "Long",     :Int,   :INT   ],
+
+    :float32_t         => [:float32_t, "Float32",  :Float, :FLOAT ],
+    :double64_t        => [:double64_t,"Double64", :Float, :FLOAT ],
+
+    :float             => [:float,     "Float32",  :Float, :FLOAT ],
+    :double            => [:double,    "Double64", :Float, :FLOAT ]
+  }
+
+  # included  or excluded functions
+
+  ### ロードされた時点で実行される ###
+
+  # -I に $(TECSPATH)/mruby を追加
+  # TECSGEN::Makefile.add_obj "$(MRUBY_MAIN_OBJ)"
+  TECSGEN::Makefile.add_ldflag "-lmruby -L$(MRUBYPATH)/lib -lm"
+  TECSGEN::Makefile.add_search_path "$(MRUBYPATH)/include"
+  TECSGEN::Makefile.add_var "MRUBYPATH",      "..",  "CHANGE this to suitable path"
+  # TECSGEN::Makefile.add_var "MRUBY_MAIN_OBJ", "$(_TECS_OBJ_DIR)tecs_mruby.o", "CHANGE this if your have your main"
+
+  #=== プラグインインスタンスの初期化
+  # 戻り値、引数の型が使用可能なものかチェックする
+  #
+  def initialize( signature, option )
+    super
+
+    if ! @@b_no_banner
+      STDERR << "MrubyBridgePlugin: version 1.3.0 (Suitable for mruby ver 1.3.0 & ver 1.2.0). \n"
+      @@b_no_banner = true
+    end
+
+    @b_ignoreUnsigned = false
+    @includes = []
+    @excludes = []
+    @struct_list = { }
+    @ptr_list = { }
+    @auto_exclude_list = {}
+    @b_auto_exclude = true     # auto_exclude = true by default 
+
+    @plugin_arg_check_proc_tab = MrubyBridgePluginArgProc
+    parse_plugin_arg
+
+    @celltype_name = :"t#{@signature.get_global_name}"
+    @init_celltype_name = :"#{@celltype_name}_Initializer"
+        # this variable is sometimes not used. rhs coded directry.
+    @class_name = :"T#{@signature.get_global_name}"
+
+    @func_head_array = []
+    fh_array = []
+    if @includes.length > 0 && @excludes.length > 0 then
+      cdl_error( "MRB1011 both include && exclude are specified" )
+    end
+
+    if signature.get_function_head_array == nil then
+      return   # 以前に文法エラー発生
+    end
+
+    signature.get_function_head_array.each{ |func_head|
+      if @includes.length > 0 then
+        if @includes.index func_head.get_name then
+          dbgPrint "MrubyBridgePlugin: #{func_head.get_name} INCLUDED\n"
+          fh_array << func_head
+        else
+          dbgPrint "MrubyBridgePlugin: #{func_head.get_name} NOT included\n"
+        end
+      elsif @excludes.length > 0 then
+        if @excludes.index( func_head.get_name ) == nil then
+          dbgPrint "MrubyBridgePlugin: #{func_head.get_name} NOT excluded\n"
+          fh_array << func_head
+        else
+          dbgPrint "MrubyBridgePlugin: #{func_head.get_name} EXCLUDED\n"
+        end
+      else
+        fh_array << func_head
+      end
+    }
+
+    check_name_and_return_type fh_array
+    check_parameter_type fh_array
+
+    fh_array.each{ |fh|
+      if @auto_exclude_list[ fh.get_name ] == nil then
+        @func_head_array << fh
+      else
+        dbgPrint "MrubyBridgePlugin: auto_exclude #{fh.get_name}\n"
+      end
+    }
+
+    if @func_head_array.length == 0 then
+      cdl_error( "MRB1012 '$1' no function remained by exclude", @signature.get_name )
+    end
+  end
+
+  #=== check function name & return type
+  def check_name_and_return_type func_head_array
+    b_init = false; b_init_cell = false
+    func_head_array.each{ |func_head|
+      if( func_head.get_name == :initialize )then
+        cdl_warning( "MRW2001 initialize: internally defined. change to initialize_cell in ruby" )
+        b_init = true
+      elsif( func_head.get_name == :initialize_cell )then
+        b_init_cell = true
+      end
+      rtype = func_head.get_return_type.get_original_type
+      case rtype
+      when BoolType, IntType, FloatType, VoidType
+      else
+        if @b_auto_exclude then
+          cdl_info( "MRI0001 cannot return type $1, $2 automatcally excluded", rtype.get_type_str, func_head.get_name )
+          @auto_exclude_list[ func_head.get_name ] = func_head
+        else
+          cdl_error( "MRB1001 cannot return type $1", rtype.get_type_str )
+        end
+      end
+    }
+    if( b_init && b_init_cell )then
+      cdl_warning( "MRB1002 initialize: internally defined. change to initialize_cell in ruby" )
+    end
+  end
+
+  #=== check paramter type
+  def check_parameter_type func_head_array
+    # check type of parameters
+    func_head_array.each{ |fh|
+      fh.get_paramlist.get_items.each{ |param_decl|
+        case param_decl.get_direction
+        when :SEND, :RECEIVE
+          if @b_auto_exclude then
+            cdl_info( "MRI0002 $1: $2 parameter cannot be used in mruby Bridge, $3 automatcally excluded",
+                      param_decl.get_name, param_decl.get_direction.to_s.downcase, fh.get_name )
+            @auto_exclude_list[ fh.get_name ] = fh
+          else
+            cdl_error( "MRB1003 $1: $2 parameter cannot be used in mruby Bridge",  param_decl.get_name, param_decl.get_direction.to_s.downcase )
+          end
+        end
+        type = param_decl.get_type
+        type_org = type.get_original_type
+        type_str = type.get_type_str + type.get_type_str_post
+
+        b_ng = false
+        case type_org
+        when IntType
+          case  type_org.get_bit_size
+          when 8, 16, 32, 64
+          when -1, -2, -3, -4, -11
+          else
+            b_ng = true
+          end
+        when BoolType
+        when FloatType
+        when PtrType
+          ttype_org = type_org.get_type       # ポインタの指している先の型
+          ttype = ttype_org.get_original_type # 上記の typedef されている場合、元の型
+          register_ptr_type ttype_org, fh
+
+          if( type_org.get_string.to_s == "-1" ) then
+            case param_decl.get_direction
+            when :OUT, :INOUT
+              if @b_auto_exclude then
+                cdl_info( "MRB9999 string specifier without length cannot be used for out & inout parameter, $1 automatcally excluded", 
+                        fh.get_name )
+                @auto_exclude_list[ fh.get_name ] = fh
+              else
+                cdl_error( "MRB9999 string specifier without length cannot be used for out & inout parameter")
+              end
+            end
+          end
+
+          case ttype
+          when IntType
+            bit_size = ttype.get_bit_size
+            # if  bit_size < 0 && bit_size != -1 then
+            #   b_ng = true
+            # end
+          when FloatType
+          when BoolType
+          when StructType
+            if( type_org.get_size || type_org.get_string || type_org.get_count ) then
+              if @b_auto_exclude then
+                cdl_info( "MRI9999 $1: size_is, count_is, string cannot be specified for struct pointer, $2 automatcally excluded",
+                          param_decl.get_name, fh.get_name )
+                @auto_exclude_list[ fh.get_name ] = fh
+              else
+                cdl_error( "MRB1004 $1: size_is, count_is, string cannot be specified for struct pointer", param_decl.get_name )
+              end
+            end
+            check_struct_member ttype_org, fh
+          else
+            b_ng = true
+          end
+        when StructType
+          check_struct_member type_org, fh
+        else  # ArrayType, FuncType, EnumType, VoidType
+          b_ng = true
+        end
+        if b_ng then
+          if @b_auto_exclude then
+            cdl_info( "MRI9999 $1: type $2 cannot be used in mruby Bridge, $3 automatcally excluded",
+                      param_decl.get_name, type_str, fh.get_name )
+            @auto_exclude_list[ fh.get_name ] = fh
+          else
+            cdl_error( "MRB1005 $1: type $2 cannot be used in mruby Bridge", param_decl.get_name, type_str )
+          end
+        end
+      }
+    }
+  end
+
+  #=== 構造体のメンバーの型のチェック
+  def check_struct_member struct_type, fh
+    #p "tag name:#{struct_type.get_name}"
+    # sttype = Namespace.find_tag( struct_type.get_name )
+    sttype = struct_type.get_original_type
+    if sttype.get_name == nil then
+      if @b_auto_exclude then
+        cdl_info( "MRI9999 tagless-struct cannot be handled, $1 automatcally excluded", fh.get_name )
+        @auto_exclude_list[ fh.get_name ] = fh
+        return  # 登録しないように打ち切る
+      else
+        cdl_error( "MRB10007 tagless-struct cannot be handled")
+      end
+    end
+    sttype.get_members_decl.get_items.each { |d|
+      t = d.get_type.get_original_type
+      case t
+      when IntType, FloatType, BoolType
+      else
+        if @b_auto_exclude then
+          cdl_info( "MRI9999 $1: type $2 not allowed for struct member, $3 automatcally excluded",
+                    d.get_name, d.get_type.get_type_str + d.get_type.get_type_str_post, fh.get_name )
+          @auto_exclude_list[ fh.get_name ] = fh
+          return  # 登録しないように打ち切る
+        else
+          cdl_error( "MRB1006 $1: type $2 not allowed for struct member", d.get_name, d.get_type.get_type_str + d.get_type.get_type_str_post )
+        end
+      end
+    }
+    st_name = :"t{}"
+    if @struct_list[ sttype.get_name ] == nil then
+      # print_msg "  MrubyBridgePlugin: [struct]   #{struct_type.get_type_str} => class TECS::Struct#{sttype.get_name}\n"
+      print "  MrubyBridgePlugin: [struct]   #{struct_type.get_type_str} => class TECS::Struct#{sttype.get_name}\n"
+      @struct_list[ sttype.get_name ] = sttype
+    end
+  end
+
+  def register_ptr_type ttype, fh
+    t_org = ttype.get_original_type
+    tment = get_type_map_ent t_org
+    if tment == nil then
+      return
+      # cdl_error( "MRB1008 unknown pointer type '$1'", ttype.get_type_str )
+    end
+    ptr_celltype_name = :"t#{tment[1]}Pointer"
+    if @@ptr_list[ ptr_celltype_name ] == nil then
+      # print_msg "  MrubyBridgePlugin: [pointer]  #{ttype.get_type_str}* => class TECS::#{tment[1]}Pointer\n"
+      print "  MrubyBridgePlugin: [pointer]  #{ttype.get_type_str}* => class TECS::#{tment[1]}Pointer\n"
+      @@ptr_list[ ptr_celltype_name ] = tment
+    end
+    if @ptr_list[ ptr_celltype_name ] == nil then
+      @ptr_list[ ptr_celltype_name ] = tment
+    end
+  end
+
+  def get_type_map_ent ttype
+    # structure type is registerd in check_struct_member
+    if ttype.kind_of? StructType
+      return
+    end
+    tstr = ttype.get_type_str.sub( /const /, "" )    # const は無視
+    tstr = tstr.sub( /volatile /, "" )               # volatile も無視
+    if @b_ignoreUnsigned then
+      tstr = tstr.sub( /unsigned /, "" )             # volatile も無視
+      tstr = tstr.sub( /uint/, "int" )               # volatile も無視
+      tstr = tstr.sub( /[cs]char/, "char" )          # volatile も無視
+    end
+    return @@TYPE_MAP[ tstr.to_sym ]
+  end
+
+  #===  CDL ファイルの生成
+  #      typedef, signature, celltype, cell コードを生成
+  #file::        FILE       生成するファイル
+  def gen_cdl_file(file)
+
+    # ブリッジセルタイプの生成
+    if @@celltypes[ @celltype_name ] == nil then
+      @@celltypes[ @celltype_name ] = [ self ]
+      @@init_celltypes[ @init_celltype_name ] = true
+      print_msg <<EOT
+  MrubyBridgePlugin: [signature] #{@signature.get_namespace_path} => [celltype] nMruby::#{@celltype_name} => [class] TECS::#{@class_name}
+EOT
+
+      file.print <<EOT
+/*
+ * MrubyBridgeSignaturePlugin:
+ *     signature=#{@signature.get_namespace_path}
+ *
+ *   => celltype=nMruby::#{@celltype_name}
+ *      (bridge cell's celltype; generated in this file)
+ *      cell nMruby::#{@celltype_name} BridgeCellName { cTECS = CellName.eEntry; };
+ *        where eEntry's signature must be #{@signature.get_namespace_path}.
+ *      => class=TECS::#{@class_name}
+ *         (mruby's class; accessible from your script)
+ *          bridge = TECS::#{@class_name}.new("BridgeCellName")
+ */
+import( <mruby.cdl> );
+
+/****  Ruby => TECS Bridge Celltype (MBP500) ****/
+namespace nMruby{
+    // bridge celltype
+    [idx_is_id,active]   // not actually active, to avoid warning W1002, W1007
+    celltype #{@celltype_name} {
+        call #{@signature.get_namespace_path.to_s} cTECS;
+        attr {
+            [omit]
+            char_t *VMname = "VM";
+            [omit]
+            char_t *bridgeName = C_EXP( "$cell$" );
+        };
+    };
+    // bridge initializer celltype
+    celltype #{@init_celltype_name} {
+        entry sInitializeTECSBridge eInitialize;
+    };
+};
+EOT
+
+      # 構造体セルタイプの生成
+      @struct_list.each{ |name, sttype|
+        if @@struct_list[ name ] == nil then
+          file.print <<EOT
+namespace nMruby{
+    [singleton]
+    celltype #{name} {
+        entry sInitializeTECSBridge eInitialize;
+    };
+};
+EOT
+          @@struct_list[ name ] = sttype
+        end
+      }
+
+    else
+      cdl_info( "MRBW001 MrubyBridgePlugin: signature '$1' duplicate. ignored current one", @signature.get_namespace_path )
+      @@celltypes[ @celltype_name ] << self
+    end
+  end
+
+  #=== gen_cdl_file で定義したセルタイプに 新しいセルが定義された
+  # cell のセルタイプの名前は @celltype_name
+  def new_cell cell
+    if cell.get_celltype.get_name != @celltype_name then
+      return
+    end
+
+    join = cell.get_join_list.get_item :VMname
+    if join then
+      vm_name = CDLString.remove_dquote(join.get_rhs.to_s).to_sym
+    else
+      vm_name = :"VM"
+    end
+
+    if @@VM_list[ vm_name ] == nil then
+      @@VM_list[ vm_name ] = true
+
+      initializer_celltype_cdl = "#{$gen}/#{cell.get_name}Initializer.cdl"
+      file = CFile.open( initializer_celltype_cdl, "w" )
+
+      # TECS 初期化セル(プロトタイプ宣言)
+      print_msg "  MrubyBridgePlugin: join your VM's cInitialize to #{vm_name}_TECSInitializer.eInitialize\n"
+
+      file.print <<EOT
+
+  // prototype of TECSInitializer (MBP510)
+  cell nMruby::tTECSInitializer #{vm_name}_TECSInitializer;
+EOT
+      file.close
+
+      Generator.parse( initializer_celltype_cdl, self )
+    end
+
+    if @@VM_celltypes[ vm_name ] then
+      vma = @@VM_celltypes[ vm_name ]
+
+      if vma[ @celltype_name ] then
+        vma[ @celltype_name ] << cell
+      else
+        vma[ @celltype_name ] = [cell]
+        @@VM_celltypes[ vm_name ] = vma
+      end
+    else
+      vma = { }
+      vma[ @celltype_name ] = [cell]
+      @@VM_celltypes[ vm_name ] = vma
+    end
+
+    @struct_list.each{ |stname, sttype|
+      if @@VM_struct_list[ vm_name ] then
+        @@VM_struct_list[ vm_name ][ sttype.get_name ] = sttype
+      else
+        @@VM_struct_list[ vm_name ] = { sttype.get_name => sttype }
+      end
+    }
+    @ptr_list.each{ |ptr_celltype_name, tment|
+      if @@VM_ptr_list[ vm_name ] then
+        @@VM_ptr_list[ vm_name ][ ptr_celltype_name ] = tment
+      else
+        @@VM_ptr_list[ vm_name ] = { ptr_celltype_name => tment }
+      end
+    }
+
+  end
+
+  #=== プラグインが CDL の POST コードを生成
+  # tmp_plugin_post_code.cdl への出力
+  def self.gen_post_code file
+    dbgPrint "#{self.name}: gen_post_code\n"
+    if ! @@b_gen_post_code_by_dependent then
+      gen_post_code_body file
+    end
+  end
+
+  def self.set_gen_post_code_by_dependent # by MrubyBriddeCellPlugin
+    dbgPrint "#{self.name}: set_gen_post_code_by_dependent\n"
+    @@b_gen_post_code_by_dependent = true
+  end
+
+  def self.gen_post_code_body file
+    dbgPrint "#{self.name}: gen_post_code_body\n"
+
+#     file.print <<EOT
+# namespace nMruby {
+# EOT
+# 
+#     @@ptr_list.each{ |name,tment|
+#       file.print <<EOT
+# 
+#     // MBP600
+#     [singleton]
+#     celltype #{name} {
+#         entry  sInitializeTECSBridge eInitialize;
+#     };
+# EOT
+#     }
+# 
+#     file.print <<EOT
+# };
+# EOT
+
+# gen_post_code で生成した celltype は gen_ep_func が呼び出されない #847
+#    @@struct_list.each{ |name,sttype|
+#      file.print <<EOT
+#
+#    [singleton]
+#    celltype #{name} {
+#        entry  sInitializeTECSBridge eInitialize;
+#    };
+#EOT
+#    }
+
+    file.print "\n  // MrubyBridgeSignaturePlugin: MBP601\n"
+    @@VM_celltypes.each{ |vm_name, instance_list|
+      instance_list.each { |celltype_name, array|
+        cell = array[0]
+	if cell.get_celltype then
+	  ct_name = cell.get_celltype.get_name
+        file.print <<EOT
+  cell nMruby::#{ct_name}_Initializer #{vm_name}_#{ct_name}_Initializer{ };
+EOT
+        end
+      }
+    }
+
+    file.print "  // MBP602\n"
+    @@ptr_list.each{ |name,tment|
+      file.print <<EOT
+  cell nMruby::#{name} C#{name} { };
+EOT
+    }
+
+    file.print "  // MBP603\n"
+    @@struct_list.each{ |name,sttype|
+      file.print <<EOT
+  cell nMruby::#{name} C#{name} { };
+EOT
+    }
+
+    if @@VM_celltypes == nil
+      raise "MrubyBridgeSignaturePlugin: are0"
+    end
+    @@VM_celltypes.each{ |vm_name, instance_list|
+      file.print "  /* === VM name is '#{vm_name}' === (MBP610) */\n"
+      init_cell_name = "#{vm_name}_TECSInitializer"
+
+      file.print "  cell nMruby::tTECSInitializer #{init_cell_name} {\n"
+
+      instance_list.each { |celltype_name, array|
+#        array.each{ |cell|
+#          ct_name = cell.get_celltype.get_name
+          ct_name = celltype_name
+          file.print "    cInitialize[] = #{vm_name}_#{ct_name}_Initializer.eInitialize;\n"
+#        }
+      }
+      if @@VM_ptr_list[vm_name] then
+        @@VM_ptr_list[vm_name].each{ |name, tment|
+          file.print "    cInitialize[] = C#{name}.eInitialize;\n"
+        }
+      end
+      if @@VM_struct_list[vm_name] then
+        @@VM_struct_list[vm_name].each{ |name, sttype|
+          file.print "    cInitialize[] = C#{name}.eInitialize;\n"
+        }
+      end
+      file.print "  };"
+    }
+    
+  end
+
+  ####### 以下コード生成段階 ######
+
+  #===  受け口関数の本体コードを生成（頭部と末尾は別途出力）
+  #ct_name:: Symbol    (プラグインで生成された) セルタイプ名 ．Symbol として送られてくる
+  def gen_ep_func_body( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    if @@celltypes[ ct_name ] then
+      gen_ep_func_body_bridge( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    elsif @@init_celltypes[ ct_name ] then
+      gen_ep_func_body_bridge_init( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    elsif @@ptr_list[ ct_name ] then
+      gen_ep_func_body_ptr( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    elsif @@struct_list[ ct_name ] then
+      gen_ep_func_body_struct( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    else
+      raise "MrubyBridgeSignaturePlugin: Unknown #{ct_name}"
+    end
+  end
+
+  def gen_ep_func_body_bridge( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    raise "MrubyBridgeSignaturePlugin: unexpected "
+  end
+
+  def gen_ep_func_body_bridge_init( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    file.print <<EOT
+    // CELLCB *p_cellcb = GET_CELLCB( idx );  /* no error check */     /* MBP700 */
+    struct RClass	*rc;
+
+    rc = mrb_define_class_under( mrb, TECS, \"#{@class_name}\", mrb->object_class );
+    mrb_define_method( mrb, rc, "initialize", MrubyBridge_#{@celltype_name}_initialize, MRB_ARGS_REQ(1) );
+    MRB_SET_INSTANCE_TT(rc, MRB_TT_DATA);
+EOT
+
+    @func_head_array.each{ |f|
+      if ! f.is_function? then
+        next
+      end
+      if f.get_name != :initialize then
+        func_name = f.get_name
+      else
+        func_name = :initialize_cell
+      end
+
+      ret_type = f.get_return_type
+      n_param = 0
+      f.get_paramlist.get_items.each{ |param|
+        case param.get_direction
+        when :IN, :INOUT, :OUT
+          n_param += 1
+        when :SEND, :RECEIVE
+          raise "MrubyBridgeSignaturePlugin: send, receive"
+        end
+      }
+      if n_param > 0 then
+        p_str = "MRB_ARGS_REQ( #{n_param} )"
+      else
+        p_str = "MRB_ARGS_NONE()"
+      end
+      file.print <<EOT
+	mrb_define_method( mrb, rc, "#{func_name}", MrubyBridge_#{@celltype_name}_#{func_name}, #{p_str} );
+EOT
+    }
+  end
+
+  def gen_ep_func_body_ptr( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    
+    t = @@ptr_list[ct_name]
+    type = t[1]
+    file.print <<EOT
+	struct RClass *a;                                /* MBP710 */
+
+    a = mrb_define_class_under(mrb, TECS, "#{type}Pointer", mrb->object_class);
+    MRB_SET_INSTANCE_TT(a, MRB_TT_DATA);
+
+    mrb_define_method(mrb, a, "initialize",      #{type}Pointer_initialize,   MRB_ARGS_REQ(1));
+    mrb_define_method(mrb, a, "[]",              #{type}Pointer_aget,         MRB_ARGS_REQ(1));
+    mrb_define_method(mrb, a, "value",           #{type}Pointer_get_val,      MRB_ARGS_NONE());
+    mrb_define_method(mrb, a, "[]=",             #{type}Pointer_aset,         MRB_ARGS_REQ(2));
+    mrb_define_method(mrb, a, "value=",          #{type}Pointer_set_val,      MRB_ARGS_REQ(1));
+    mrb_define_method(mrb, a, "size",            #{type}Pointer_size,         MRB_ARGS_NONE());
+    mrb_define_method(mrb, a, "length",          #{type}Pointer_size,         MRB_ARGS_NONE());
+EOT
+
+    if t[2] == :Char then
+      file.print <<EOT
+	mrb_define_method(mrb, a, "to_s",            CharPointer_to_s, MRB_ARGS_NONE());
+	mrb_define_method(mrb, a, "from_s",          CharPointer_from_s, MRB_ARGS_REQ(1));
+EOT
+    end
+  end
+
+  def gen_ep_func_body_struct( file, b_singleton, ct_name, global_ct_name, sig_name, ep_name, func_name, func_global_name, func_type, params )
+    tag = ct_name
+    structType = @@struct_list[ tag ]
+    file.print  <<EOT
+	struct RClass *a;                                /* MBP720 */
+
+	a = mrb_define_class_under(mrb, TECS, "Struct#{tag}", mrb->object_class);
+	MRB_SET_INSTANCE_TT(a, MRB_TT_DATA);
+
+	mrb_define_method(mrb, a, "initialize", Struct_#{tag}_initialize, MRB_ARGS_NONE());
+EOT
+
+      structType.get_members_decl.get_items.each{ |d|
+        file.print "  STRUCT_INIT_MEMBER( #{tag}, #{d.get_name} )\n"
+      }
+  end
+
+  #===  受け口関数の preamble (C言語)を生成する
+  #     必要なら preamble 部に出力する
+  #file::           FILE        出力先ファイル
+  #b_singleton::    bool        true if singleton
+  #ct_name::        Symbol
+  #global_ct_name:: string
+  def gen_preamble( file, b_singleton, ct_name, global_ct_name )
+    if @@celltypes[ ct_name ] then
+      gen_preamble_mruby( file, b_singleton, ct_name, global_ct_name )
+      gen_preamble_instance( file, b_singleton, ct_name, global_ct_name )
+      gen_preamble_instance_initialize( file, b_singleton, ct_name, global_ct_name )
+      gen_preamble_bridge_func( file, b_singleton, ct_name, global_ct_name )
+    elsif @@init_celltypes[ ct_name ] then
+      gen_preamble_mruby( file, b_singleton, ct_name, global_ct_name )
+      gen_preamble_instance_proto( file, b_singleton, ct_name, global_ct_name )
+    elsif @@ptr_list[ ct_name ] then
+      gen_preamble_ptr( file, b_singleton, ct_name, global_ct_name )
+    elsif @@struct_list[ ct_name ] then
+      gen_preamble_struct( file, b_singleton, ct_name, global_ct_name )
+    else
+      raise "MrubyBridgeSignaturePlugin: MrubyBridgeSignaturePlugin: Unknown #{ct_name}"
+    end
+  end
+
+  def gen_preamble_mruby( file, b_singleton, ct_name, global_ct_name )
+    file.print <<EOT
+/* MBP: MrubyBridgePlugin: MBP000 */
+#include "mruby.h"
+#include "mruby/class.h"
+#include "mruby/data.h"
+#include "mruby/string.h"
+#include "TECSPointer.h"
+#include "TECSStruct.h"
+
+#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#define DLLEXPORT __declspec(dllexport)
+#else
+#define DLLEXPORT
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+EOT
+  end
+
+  def gen_preamble_instance( file, b_singleton, ct_name, global_ct_name )
+    # 「#1005  MrubyBridgePlugin-test のビルドに失敗」にて追加
+    # 「#1004 idx_is_id が true の場合(domain の場合は未指定でも true) の CBP のプロトタイプ宣言」にて不要になる見込み
+    nsp = NamespacePath.new( :nMruby, true )
+    nsp.append! ct_name
+    ct = Namespace.find nsp
+    if ct.idx_is_id_act? then
+      if ct.has_CB? then
+        inib_cb = "CB"
+      elsif ct.has_INIB? then
+        inib_cb = "INIB"
+      else
+        inib_cb = nil
+      end
+      if inib_cb then
+        ct.get_cell_list.each{ |cell|
+          if cell.is_generate? then
+            name_array = ct.get_name_array( cell )
+            file.print "extern #{ct.get_global_name}_CB  #{cell.get_global_name}_#{inib_cb};\n"
+          end
+        }
+      end
+    end
+
+    file.print <<EOT
+
+/* RData MBP001 */
+static void 
+#{@celltype_name}_free( mrb_state *mrb, void *p )
+{
+	if( p )
+		(void)mrb_free( mrb, p );
+}
+
+/* RData MBP002 */
+struct mrb_data_type data_type_#{@celltype_name} =
+{
+	"#{@celltype_name}",
+	#{@celltype_name}_free
+};
+
+/* RData MBP003 */
+struct tecs_#{@celltype_name} {
+    CELLCB  *cbp;
+};
+
+/* name_to_cbp MBP010 */
+const struct name_to_cbp_#{@celltype_name} {
+    char   *name;    /* Cell Name */
+    CELLCB *cbp;
+} Name_to_cbp_#{@celltype_name}[] = {
+EOT
+
+    nsp = NamespacePath.new( :nMruby, true )
+    nsp.append! ct_name
+    ct = Namespace.find nsp
+
+    ct.get_cell_list.each{ |cell|
+      if cell.is_generate? then
+        join_list = cell.get_join_list
+        join = join_list.get_item( :bridgeName )
+        if join == nil then
+          name = "\"#{cell.get_name}\""
+        else
+          rhs = join.get_rhs
+          attr_list = cell.get_celltype.get_attribute_list
+          name = rhs.eval_const join_list, attr_list
+        end
+
+        name_array = ct.get_name_array( cell )
+        file.print "\t{ #{name}, #{name_array[8]} },\n"
+      end
+    }
+
+    file.print <<EOT
+\t{ 0, 0 },
+};
+
+EOT
+
+  end
+
+  def gen_preamble_ptr( file, b_singleton, ct_name, global_ct_name )
+    tment = @@ptr_list[ ct_name ]
+    file.print <<EOT
+
+GET_SET_#{tment[3]}( #{tment[1]}, #{tment[0]} )
+POINTER_CLASS( #{tment[1]}, #{tment[0]} )
+EOT
+  end
+
+  def gen_preamble_struct( file, b_singleton, ct_name, global_ct_name )
+    tag = ct_name
+    structType = @@struct_list[ tag ]
+    file.print <<EOT
+/* struct #{tag} */
+STRUCT_CLASS( #{tag} )
+EOT
+
+    structType.get_members_decl.get_items.each{ |d|
+      type = d.get_type.get_original_type
+      case type
+      when IntType, CIntType
+        bit_size = type.get_bit_size
+        case bit_size
+        when -11, -1
+          tType = "Char"
+          ttype = "char"
+        when -2
+          tType = "Short"
+          ttype = "short"
+        when -3
+          tType = "Int"
+          ttype = "int"
+        when -4
+          tType = "Long"
+          ttype = "long"
+        when -5
+          tType = "IntPtr"
+          ttype = "intptr"
+        when 8, 16, 32, 64
+          tType = "Int#{bit_size}"
+          ttype = "int#{bit_size}"
+        else
+            raise "MrubyBridgeSignaturePlugin: MrubyBridgeSignaturePlugin: cannot handle bit_size #{bit_size}"
+        end
+        file.print "MEMBER_GET_SET_INT( #{tag}, #{d.get_name}, #{tType}, #{ttype} )\n"
+      when FloatType, CFloatType
+        file.print "MEMBER_GET_SET_FLOAT( #{tag}, #{d.get_name} )\n"
+      else
+        raise "MrubyBridgeSignaturePlugin: MrubyBridgeSignaturePlugin: cannot handle type"
+      end
+    }
+
+  end
+
+  def gen_preamble_instance_proto( file, b_singleton, ct_name, global_ct_name )
+    file.print <<EOT
+//  Prototype MBP400
+mrb_value  MrubyBridge_#{@celltype_name}_initialize( mrb_state *mrb, mrb_value self);
+EOT
+
+    @func_head_array.each{ |f|
+      if ! f.is_function? then
+        next
+      end
+      if f.get_name != :initialize then
+        func_name = f.get_name
+      else
+        func_name = :initialize_cell
+      end
+
+      ret_type  = f.get_return_type
+      ret_type0 = f.get_return_type.get_original_type
+      b_void    = ret_type0.is_void?
+      plist     = f.get_paramlist.get_items
+
+      file.print <<EOT
+mrb_value  MrubyBridge_#{@celltype_name}_#{func_name}( mrb_state *mrb, mrb_value self );
+EOT
+    }
+  end
+
+  def gen_preamble_instance_initialize( file, b_singleton, ct_name, global_ct_name )
+    file.print <<EOT
+
+/* MBP100 */
+mrb_value
+MrubyBridge_#{@celltype_name}_initialize( mrb_state *mrb, mrb_value self)
+{
+	mrb_value	name;
+	struct tecs_#{@celltype_name} *tecs_cb;
+	const struct name_to_cbp_#{@celltype_name} *ntc;
+
+	/* set DATA_TYPE earlier to avoid SEGV */
+	DATA_TYPE( self ) = &data_type_#{@celltype_name};
+
+	mrb_get_args(mrb, "o", &name );
+	if( mrb_type( name ) != MRB_TT_STRING ){
+		mrb_raise(mrb, E_NAME_ERROR, "cell name not string");
+	}
+	for( ntc = &Name_to_cbp_#{@celltype_name}[0]; ntc->name != NULL; ntc++ ){
+		if( strcmp( ntc->name, RSTRING_PTR( name ) ) == 0 )
+			break;
+	}
+	if( ntc->name == 0 ){
+		mrb_raise(mrb, E_ARGUMENT_ERROR, "cell not found");
+	}
+	tecs_cb = (struct tecs_#{@celltype_name} *)mrb_malloc(mrb, sizeof(struct tecs_#{@celltype_name}) );
+	tecs_cb->cbp = ntc->cbp;
+	DATA_PTR( self ) = (void *)tecs_cb;
+
+	return self;
+}
+EOT
+  end
+
+  def gen_preamble_bridge_func( file, b_singleton, ct_name, global_ct_name )
+
+    @func_head_array.each{ |f|
+      if ! f.is_function? then
+        next
+      end
+      if f.get_name != :initialize then
+        func_name = f.get_name
+      else
+        func_name = :initialize_cell
+      end
+
+      ret_type  = f.get_return_type
+      ret_type0 = f.get_return_type.get_original_type
+      b_void    = ret_type0.is_void?
+      plist     = f.get_paramlist.get_items
+
+      file.print <<EOT
+
+/* bridge function (MBP101) */
+mrb_value
+MrubyBridge_#{ct_name}_#{func_name}( mrb_state *mrb, mrb_value self )
+{
+	/* cellcbp (MBP105) */
+	CELLCB	*p_cellcb = ((struct tecs_#{@celltype_name} *)DATA_PTR(self))->cbp;
+EOT
+      
+      file.print "	/* variables for return & parameter (MBP110) */\n"
+      if ! b_void then
+        file.print "	", ret_type.get_type_str, "\tret_val", ret_type.get_type_str_post, ";\n"
+      end
+      arg_str = ""
+      n_param  = 0
+      n_scalar = 0
+      n_ptr    = 0
+      n_struct = 0
+      plist.each{ |param|
+        case param.get_direction
+        when :IN, :INOUT, :OUT
+          type = param.get_type.get_original_type
+          case type
+          when IntType
+            file.print "	mrb_int	mrb_", param.get_name, ";\n"
+            file.print "	#{param.get_type.get_type_str}	#{param.get_name}#{param.get_type.get_type_str_post};\n"
+            arg_str += "i"
+            n_param += 1
+            n_scalar += 1
+          when FloatType
+            file.print "	mrb_float	mrb_", param.get_name, ";\n"
+            file.print "	#{param.get_type.get_type_str}	#{param.get_name}#{param.get_type.get_type_str_post};\n"
+            arg_str += "f"
+            n_param += 1
+            n_scalar += 1
+          when BoolType
+            file.print "	mrb_value	mrb_", param.get_name, ";\n"
+            file.print "	#{param.get_type.get_type_str}	#{param.get_name}#{param.get_type.get_type_str_post};\n"
+            arg_str += "o"
+            n_param += 1
+            n_scalar += 1
+          when PtrType
+            file.print "	mrb_value	mrb_", param.get_name, ";\n"
+            file.print "	#{param.get_type.get_type_str}	#{param.get_name}#{param.get_type.get_type_str_post};\n"
+            arg_str += "o"
+            n_param += 1
+            n_ptr += 1
+          when StructType
+            file.print "	mrb_value	mrb_", param.get_name, ";\n"
+            file.print "	#{param.get_type.get_type_str}	*#{param.get_name}#{param.get_type.get_type_str_post};\n"
+            arg_str += "o"
+            n_param += 1
+            n_struct += 1
+          else
+            raise "MrubyBridgeSignaturePlugin: Unknown type"
+          end
+        end
+      }
+
+      if n_param > 0 then
+        file.print "	/* retrieve arguments (MBP111) */\n"
+        file.print "	mrb_get_args(mrb, \"#{arg_str}\""
+        plist.each{ |param|
+          case param.get_direction
+          when :IN, :INOUT, :OUT
+            type = param.get_type.get_original_type
+            case type
+            when IntType
+              file.print ", &mrb_", param.get_name
+            when FloatType
+              file.print ", &mrb_", param.get_name
+            when BoolType
+              file.print ", &mrb_", param.get_name
+            when PtrType
+              file.print ", &mrb_", param.get_name
+            when StructType
+              file.print ", &mrb_", param.get_name
+            else
+              raise "MrubyBridgeSignaturePlugin: Unknown type"
+            end
+          end
+        }
+        file.print " );\n"
+
+        if n_scalar > 0 || n_struct > 0 then
+          file.print "	/* convert mrb to C (MBP112) */\n"
+        end
+        plist.each{ |param|
+          case param.get_direction
+          when :IN, :INOUT, :OUT
+            type = param.get_type.get_original_type
+            case type
+            when IntType
+              ttype = type.get_original_type
+              tment = get_type_map_ent ttype
+              file.print "	VALCHECK_#{tment[1]}( mrb, mrb_#{param.get_name} );\n"
+              file.print "	#{param.get_name} = (#{param.get_type.get_type_str})mrb_#{param.get_name};\n"
+            when FloatType
+              file.print "	#{param.get_name} = (#{param.get_type.get_type_str})mrb_#{param.get_name};\n"
+            when BoolType
+              file.print "	#{param.get_name} = mrb_test( mrb_#{param.get_name} );\n"
+            when PtrType
+              ttype = type.get_type.get_original_type
+              case ttype
+              when StructType
+                file.print "	CHECK_STRUCT( #{ttype.get_name}, mrb_#{param.get_name} );\n"
+                file.print "	#{param.get_name} = (struct #{ttype.get_name}*)DATA_PTR(mrb_#{param.get_name});\n"
+              when IntType
+              when FloatType
+              when BoolType
+              else
+                raise "MrubyBridgeSignaturePlugin: cannot handle type"
+              end
+            when StructType
+              file.print "	CHECK_STRUCT( #{type.get_name}, mrb_#{param.get_name} );\n"
+              file.print "	#{param.get_name} = (struct #{type.get_name}*)DATA_PTR(mrb_#{param.get_name});\n"
+            else
+              raise( "MrubyBridgeSignaturePlugin: canot treat class" )
+            end
+          end
+        }
+
+        if n_ptr > 0 then
+          file.print "	/* convert mrb to C for pointer types (MBP113) */\n"
+        end
+        plist.each{ |param|
+          case param.get_direction
+          when :IN, :INOUT, :OUT
+            type = param.get_type.get_original_type
+            case type
+            when IntType
+            when FloatType
+            when BoolType
+            when PtrType
+              case type.get_type.get_original_type
+              when StructType
+              when IntType
+                ptrMrb2C file, type, param
+              when FloatType
+                ptrMrb2C file, type, param
+              when BoolType
+                ptrMrb2C file, type, param
+              else
+                raise "MrubyBridgeSignaturePlugin: cannot handle type"
+              end
+            when StructType
+            else
+              raise( "MrubyBridgeSignaturePlugin: canot treat class" )
+            end
+          end
+        }
+
+      end
+
+      file.print "	/* calling target (MBP120) */\n"
+      if ! b_void then
+        file.print "	ret_val = "
+      else
+        file.print "	"
+      end
+      delim = ""
+      file.print "cTECS_", f.get_name, "( "
+      plist.each{ |param|
+        if param.get_type.get_original_type.kind_of? StructType then
+          aster = "*"
+        else
+          aster = ""
+        end
+        file.print delim, aster, param.get_name
+        delim = ", "
+      }
+      file.print " );\n"
+      
+      file.print "	/* return (MBP130) */\n"
+      case ret_type0
+      when BoolType
+        file.print "	return ret_val ? mrb_true_value() : mrb_false_value();\n"
+      when IntType
+        file.print "	return mrb_fixnum_value( ret_val );\n"
+      when FloatType
+        file.print "	return mrb_float_value( mrb, ret_val );\n"
+      when VoidType
+        file.print "	return  mrb_nil_value();\n"
+      else
+        raise "MrubyBridgeSignaturePlugin: unknown type"
+      end
+
+      file.print "}\n"
+    }
+  end
+
+  def ptrMrb2C file, type, param
+    ttype = type.get_type.get_original_type
+    tment = get_type_map_ent ttype
+    tstr = tment[1]
+=begin
+    case ttype
+    when IntType
+      bit_size = ttype.get_bit_size
+      case bit_size
+      when -1, -11
+        tstr = "Char"
+      when 8, 16, 32, 64
+        tstr = "Int#{bit_size}"
+      when -2
+        tstr = "Short"
+      when -3
+        tstr = "Int"
+      when -4
+        tstr = "Long"
+      when -5
+        tstr = "IntPtr"
+      else
+        raise "MrubyBridgeSignaturePlugin: not handle type"
+      end
+    when FloatType
+      if ttype.get_bit_size == 32 then
+        tstr = "Float32"
+      else
+        tstr = "Double64"
+      end
+    when BoolType
+      tstr = "Bool"
+    when StructType
+      raise "MrubyBridgeSignaturePlugin: not handle type 2 #{ttype}"
+    else
+      raise "MrubyBridgeSignaturePlugin: not handle type 2 #{ttype}"
+    end
+=end
+    if( param.get_size ) then
+      sz_str = param.get_size.to_s
+    elsif param.get_string then      # mikan とりあえず size_is と string の同時指定 (二重ポインタ) はなし
+      sz_str = param.get_string.to_s
+    else
+      sz_str = "1"
+    end
+    # unsigned 型の場合には cast が必要
+    if ttype.get_original_type.get_type_str != param.get_type.get_type.get_type_str then
+      cast_str = "(#{param.get_type.get_type_str})"
+    else
+      cast_str = ""
+    end
+
+    modify = ""
+    case param.get_direction
+    when :OUT, :INOUT
+      case tstr
+      when "Char", "SChar", "UChar"
+        modify = "Mod"
+      end
+    end
+    if param.is_nullable? then
+      nullable = "Nullable"
+    else
+      nullable = ""
+    end
+
+    # file.print "	CHECK_POINTER( #{tstr}, mrb_#{param.get_name}, #{sz_str} );\n"
+    # file.print "	#{param.get_name} = #{cast_str}((struct #{tstr}PointerBody*)(DATA_PTR(mrb_#{param.get_name})))->buf;\n"
+    file.print "	#{param.get_name} = CheckAndGet#{tstr}Pointer#{modify}#{nullable}( mrb, mrb_#{param.get_name}, #{sz_str} );\n"
+  end
+
+  def get_celltype_name
+    @celltype_name
+  end
+
+  #=== プラグイン引数 ignoreUnsigned
+  def set_ignoreUnsigned rhs
+    if rhs == "true" || rhs == nil then
+      @b_ignoreUnsigned = true
+    end
+  end
+  #=== プラグイン引数 include
+  def set_include rhs
+    funcs = rhs.split ','
+    funcs.each{ |rhs_func|
+      found = false
+      rhs_func.gsub!( /\s/, "" )
+      @signature.get_function_head_array.each{ |a|
+        if rhs_func.to_sym == a.get_name then
+          found = true
+        end
+      }
+      if found == false then
+        cdl_error( "MRB1009 include function '$1' not found in signagture '$2'", rhs, @signature.get_name )
+      else
+        @includes << rhs_func.to_sym
+      end
+    }
+  end
+  #=== プラグイン引数 exclude
+  def set_exclude rhs
+    funcs = rhs.split ','
+    funcs.each{ |rhs_func|
+      rhs_func.gsub!( /\s/, "" )
+      func_head = @signature.get_function_head rhs_func.to_sym
+      if func_head == false then
+        cdl_error( "MRB1010 exclude function '$1' not found in signagture '$2", rhs, @signature.get_name )
+      else
+        @excludes << rhs_func.to_sym
+      end
+    }
+  end
+  #=== プラグイン引数 auto_exclude
+  def set_auto_exclude rhs
+    if rhs == "false" then
+      @b_auto_exclude = false
+    elsif rhs == "true" then
+      @b_auto_exclude = true     # auto_exclude = true by default 
+    else
+      cdl_warning( "MRB9999 auto_exclude: unknown rhs value ignored. specify true or false" )
+    end
+  end
+end
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MultiPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MultiPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/MultiPlugin.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2017 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/NotifierPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/NotifierPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/NotifierPlugin.rb	(revision 374)
@@ -1,3 +1,6 @@
 # -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
 #
 #  Copyright (C) 2015 by Ushio Laboratory
@@ -5,5 +8,38 @@
 #  Copyright (C) 2015-2016 by Embedded and Real-Time Systems Laboratory
 #              Graduate School of Information Science, Nagoya Univ., JAPAN
+#  Copyright (C) 2015-2018 by TOPPERS Project
 #
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#  $Id$
+#++
 
 NotifierPluginArgProc = {
@@ -128,6 +164,7 @@
 			# @param [Cell, Symbol] cell セル．セルについて一般化する場合は `:generic`
 			# @param [Integer, Symbol, nil] subscript 添字．添字について一般化する場合は `:generic`
+			# @param [Celltype] 呼び先のセルタイプ、cell==:generic の場合のみ有効
 			# @private
-			def generate_inner(context, fn_name, cell, subscript)
+			def generate_inner(context, fn_name, cell, subscript, callee_ct=nil)
 				source_file = context.source_file
 				header_file = context.header_file
@@ -141,5 +178,6 @@
 				unless ct.is_singleton?
 					if cell == :generic
-						params << "(CELLIDX)extinf"
+						params << "(#{callee_ct.get_global_name}_IDX)extinf"
+						# params << "(CELLIDX)extinf"
 					else
 						# セルのCELLIDXを得る
@@ -233,5 +271,5 @@
 
 						generate_inner context, fn_name,
-							:generic, subscript
+							:generic, subscript, ct
 
 						props.each { |prop|
@@ -445,5 +483,5 @@
 	    # join:: Join : 結合 (declarationがPortであるもの)
 		def validate_join(handler, cell, join)
-        	return !generate_attr_map(handler, cell).nil?
+        return !generate_attr_map(handler, cell).nil?
 		end
 
@@ -872,9 +910,9 @@
     	parse_plugin_arg
     	unless @factory
-    		cdl_error("ASP1003 celltype $1: option factory is not specified",
+    		cdl_error("NTF1003 celltype $1: option factory is not specified",
     			celltype.get_name)
     	end
     	unless @output_file
-    		cdl_error("ASP1003 celltype $1: option output_file is not specified",
+    		cdl_error("NTF1003 celltype $1: option output_file is not specified",
     			celltype.get_name)
     	end
@@ -883,5 +921,5 @@
     def set_factory(template_string)
     	unless @factory.nil?
-    		cdl_error("ASP1003 celltype $1: option factory was specified more than once",
+    		cdl_error("NTF1003 celltype $1: option factory was specified more than once",
     			celltype.get_name)
     	end
@@ -891,5 +929,5 @@
     def set_factory_output_file(output_file)
     	unless @output_file.nil?
-    		cdl_error("ASP1003 celltype $1: option output_file was specified more than once",
+    		cdl_error("NTF1003 celltype $1: option output_file was specified more than once",
     			celltype.get_name)
     	end
@@ -898,5 +936,5 @@
 
     def gen_factory file
-        puts "===== begin #{@celltype.get_name.to_s} plugin ====="
+        # puts "===== begin #{@celltype.get_name.to_s} plugin ====="
 
         kernelCfg = AppFile.open( "#{$gen}/#{@output_file}" )
@@ -922,5 +960,5 @@
 			subst_attr = @celltype.find(name)
 			unless subst_attr
-	    		cdl_error( "ASP1007 celltype $1: additional_param: attribute $2 does not exist.",
+	    		cdl_error( "NTF1007 celltype $1: additional_param: attribute $2 does not exist.",
 	    			@celltype.get_name, name)
 			end
@@ -935,8 +973,9 @@
 
         kernelCfg.close
-        puts "===== end #{@celltype.get_name.to_s} plugin ====="
+        # puts "===== end #{@celltype.get_name.to_s} plugin ====="
     end
 
     def gen_factory_for_cell(kernelCfg, cell)
+      # print "########## gen_factory_for_cell cell=#{cell.get_name}\n"
     	handler_flags = []
     	handler_args = []
@@ -959,12 +998,28 @@
 			when 'false' then ignoreErrors = false
 			else
-				cdl_warning( "ASP1005 cell $1: unrecognized value '$2' specified for ignoreErrors",
+				cdl_warning2( cell.get_locale, "NTF1005 cell $1: unrecognized value '$2' specified for ignoreErrors",
 					cell.get_name, ignoreErrors )
 				ignoreErrors = false
 		end
 
+    # ドメイン指定用文字列
+    pre_text  = ""
+    post_text = "\n"
+    indent    = ""
+ 
     	[EVENT_HANDLER, ERROR_HANDLER].each { |handler|
     		# 呼び口の結合を取得
     		call_join = cell.get_join_list.get_item(handler.call_port_name.to_sym)
+        domain_root = cell.get_region.get_domain_root
+        if cell.get_region.get_domain_root.get_domain_type then
+          # print "cell=#{cell.get_name} domain_root=#{domain_root.get_name} domain_type=#{domain_root.get_domain_type.get_name} domain_option=#{domain_root.get_domain_type.get_option}\n"
+        else
+          # print "cell=#{cell.get_name} domain_root=#{cell.get_region.get_domain_root.get_name}\n"
+        end
+        if call_join
+          # print "validate_join: hanlder=#{handler.class.name} cell=#{cell.get_name} join=#{call_join.get_name} rhs_cell=#{call_join.get_cell}\n"
+        else
+          # print "validate_join: hanlder=#{handler.class.name} cell=#{cell.get_name}\n"
+        end
 
 	    	# ハンドラタイプを判別する
@@ -974,10 +1029,59 @@
 
 	    	if matches.length == 0
-	    		cdl_error( "ASP1001 cell $1: no matching handler type found for $2", cell.get_name, handler.call_port_name )
+	    		cdl_error2( cell.get_locale, "NTF1001 cell $1: no matching handler type found for $2", cell.get_name, handler.call_port_name )
 	    		next
-	    	end
+        end
 
 			# 最初に見つかった有効なハンドラタイプを使用
 	    	ht = matches[0]
+
+      # ドメインプラグインが指定されている場合、所属ドメインのチェック
+      domain_root = cell.get_region.get_domain_root
+      if domain_root.get_domain_type then
+        if domain_root.get_domain_type.get_name == :HRP then
+          option = domain_root.get_domain_type.get_option
+          matches.each{ |match|
+            # p "match:#{match}"
+            case match
+            when ActivateTaskHandlerType,       WakeUpTaskHandlerType,
+                 SetVariableHandlerType,        SetVariableToErrorCodeHandlerType,
+ 		             IncrementVariableHandlerType,  SignalSemaphoreHandlerType, 
+		             SetEventflagHandlerType,       SendToDataqueueHandlerType,
+		             SendErrorCodeToDataqueueHandlerType
+              if option == "OutOfDomain" then
+                cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 cannot be placed out of domain", cell.get_name )
+              elsif call_join.get_cell.get_region.get_domain_root == nil ||
+                    call_join.get_cell.get_region.get_domain_root != domain_root then
+                cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 and $2 must be placed in same domain", cell.get_name, call_join.get_cell.get_name )
+              end
+              dbgPrint "#{self.class.name}: match pattern 1.\n"
+            when UserHandlerType
+              if option != "kernel" then
+                cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 can be placed in kernel domain only, because notify target is handler", cell.get_name )
+              elsif call_join.get_cell.get_region.get_domain_root == nil ||
+                    call_join.get_cell.get_region.get_domain_root != domain_root then
+                cdl_error2( cell.get_locale, "NTF9999: NotifierPlugin: $1 and $2 must be placed in same domain", cell.get_name, call_join.get_cell.get_name )
+              end
+              dbgPrint "#{self.class.name}: match pattern 2.\n"
+		        when NullHandlerType.new  # エラー通知を指定していない
+              dbgPrint "#{self.class.name}: match pattern 3.\n"
+            end
+          }
+
+          # if cell.get_region.get_param == :KERNEL_DOMAIN
+          if option == "kernel"
+            pre_text  = "KERNEL_DOMAIN{\n"
+            post_text = "}\n"
+            indent    =  "\t"
+          elsif option != "OutOfDomain" then
+            pre_text  = "DOMAIN(#{domain_root.get_name.to_s}){\n"
+            post_text = "}\n"
+            indent    =  "\t"
+          end
+        else
+          cdl_error( "NTF9999: NotifierPlugin: unknown domain type $1", domain_root.get_domain_type.get_name )
+        end
+
+      end
 
 			# 通知ハンドラで「エラーが発生するはずがない」のに「エラーハンドラが指定されている」
@@ -986,9 +1090,9 @@
 			#  なため、検出は行わない。)
     		if handler == ERROR_HANDLER && !ht.is_a?(NullHandlerType) && !event_handler_might_fail
-	    		cdl_error( "ASP1004 cell $1: handler type $2 which never raises an error was inferred for the normal notification handler, but an error notification handler was specified.",
+	    		cdl_error2( cell.get_locale, "NTF1004 cell $1: handler type $2 which never raises an error was inferred for the normal notification handler, but an error notification handler was specified.",
 	    			cell.get_name, handler_flag)
     		end
     		if handler == ERROR_HANDLER && ht.is_a?(NullHandlerType) && event_handler_might_fail && !ignoreErrors
-	    		cdl_warning( "ASP1006 cell $1: handler type $2 which might raise an error was inferred for the normal notificaton handler, but an error notification handler was not specified.",
+	    		cdl_warning2( cell.get_locale, "NTF1006 cell $1: handler type $2 which might raise an error was inferred for the normal notificaton handler, but an error notification handler was not specified.",
 	    			cell.get_name, handler_flag)
     		end
@@ -1057,11 +1161,33 @@
 			# $id$等の置換
 			cell.get_celltype.subst_name(subst, name_array)
-    	}
-
-    	# 出力
-    	kernelCfg.puts text
-
-    end
-    private :gen_factory_for_cell
+      }
+
+     # 出力 (CRE_xxx)
+     kernelCfg.print pre_text
+     kernelCfg.print indent, text, "\n"
+     gen_sac kernelCfg, cell, indent
+     kernelCfg.print post_text
+   end
+
+   def gen_sac file, cell, indent
+     domain_root = cell.get_region.get_domain_root
+     if domain_root.get_domain_type then
+       id = (cell.get_attr_initializer :id).to_s
+                 name_array = cell.get_celltype.get_name_array(cell)
+       case cell.get_celltype.get_name
+       when :tCyclicNotifier
+         obj_type = "CYC"
+       when :tAlarmNotifier
+         obj_type = "ALM"
+       else
+         raise "NotifierPlugin: unknown celltype #{cell.get_celltype.get_name}"
+       end
+       id = cell.get_celltype.subst_name(id, name_array)
+       # p obj_type
+       # p HRPPlugin.get_sac_str cell
+       file.print indent, "SAC_#{obj_type}( #{id}, #{HRPPlugin.get_sac_str cell} );\n"
+     end
+   end
+   private :gen_factory_for_cell
 
 end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/OpaqueRPCPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/OpaqueRPCPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/OpaqueRPCPlugin.rb	(revision 374)
@@ -56,5 +56,5 @@
   #=== RPCPlugin の initialize
   #  説明は ThroughPlugin (plugin.rb) を参照
-  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
     super
     @b_noClientSemaphore = false
@@ -254,4 +254,9 @@
     nest = @end_region.gen_region_str_pre file
     nest_str = "  " * nest
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
 
     if @serverErrorHandler then
@@ -282,5 +287,5 @@
 #{nest_str}  cell #{@rpc_server_channel_celltype_name} #{@serverChannelCell}_Unmarshaler {
 #{nest_str}    cChannel = #{@serverChannelCell}.eC1;
-#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
+#{nest_str}    #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
 #{serverErrorHandler_str}#{nest_str}  };
 EOT
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RPCPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RPCPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RPCPlugin.rb	(revision 374)
@@ -65,5 +65,5 @@
   #=== RPCPlugin の initialize
   #  説明は ThroughPlugin (plugin.rb) を参照
-  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
     super
     @b_noClientSemaphore = false
@@ -197,4 +197,9 @@
     nest = @region.gen_region_str_pre file
     indent_str = "  " * nest
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
 
     file.print <<EOT
@@ -233,5 +238,5 @@
     file.print <<EOT
 #{indent_str}cell #{@rpc_channel_celltype_name} #{@cell_name} {
-#{indent_str}  #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name};
+#{indent_str}  #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript};
 #{indent_str}  cTDR         = #{@channelCellName}.eTDR;
 #{indent_str}  cEventflag   = #{@channelCellName}.eEventflag;
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RepeatCellPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RepeatCellPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RepeatCellPlugin.rb	(revision 374)
@@ -0,0 +1,169 @@
+# -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#
+#  Copyright (C) 2015-2018 by TOPPERS Project
+#
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#  $Id$
+#++
+
+#== cell を count 個繰り返すセルプラグイン
+# 不完全点：
+#    指定子に対応していない
+#       cell の指定子 (allocator, id)
+#       結合の指定子 (through)
+class RepeatCellPlugin < CellPlugin
+
+  @@plugin_list = []
+  RepeatCellPluginArgProc = {
+    "count" => Proc.new { |obj,rhs| obj.set_count rhs }
+  }
+
+  def initialize( cell, option )
+    super
+    @@plugin_list << self
+    print "RepeatCellPlugin: #{@cell.get_name}\n"
+    # cell.show_tree 0
+    # @cell.get_join_list.get_items.each{ |j|
+    #  print "Join: #{j.get_name} = #{j.get_rhs.to_s}\n"
+    # }
+    @count = 0
+    @plugin_arg_check_proc_tab = RepeatCellPluginArgProc
+    parse_plugin_arg
+  end
+
+  def gen_cdl_file( file )
+    if $verbose then
+      print "#{self.class}: repeat #{@cell.get_name} #(num} times\n"
+    end
+
+    nest = @cell.get_region.gen_region_str_pre file
+    indent_str = "  " * nest
+    @cell.get_name.to_s =~ /.*[^0-9]([0-9]+)\z/
+    if $1 then
+      tail_zero = $1
+      bname = @cell.get_name.to_s.gsub( /[0-9]+\z/, "" )
+    else
+      cdl_error( "#{self.class}: #{@cell.get_name}'s name ends without '0-9'")
+      return
+    end
+    base_count = tail_zero.to_i
+
+    count = 1
+    num = @count
+    file.print "/*  #{num} times repeat of '#{@cell.get_name}' */\n"
+    while count < num
+
+      # セル名のカウント
+      count_str = (count + base_count).to_s
+      if tail_zero.length > count_str.length then
+        leading_zero = "0" * ( tail_zero.length - count_str.length )
+      else
+        leading_zero = ""
+      end
+      cname = bname + leading_zero + count_str
+
+      #   "cell tCelltype Cell {" 
+      file.print "#{indent_str}cell #{@cell.get_celltype.get_name} #{cname}{\n"
+
+      # Join の CDL 文字列生成
+      @cell.get_join_list.get_items.each{ |j|
+
+        # Join の右辺の解析
+        res = j.get_rhs.analyze_cell_join_expression
+        if res then
+          nsp, subscript, port_name = res[0], res[1], res[2]
+        else
+          nsp = j.get_rhs.analyze_single_identifier
+          if nsp then
+            subscript, port_name = nil, nil
+          else
+            file.print "#{indent_str}  #{j.get_name} = #{j.get_rhs.to_s};\n"
+            next
+          end
+        end
+
+        # 右辺のセル名 (末尾の数字をカウントアップ)
+        nsp.get_name.to_s =~ /(.*[^0-9])([0-9]+)\z/
+        if $2 then
+          rhs_tail_num = $2
+          rhs_name_count = count + rhs_tail_num.to_i
+          if rhs_tail_num.length > rhs_name_count.to_s.length then
+            leading_zero = "0" * ( rhs_tail_num.length - rhs_name_count.to_s.length )
+          else
+            leading_zero = ""
+          end
+          rhs_cname = $1 + leading_zero + rhs_name_count.to_s
+          nsp = nsp.change_name_clone rhs_cname
+        end
+
+        # Join 文字列の出力
+        if port_name then
+          # 右辺は セルの結合
+          if subscript then
+            file.print "#{indent_str}  #{j.get_name} = #{nsp.get_path_str}.#{port_name}[#{(count+subscript).to_s}];\n"
+          else
+            file.print "#{indent_str}  #{j.get_name} = #{nsp.get_path_str}.#{port_name};\n"
+          end
+        else
+          # 右辺は単一の識別子
+          file.print "#{indent_str}  #{j.get_name} = #{nsp.get_path_str};\n"
+        end
+      }
+
+      file.print "#{indent_str}};\n\n"
+      count += 1
+    end
+
+    @cell.get_region.gen_region_str_post file
+  end
+
+  #=== count オプションの解析
+  def set_count rhs
+    if rhs =~ /\A\d+\z/
+      @count = rhs.to_i
+    else
+      nsp = NamespacePath.new( rhs.to_sym, true )
+      expr = Expression.create_single_identifier( nsp, nil )
+      res = expr.eval_const( nil )
+      if res == nil then
+        cdl_error( "count value ($1): not single identifier or integer number", rhs.to_s )
+        @count = 0
+      else
+        @count = res
+      end
+    end
+  end
+
+end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RepeatJoinPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RepeatJoinPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/RepeatJoinPlugin.rb	(revision 374)
@@ -0,0 +1,131 @@
+# -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#
+#  Copyright (C) 2015-2018 by TOPPERS Project
+#
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#  $Id$
+#++
+
+class RepeatJoinPlugin < CellPlugin
+
+  RepeatJoinPluginArgProc = {
+    "count" => Proc.new { |obj,rhs| obj.set_count rhs }
+  }
+
+  def initialize( cell, option )
+    super
+    print "RepeatJoinPlugin: #{@cell.get_name}\n"
+    # cell.show_tree 0
+    @plugin_arg_check_proc_tab = RepeatJoinPluginArgProc
+    parse_plugin_arg
+
+    @cell.get_join_list.get_items.each{ |j|
+      # print "Join: #{j.get_name} = #{j.get_rhs.to_s}\n"
+
+      # Join の右辺を解析
+      ret = j.get_rhs.analyze_cell_join_expression
+      if ret == nil then
+        next
+      end
+      rhs_nsp = ret[0]; rhs_subscript = ret[1]; rhs_port_name = ret[2]
+
+      # 呼び口配列で、添数が 0 の場合にのみカウントアップさせる
+      if j.get_subscript == 0 then
+        rhs_name = rhs_nsp.get_name.to_s
+        if rhs_name =~ /(.*[^0-9])([0-9]+)\z/ then
+          b_rhs_name_count = true
+          rhs_name = $1
+          n_digits = $2.length
+          rhs_count_base = $2.to_i
+        else
+          b_rhs_name_count = false
+          rhs_count_base = 0
+        end
+
+        if rhs_subscript && rhs_subscript == 0 then
+          b_rhs_subscript_count = true
+        else
+          b_rhs_subscript_count = false
+        end
+
+        count = 1
+        while count < @count
+          count_str = (count+rhs_count_base).to_s
+
+          if b_rhs_subscript_count then
+            rhs_subscript = count
+          end
+
+          if b_rhs_name_count then
+            if n_digits - count_str.length > 0 then
+              leading_zero = "0" * ( n_digits - count_str.length )
+            else
+              leading_zero = ""
+            end
+
+            rhs_name_real = rhs_name + leading_zero + count_str
+          else
+            rhs_name_real = rhs_name
+          end
+          rhs_nsp2 = rhs_nsp.change_name_clone rhs_name_real.to_sym
+
+          rhs = Expression.create_cell_join_expression( rhs_nsp2, rhs_subscript, rhs_port_name )
+          j2 = Join.new( j.get_name, count, rhs )
+          cell.new_join j2
+
+          count += 1
+        end
+      end
+    }
+  end
+
+  #=== count オプションの解析
+  def set_count rhs
+    if rhs =~ /\A\d+\z/
+      @count = rhs.to_i
+    else
+      nsp = NamespacePath.new( rhs.to_sym, true )
+      expr = Expression.create_single_identifier( nsp, nil )
+      res = expr.eval_const( nil )
+      if res == nil then
+        cdl_error( "count value ($1): not single identifier or integer number", rhs.to_s )
+        @count = 0
+      else
+        @count = res
+      end
+    end
+  end
+
+end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedOpaqueRPCPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedOpaqueRPCPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedOpaqueRPCPlugin.rb	(revision 374)
@@ -68,5 +68,5 @@
   #=== RPCPlugin の initialize
   #  説明は ThroughPlugin (plugin.rb) を参照
-  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
     super
     initialize_opaque_marshaler
@@ -221,4 +221,10 @@
     nest = @start_region.gen_region_str_pre file
     indent_str = "  " * nest
+    nest_str = "  " * nest
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
 
     # セルを探す
@@ -303,5 +309,5 @@
 #{indent_str}cell #{@unmarshaler_celltype_name} #{@cell_name}_Server {
 #{indent_str}  cTDR         = #{@shared_channel_cell}_Server.eTDR;
-#{indent_str}  cServerCall  = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
+#{indent_str}  cServerCall  = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
 #{ppallocator_join}#{indent_str}};
 EOT
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedRPCPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedRPCPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/SharedRPCPlugin.rb	(revision 374)
@@ -62,5 +62,5 @@
   #=== RPCPlugin の initialize
   #  説明は ThroughPlugin (plugin.rb) を参照
-  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
 
     # mikan プラグインオプション指定の不一致のチェック task_priority, 
@@ -236,4 +236,9 @@
     nest = @region.gen_region_str_pre file
     indent_str = "  " * nest
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
 
     # セルを探す
@@ -291,5 +296,5 @@
     file.print <<EOT
 #{indent_str}cell #{@rpc_channel_celltype_name} #{@cell_name} {
-#{indent_str}  #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name};
+#{indent_str}  #{@call_port_name} = #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript};
 #{indent_str}  cTDR         = #{@shared_channel_cell}.eTDR;
 #{indent_str}  cEventflag   = #{@shared_channel_cell}.eEventflag;
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TECSInfoPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TECSInfoPlugin.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TECSInfoPlugin.rb	(revision 374)
@@ -0,0 +1,283 @@
+# -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+# 
+#   Copyright (C) 2017-2018 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#   $Id$
+#++
+
+#== CelltypePlugin for tTECSInfo
+class TECSInfoPlugin < CelltypePlugin
+
+  @@cell_list = []
+  #@celltype::Celltype
+  #@plugin_arg_str::String
+  #@plugin_arg_list::{argNameString=>argOptionString}
+  #@cell_list::[Cell]
+
+  #celltype::     Celltype        セルタイプ（インスタンス）
+  def initialize( celltype, option )
+    super
+    if $unopt_entry == false then
+      cdl_info( "TIF0001 forcely set --unoptimize-entry by TECSInfoPlugin (by importing TECSInfo.cdl)" )
+      $unopt_entry = true
+    end
+  end
+
+  #=== 新しいセル
+  #cell::        Cell            セル
+  #
+  # celltype プラグインを指定されたセルタイプのセルが生成された
+  # セルタイププラグインに対する新しいセルの報告
+  def new_cell( cell )
+    @@cell_list << cell
+
+    # AppFile は、重ね書きようなので、やめる
+    # p "import: cell nTECSInfo::tTECSInfoSub #{cell.get_namespace_path.to_s} under #{cell.get_region.get_name}"
+    # cell.show_tree 0
+    # TECSInfoSub セルのプロトタイプ宣言
+    fn = "#{$gen}/tmp_#{cell.get_region.get_global_name}_TECSInfoSub.cdl"
+    File.open( fn, "w" ){ |f|
+      f.print "/* prototype declaration of TECSInfoSub */\n"
+      nest = cell.get_region.gen_region_str_pre f
+      indent = "    " * nest
+      f.print <<EOT
+#{indent}[in_through()]
+#{indent}region rTECSInfo {
+#{indent}    cell nTECSInfo::tTECSInfoSub TECSInfoSub;
+#{indent}}; /* rTECSInfo} */
+EOT
+      cell.get_region.gen_region_str_post f
+    }
+    Import.new fn
+
+    # セルに cTECSInfo の結合があるか？
+    if cell.get_join_list.get_item( :cTECSInfo ) == nil then
+      # cTECSInfo = rTECSInfo::TECSInfosub.eTECSInfo; の追加
+      nsp = NamespacePath.new( :rTECSInfo, false )
+      nsp.append! :TECSInfoSub
+      rhs = Expression.create_cell_join_expression nsp, nil, :eTECSInfo
+      join = Join.new :cTECSInfo, nil, rhs
+      cell.new_join join
+    end
+  end
+
+  #=== tCelltype_factory.h に挿入するコードを生成する
+  # file 以外の他のファイルにファクトリコードを生成してもよい
+  # セルタイププラグインが指定されたセルタイプのみ呼び出される
+  def gen_factory file
+    File.open( "#{$gen}/include_all_signature_header.h", "w" ){ |f|
+      f.print <<EOT
+#ifndef include_all_signature_header_h
+#define include_all_signature_header_h
+
+EOT
+      Namespace.get_root.travers_all_signature{ |sig|
+        f.print "#include \"#{sig.get_global_name}_tecsgen.h\"\n"
+      }
+      f.print <<EOT
+
+#endif /* include_all_signature_header_h */
+EOT
+    }
+
+    undefs2 = [ :INITIALIZE_CB, :FOREACH_CELL, :END_FOREACH_CELL ]
+    f = AppFile.open( "#{$gen}/nTECSInfo_tVarDeclInfo_factory.h" )
+    Namespace.get_root.print_struct_define f
+
+    undefs = [ :VALID_IDX, :GET_CELLCB, :CELLCB, :CELLIDX,
+               :tVarDeclInfo_IDX, :ATTR_name, :ATTR_sizeIsExpr,
+               :ATTR_declType, :ATTR_offset ]
+
+    f.print <<EOT
+
+/***** Offset of attr & var of celltype  *****/
+#define TOPPERS_CB_TYPE_ONLY
+
+/* In case a celltype has 'inline' entry,
+ * some macros are temporally defined
+ * even if TOPPERS_CB_TYPE_ONLY is defined.
+ * To avoid redefinition warning, undef these macros.
+ */
+#{ str=""; undefs.each{|u| str += "#undef #{u}\n" }; str }
+EOT
+    if $ram_initializer then
+      undefs2.each{|u|
+        f.print "#undef #{u}\n"
+      }
+    end
+    Namespace.get_root.print_celltype_define_offset f
+    f.print <<EOT
+
+/* redefine macros */
+#define tVarDeclInfo_IDX  nTECSInfo_tVarDeclInfo_IDX
+
+EOT
+    if $ram_initializer then
+      f.print <<EOT
+#define FOREACH_CELL(i,p_cb)   { (void)(i);
+#define END_FOREACH_CELL   }
+#define INITIALIZE_CB(p_that)   (void)(p_that);
+#define SET_CB_INIB_POINTER(i,p_that)
+EOT
+    end
+    f.close
+
+    undefs = [ :N_CP_cEntryInfo, :NCP_cEntryInfo, :N_CP_cCallInfo, :NCP_cCallInfo,
+               :N_CP_cAttrInfo, :NCP_cAttrInfo, :N_CP_cVarInfo, :NCP_cVarInfo,
+               :VALID_IDX, :GET_CELLCB, :CELLCB, :CELLIDX, :ATTR_name, :ATTR_b_singleton,
+               :ATTR_b_IDX_is_ID_act, :ATTR_sizeOfCB, :ATTR_sizeOfINIB, :ATTR_n_cellInLinUnit,
+               :ATTR_n_cellInSystem, :cEntryInfo_getName, :cEntryInfo_getNameLength,
+               :cEntryInfo_getSignatureInfo, :cEntryInfo_getArraySize, :cEntryInfo_isInline,
+               :cCallInfo_getName, :cCallInfo_getNameLength, :cCallInfo_getSignatureInfo,
+               :cCallInfo_getArraySize, :cCallInfo_getSpecifierInfo, :cCallInfo_getInternalInfo,
+               :cCallInfo_getLocationInfo, :cCallInfo_getOptimizeInfo, :cAttrInfo_getName,
+               :cAttrInfo_getOffset, :cAttrInfo_getTypeInfo, :cAttrInfo_getSizeIsExpr,
+               :cAttrInfo_getSizeIs, :cVarInfo_getName, :cVarInfo_getOffset, :cVarInfo_getTypeInfo,
+               :cVarInfo_getSizeIsExpr, :cVarInfo_getSizeIs, :cEntryInfo_refer_to_descriptor,
+               :cEntryInfo_ref_desc, :cCallInfo_refer_to_descriptor, :cCallInfo_ref_desc,
+               :cAttrInfo_refer_to_descriptor, :cAttrInfo_ref_desc, :cVarInfo_refer_to_descriptor,
+               :cVarInfo_ref_desc, :is_cEntryInfo_joined, :is_cCallInfo_joined,
+               :is_cAttrInfo_joined, :is_cVarInfo_joined, :eCelltypeInfo_getName,
+               :eCelltypeInfo_getNameLength, :eCelltypeInfo_getNAttr, :eCelltypeInfo_getAttrInfo,
+               :eCelltypeInfo_getNVar, :eCelltypeInfo_getVarInfo, :eCelltypeInfo_getNCall,
+               :eCelltypeInfo_getCallInfo, :eCelltypeInfo_getNEntry, :eCelltypeInfo_getEntryInfo,
+               :eCelltypeInfo_isSingleton, :eCelltypeInfo_isIDX_is_ID, :eCelltypeInfo_hasCB,
+               :eCelltypeInfo_hasINIB, :FOREACH_CELL, :END_FOREACH_CELL ]
+
+    f = AppFile.open( "#{$gen}/nTECSInfo_tCelltypeInfo_factory.h" )
+    undefs.each{ |u|
+      f.print "#undef #{u}\n"
+    }
+    f.print "#define TOPPERS_CB_TYPE_ONLY\n"
+    Namespace.get_root.print_celltype_define f
+    # FOREACH_CELL を出しなおす
+    ct = Namespace.find [ "::", :nTECSInfo, :tCelltypeInfo ]
+    ct.gen_ph_foreach_cell f
+    ct.gen_ph_cb_initialize_macro f
+    f.print "\n"
+    f.close
+   
+    undefs = [ :VALID_IDX, :GET_CELLCB, :CELLCB, :CELLIDX,
+               :tCallInfo_IDX, :ATTR_name, :ATTR_offset, :ATTR_b_inCB,
+               :ATTR_b_optional, :ATTR_b_omit, :ATTR_b_dynamic,
+               :ATTR_b_ref_desc, :ATTR_b_allocator_port,
+               :ATTR_b_require_port, :ATTR_b_VMT_useless,
+               :ATTR_b_skelton_useless, :ATTR_b_cell_unique,
+               :cSignatureInfo_getName, :cSignatureInfo_getNameLength,
+               :cSignatureInfo_getNFunction,
+               :cSignatureInfo_getFunctionInfo,
+               :cSignatureInfo_refer_to_descriptor,
+               :cSignatureInfo_ref_desc, :eCallInfo_getName,
+               :eCallInfo_getNameLength, :eCallInfo_getSignatureInfo,
+               :eCallInfo_getArraySize, :eCallInfo_isOptional,
+               :eCallInfo_isDynamic, :eCallInfo_isRefDesc,
+               :eCallInfo_isOmit ]
+
+    f = AppFile.open( "#{$gen}/nTECSInfo_tCallInfo_factory.h" )
+    f.print <<EOT
+
+/***** Offset of attr & var of celltype  *****/
+#define TOPPERS_CB_TYPE_ONLY
+
+/* In case a celltype has 'inline' entry,
+ * some macros are temporally defined
+ * even if TOPPERS_CB_TYPE_ONLY is defined.
+ * To avoid redefinition warning, undef these macros.
+ */
+#{ str=""; undefs.each{|u| str += "#undef #{u}\n" }; str }
+EOT
+    if $ram_initializer then
+      undefs2.each{|u|
+        f.print "#undef #{u}\n"
+      }
+    end
+
+    Namespace.get_root.print_call_define f
+    f.print <<EOT
+
+/* redefine macros */
+#define tCallInfo_IDX  nTECSInfo_tCallInfo_IDX
+
+EOT
+    if $ram_initializer then
+      f.print <<EOT
+#define FOREACH_CELL(i,p_cb)   { (void)(i);
+#define END_FOREACH_CELL   }
+#define INITIALIZE_CB(p_that)   (void)(p_that);
+#define SET_CB_INIB_POINTER(i,p_that)
+
+EOT
+    end
+    f.close
+
+    f = AppFile.open( "#{$gen}/nTECSInfo_tEntryInfo_factory.h" )
+    Namespace.get_root.print_entry_define f
+    f.close
+
+    undefs = [ :GET_CELLCB, :CELLCB, :CELLIDX, :ATTR_name, :INITIALIZE_CB, :FOREACH_CELL ]
+    f = AppFile.open( "#{$gen}/nTECSInfo_tCellInfo_factory.h" )
+    undefs.each{ |u|
+      f.print "#undef #{u}\n"
+    }
+    Region.get_root.print_cell_define f
+    # FOREACH_CELL を出しなおす
+    ct = Namespace.find [ "::", :nTECSInfo, :tCellInfo ]
+    ct.gen_ph_foreach_cell f
+    ct.gen_ph_cb_initialize_macro f
+    f.close
+
+    f = AppFile.open( "#{$gen}/nTECSInfo_tRawEntryDescriptorInfo_factory.h" )
+    Region.get_root.print_entry_descriptor_define f
+    f.close
+  end
+
+  #=== 後ろの CDL コードを生成
+  #プラグインの後ろの CDL コードを生成
+  #file:: File:
+  def self.gen_post_code( file )
+    if Generator.get_n_error > 0 then
+      Generator.info( "I9999 TECSInfoPlugin does not generate TECSInfo code because of early error" )
+      return
+    end
+    # 複数のプラグインの post_code が一つのファイルに含まれるため、以下のような見出しをつけること
+    file.print <<EOT
+/*------------ #{self.name} post code ------------*/
+EOT
+    @@cell_list.each{|cell|
+      root = cell.get_region # .get_link_root
+      TECSInfo.print_info file, root
+    }
+  end
+end
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ThroughPlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ThroughPlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/ThroughPlugin.rb	(revision 374)
@@ -47,4 +47,5 @@
 #@next_cell:: Cell                    呼び口を結合するセル
 #@next_cell_port_name:: Symbol       呼び口を結合する受口の名前
+#@next_cell_port_subscript::Nil|Integer   呼び口を結合する受口の配列添数．受け口配列でない場合 nil
 #@signature::      Signature          シグニチャ
 #@celltype::       Celltype           呼び先のセルのセルタイプ. through が連接する場合、最終的な呼び先のセルのセルタイプ
@@ -74,8 +75,9 @@
   #next_cell::      Cell               呼び口を接続するセル
   #next_cell_port_name:: Symbol        呼び口を接続する受口の名前
+  #next_cell_port_subscript:: Nil|Integer  呼び口を接続する受口配列添数
   #signature::      Signature          シグニチャ
   #celltype::       Celltype           セルタイプ (呼び先のセルのセルタイプ)
   #caller_cell::    Cell               呼び元のセル．@caller_cell の項を参照
-  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
     super()
     @cell_name = cell_name                      # 生成すべきセル名（受け口側のセル名）
@@ -83,4 +85,5 @@
     @next_cell = next_cell                      # 呼び先のセル
     @next_cell_port_name = next_cell_port_name
+    @next_cell_port_subscript = next_cell_port_subscript
     @signature = signature
     @entry_port_name = :"eThroughEntry"
@@ -136,4 +139,9 @@
   def get_through_entry_port_name
     @entry_port_name
+  end
+
+  #===  生成されたセルの受け口配列添数を得る
+  def get_through_entry_port_subscript
+    @entry_port_subscript
   end
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TracePlugin.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TracePlugin.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/TracePlugin.rb	(revision 374)
@@ -44,5 +44,5 @@
   #=== TracePlugin の initialize
   #  説明は ThroughPlugin (plugin.rb) を参照
-  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, signature, celltype, caller_cell )
+  def initialize( cell_name, plugin_arg, next_cell, next_cell_port_name, next_cell_port_subscript, signature, celltype, caller_cell )
 
     @maxArrayDisplay = 16
@@ -141,4 +141,9 @@
       nest = @region.gen_region_str_pre file
       indent_str =  "  " * nest
+      if @next_cell_port_subscript then
+        subscript = '[' + @next_cell_port_subscript.to_s + ']'
+      else
+        subscript = ""
+      end
 
       if @probeName then
@@ -155,5 +160,5 @@
       file.print <<EOT
 #{indent_str}cell #{@ct_name} #{@cell_name} {
-#{indent_str}  #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name};
+#{indent_str}  #{@call_port_name} = #{@next_cell.get_namespace_path.get_path_str}.#{@next_cell_port_name}#{subscript};
 #{probeName_str}#{caller_cell_str}#{indent_str}};
 EOT
@@ -210,8 +215,13 @@
     }
     file.print( " );\n" )
+    if @next_cell_port_subscript then
+      subscript = '[' + @next_cell_port_subscript.to_s + ']'
+    else
+      subscript = ""
+    end
 
     file.print <<EOT
 \tgetMicroTime( &utime );
-\tsyslog( LOG_INFO, \"Leave: %sTime=%d: #{@next_cell.get_name}.#{@next_cell_port_name}.#{func_name}\", ATTR_probeName_str, utime );
+\tsyslog( LOG_INFO, \"Leave: %sTime=%d: #{@next_cell.get_name}.#{@next_cell_port_name}#{subscript}.#{func_name}\", ATTR_probeName_str, utime );
 EOT
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenHRP2Marshaler.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenHRP2Marshaler.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenHRP2Marshaler.rb	(revision 374)
@@ -35,4 +35,5 @@
 #   の責任を負わない．
 #  
+#   $Id$
 #++
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenOpaqueMarshaler.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenOpaqueMarshaler.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenOpaqueMarshaler.rb	(revision 374)
@@ -4,5 +4,5 @@
 #      Generator for TOPPERS Embedded Component System
 #  
-#   Copyright (C) 2008-2014 by TOPPERS Project
+#   Copyright (C) 2008-2018 by TOPPERS Project
 #--
 #   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
@@ -464,6 +464,8 @@
 	/* Channel Lock */
 	SET_RPC_STATE( state_, RPCSTATE_CLIENT_GET_SEM );
-	if( is_cLockChannel_joined() )
-		cLockChannel_wait();
+	if( is_cLockChannel_joined() ){
+		if( (ercd_=cLockChannel_wait()) != E_OK )
+			goto error_reset;
+	}
 EOT
 
@@ -554,6 +556,14 @@
 	/* Channel Unlock */
 	SET_RPC_STATE( state_, RPCSTATE_CLIENT_RELEASE_SEM );
-	if( is_cLockChannel_joined() )
-		cLockChannel_signal();
+	if( is_cLockChannel_joined() ){
+		if( (ercd_=cLockChannel_signal()) != E_OK )
+			goto error_reset;
+	}
+EOT
+
+    file.print <<EOT
+	/* state_ is not used in normal case */
+  /* below is to avoid 'set but not used' warnning */
+	(void)state_;
 EOT
 
@@ -630,5 +640,5 @@
         file.print <<EOT
 	}else{
-		return;
+		return E_ID;
 	}
 EOT
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenTransparentMarshaler.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenTransparentMarshaler.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/GenTransparentMarshaler.rb	(revision 374)
@@ -388,5 +388,5 @@
     };
 #{ppallocator_dealloc_str}
-    return;
+    return E_OK;
 
 error_reset:
@@ -394,4 +394,5 @@
         (void)cTDR_reset();
 #{ppallocator_dealloc_str}
+    return E_OK;
 EOT
 
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/MrubyBridgeCelltypePluginModule.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/MrubyBridgeCelltypePluginModule.rb	(revision 374)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/plugin/lib/MrubyBridgeCelltypePluginModule.rb	(revision 374)
@@ -0,0 +1,284 @@
+# -*- coding: utf-8 -*-
+#
+#  TECS Generator
+#      Generator for TOPPERS Embedded Component System
+#  
+#   Copyright (C) 2008-2011 by TOPPERS Project
+#--
+#   上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
+#   ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
+#   変・再配布（以下，利用と呼ぶ）することを無償で許諾する．
+#   (1) 本ソフトウェアをソースコードの形で利用する場合には，上記の著作
+#       権表示，この利用条件および下記の無保証規定が，そのままの形でソー
+#       スコード中に含まれていること．
+#   (2) 本ソフトウェアを，ライブラリ形式など，他のソフトウェア開発に使
+#       用できる形で再配布する場合には，再配布に伴うドキュメント（利用
+#       者マニュアルなど）に，上記の著作権表示，この利用条件および下記
+#       の無保証規定を掲載すること．
+#   (3) 本ソフトウェアを，機器に組み込むなど，他のソフトウェア開発に使
+#       用できない形で再配布する場合には，次のいずれかの条件を満たすこ
+#       と．
+#     (a) 再配布に伴うドキュメント（利用者マニュアルなど）に，上記の著
+#         作権表示，この利用条件および下記の無保証規定を掲載すること．
+#     (b) 再配布の形態を，別に定める方法によって，TOPPERSプロジェクトに
+#         報告すること．
+#   (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
+#       害からも，上記著作権者およびTOPPERSプロジェクトを免責すること．
+#       また，本ソフトウェアのユーザまたはエンドユーザからのいかなる理
+#       由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
+#       免責すること．
+#  
+#   本ソフトウェアは，無保証で提供されているものである．上記著作権者お
+#   よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
+#   に対する適合性も含めて，いかなる保証も行わない．また，本ソフトウェ
+#   アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
+#   の責任を負わない．
+#  
+#   $Id$
+#++
+
+#== celltype プラグインの共通の親クラス
+module MrubyBridgeCelltypePluginModule
+
+  # プラグイン引数名 => Proc
+  MrubyBridgePluginArgProc = { 
+      "ignoreUnsigned" => Proc.new { |obj,rhs| obj.set_ignoreUnsigned rhs },
+      "include_inner_cell" => Proc.new { |obj,rhs| obj.set_include_inner_cell rhs },
+      "exclude_cell" => Proc.new { |obj,rhs| obj.set_exclude_cell rhs },
+      "exclude_port" => Proc.new { |obj,rhs| obj.set_exclude_port rhs },
+      "exclude_port_func" => Proc.new { |obj,rhs| obj.set_exclude_port_func rhs },
+      "auto_exclude" => Proc.new { |obj,rhs| obj.set_auto_exclude rhs },
+  }
+
+  require_tecsgen_lib( "MrubyBridgeCellPlugin.rb" )
+  @@plugin_list = []
+  @@count = 1
+
+  #celltype::     Celltype        セルタイプ（インスタンス）
+  def initialize( celltype, option )
+    dbgPrint "#{self.class.name}: initialzie: #{celltype.get_name}\n"
+
+    super
+    @celltype = celltype
+    @cell_list = []
+    @include_inner_cell = false
+    @exclude_cells = []
+    @exclude_port = []
+    @exclude_port_func = {}
+    @b_ignoreUnsigned = false
+    @b_auto_exclude = true     # auto_exclude = true by default 
+    @@plugin_list << self
+
+    @plugin_arg_check_proc_tab = MrubyBridgePluginArgProc
+    @plugin_arg_str = CDLString.remove_dquote option
+    parse_plugin_arg
+
+    MrubyBridgeCellPlugin.set_gen_post_code_by_dependent
+  end
+
+  #=== 新しいセル
+  #cell::        Cell            セル
+  #
+  # celltype プラグインを指定されたセルタイプのセルが生成された
+  # セルタイププラグインに対する新しいセルの報告
+  # generate 文により呼び出された場合、それまでに定義された cell については、initialize のタイミングで呼び出される
+  def new_cell( cell )
+    dbgPrint "MrubyBridgeCelltypePluginModule: new_cell: #{cell.get_name}\n"
+
+    return if @cell_list.include? cell   # この行は、本来不要のはず
+    if TECSGEN.post_coded?               # post_code 以降のセルは対象から外す
+      cdl_info( "I9999 MrubyBridgeCelltypePlugin: $1 is excluded because cell generated after post_coded", cell.get_name )
+      return
+    end
+
+    # include_inner_cell option
+    if cell.is_cloned? && @include_inner_cell == false then
+    #   p "#{cell.get_name} excluded"
+      cdl_info( "I9999 MrubyBridgeCelltypePlugin: inner cell $1 is excluded", cell.get_name )
+      return
+    # else
+    #   p "#{cell.get_name} included"
+    end
+
+    # exclude_cell option
+    if @exclude_cells.include?( cell.get_name ) then
+      return
+    end
+
+    opt_str = "ignoreUnsigned=#{@b_ignoreUnsigned}, auto_exclude=#{@b_auto_exclude}"
+    @exclude_port.each{ |port|
+      opt_str += ",exclude_port=#{port}"
+    }
+    @exclude_port_func.each{ |port, funcs|
+      funcs.each{ |func|
+        opt_str += ",exclude_port_func=#{port}.#{func}"
+      }
+    }
+
+    # p "MrubyBridgeCelltypePlugin: opt_str=#{opt_str}"
+
+    fn2 = "#{$gen}/tmp_MrubyBridgeCelltypePluginModule_#{@celltype.get_name}_#{@@count}.cdl"
+    f2 = File.open( fn2, "w" )
+    f2.print <<EOT
+/* MrubyBridgeCelltypePluginModule: celltype=#{@celltype.get_name} */
+generate( MrubyBridgeCellPlugin, #{cell.get_namespace_path}, "#{opt_str}" );
+EOT
+    f2.close
+    dbgPrint "MrubyBridgeCelltypePluginModule new_cell: Import #{fn2}\n"
+    Import.new "#{fn2}"
+    @@count += 1
+  end
+
+### 意味解析段階で呼び出されるメソッド ###
+  #===  CDL ファイルの生成
+  #      typedef, signature, celltype, cell のコードを生成
+  #      重複して生成してはならない
+  #      すでに生成されている場合は出力しないこと。
+  #      もしくは同名の import により、重複を避けること。
+  #file::        FILE       生成するファイル
+  def gen_cdl_file file
+#   この段階で呼びだすと generate 文が呼び出される前のセルのみの出力となる
+    
+#    dbgPrint "MrubyBridgeCelltypePlugin: gen_cdl_file: #{@celltype.get_name}\n"
+#    file.print <<EOT
+#/* MrubyBridgeCelltypePlugin: celltype=#{@celltype.get_name}
+# *
+# *    cell's generate before celltype's generate
+# */
+#
+#EOT
+#    @celltype.get_cell_list.each { |cell|
+#      @cell_list << cell
+#      # mikan option, region
+#      dbgPrint "MrubyBridgeCelltypePlugin: cell=#{cell.get_name}\n"
+#      file.print <<EOT
+#generate( MrubyBridgeCellPlugin, #{cell.get_namespace_path}, "" );
+#EOT
+#    }
+
+  end
+
+  #=== tCelltype_factory.h に挿入するコードを生成する
+  # file 以外の他のファイルにファクトリコードを生成してもよい
+  # セルタイププラグインが指定されたセルタイプのみ呼び出される
+  def gen_factory file
+  end
+
+  def get_celltype
+    @celltype
+  end
+
+  @@b_gen_post_code_called = false
+  #=== 後ろの CDL コードを生成
+  #プラグインの後ろの CDL コードを生成
+  #file:: File: 
+  def self.gen_post_code( file )
+    dbgPrint "#{self.name}: gen_post_code_body\n"
+
+    if @@b_gen_post_code_called == false then
+      @@b_gen_post_code_called = true
+      MrubyBridgeCellPlugin.gen_post_code_body file
+    end
+
+#    この段階で生成すると、同じポストコードで出力される mruby の初期化コードに反映されない
+    
+#    # MrubyBridgeCelltypePlugin の生成する generate 文は、
+#    fn2 = "#{$gen}/tmp_MrubyBridgeCelltypePlugin_post.cdl"
+#    f2 = File.open( fn2, "w" )
+#    # 複数のプラグインの post_code が一つのファイルに含まれるため、以下のような見出しをつけること
+#    dbgPrint "MrubyBridgeCelltypePlugin: gen_post_code\n"
+#    f2.print "/* '#{self.name}' post code */\n"
+#    @@plugin_list.each{ |plugin|
+#      plugin.get_celltype.get_cell_list.each{ |cell|
+#        # mikan option, region
+#        f2.print <<EOT
+#generate( MrubyBridgeCellPlugin, #{cell.get_namespace_path}, "" );
+#EOT
+#      }
+#    }
+#    f2.close
+#    p Import
+#    Import.new "#{fn2}"
+  end
+
+  #=== プラグイン引数 
+
+  #=== プラグイン引数 ignoreUnsigned
+  def set_ignoreUnsigned rhs
+    if rhs == "true" || rhs == nil then
+      @b_ignoreUnsigned = true
+    end
+  end
+
+  def set_include_inner_cell rhs
+    if rhs == "true" || rhs == nil then
+      @include_inner_cell = true
+    end
+  end
+
+  def set_exclude_cell rhs
+    cells = rhs.split ','
+    cells.each{ |rhs_cell|
+      rhs_cell.gsub!( /\s/, "" )
+      @exclude_cells << rhs_cell.to_sym
+    }
+  end
+  def set_exclude_port rhs
+    ports = rhs.split ','
+    ct = @cell.get_celltype
+    return if ct == nil    # error case
+    ports.each{ |rhs_port|
+      obj = ct.find( rhs_port.to_sym )
+      if( ( ! obj.instance_of? Port ) || obj.get_port_type != :ENTRY ) then
+        cdl_error( "MRB9999 exclude_port '$1' not found or not entry in celltype '$2'", rhs_port, ct.get_name )
+      else
+        # print "MRBBridgeCellPlugin: exclude #{rhs_port}\n"
+        @exclude_port << rhs_port
+      end
+    }
+  end
+
+  #=== プラグイン引数 exclude_port_func
+  def set_exclude_port_func rhs
+    port_funcs = rhs.split ','
+    ct = @celltype
+    return if ct == nil    # error case
+    port_funcs.each{ |rhs_port_func|
+      port_func = rhs_port_func.split( '.' )
+      if port_func.length != 2 then
+        cdl_error( "MRB9999 exclude_port_func: '$1' not in 'port.func' form", rhs_port_func )
+      end
+      obj = ct.find( port_func[0].to_sym )
+      if( ( ! obj.instance_of? Port ) || obj.get_port_type != :ENTRY ) then
+        cdl_error( "MRB9999 exclude_port_func: port '$1' not found in celltype '$2'", rhs_port_func, ct.get_name )
+      else
+        signature = obj.get_signature
+        next if signature == nil     # error case
+        if signature.get_function_head port_func[1].to_sym
+          # print "MRBBridgeCellPlugin: #{port_func[0]}.#{port_func[1]} exclude\n"
+          if @exclude_port_func[ port_func[0] ] then
+            @exclude_port_func[ port_func[0] ] <<  port_func[1]
+          else
+            @exclude_port_func[ port_func[0] ] = [ port_func[1] ]
+          end
+        else
+          cdl_error( "MRB9999 include_port_func: func '$1' not found in port '$2' celltype $3",
+                     port_func[1], port_func[0], ct.get_name )
+        end
+      end
+    }
+  end
+
+  #=== プラグイン引数 auto_exclude
+  def set_auto_exclude rhs
+    # print "MrubyBridgeCellPlugin: auto_exclude=#{rhs}\n"
+    if rhs == "false" then
+      @b_auto_exclude = false
+    elsif rhs == "true" then
+      @b_auto_exclude = true     # auto_exclude = true by default 
+    else
+      cdl_warning( "MRB9999 auto_exclude: unknown rhs value ignored. specify true or false" )
+    end
+  end
+end
+
Index: asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/version.rb
===================================================================
--- asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/version.rb	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/asp3_dcre/tecsgen/tecslib/version.rb	(revision 374)
@@ -1,2 +1,2 @@
 $package = "tecsgen"
-$version = "1.5.0"
+$version = "1.6.4"
