Module: TECSInfo

Defined in:
lib/tecsgen/core/tecsinfo.rb

Overview

TECS 情報セルの生成

Class Method Summary collapse

Class Method Details

region は Link root のこと

[View source]

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/tecsgen/core/tecsinfo.rb', line 42

def self.print_info(f, region)
  # p "region: "+ region.get_name.to_s
  nest = region.gen_region_str_pre f
  indent0 = "    " * nest
  indent = "    " * (nest + 1)
  f.print <<EOT
#{indent0}region rTECSInfo {
EOT
  Type.reset_print_info

  # mikan 全部生成するのではなく、region 下のセルのセルタイプと、そこから参照されるシグニチャ、セルタイプに限定して出力すべき
  # しかし、意味解析後に出力するため、これは容易ではない.最適化とコード生成は、リンクルートごとに行われる.
  Namespace.print_info f, indent
  region.get_link_root.print_info f, indent

  f.print "\n#{indent}/*** TYPE information cell ***/\n"
  Type.print_info_post f, indent

  f.print "\n#{indent}/*** TECS information cell ***/\n"
  f.print <<EOT
#{indent}cell nTECSInfo::tTECSInfoSub TECSInfoSub {
#{indent}    cNamespaceInfo = _RootNamespaceInfo.eNamespaceInfo;
#{indent}    cRegionInfo    = _LinkRootRegionInfo.eRegionInfo;
#{indent}} /* TECSInfoSub */;
#{indent0}}; /* rTECSInfo */
EOT
  region.gen_region_str_post f
end