Class: BDNode

Inherits:
Node show all
Defined in:
lib/tecsgen/core/syntaxobj.rb

Overview

双方向 Node (Bi Direction Node)

Node の子クラス owner Node から参照されているもの (owner へのリンクも取り出せる)

get_owner で得られるもの FuncHead => Signature Decl => Namespace(const), Typedef(typedef), Celltype, CompositeCelltype(attr,var) Struct(member), ParamDecl(parameter), FuncHead(funchead) Signature, Celltype, CompositeCelltype, Typedef => Namespace , Namespace => Namespace, Generator.class (root Namespace の場合) Cell => Region, CompositeCelltype(in_composite) Port => Celltype, Composite Factory => Celltype Join => Cell CompositeCelltypeJoin => CompositeCelltype Region => Region, ParamDecl => ParamList ParamList => FuncHead Expression => Namespace 大半のものは new_* メソッドで owner Node に伝達される そのメソッドが呼び出されたときに owner Node が記録される new_* がないもの: Decl(parameter), ParamDecl, ParamList, FuncHead, Expression

Expression は、owner Node となるものが多くあるが、改造が困難であるため
Expression が定義されたときの Namespace  owner Node とする
StructType  Type の一種なので owner を持たない

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initializeBDNode

@import::Import :



145
146
147
148
149
150
# File 'lib/tecsgen/core/syntaxobj.rb', line 145

def initialize
  super
  @owner = nil
  @NamespacePath = nil
  @import = Import.get_current
end

Instance Method Details

#get_ownerObject

owner を得る

class の説明を参照



160
161
162
163
164
165
# File 'lib/tecsgen/core/syntaxobj.rb', line 160

def get_owner
  if @owner.nil?
    raise "Node have no owner #{self.class.name} #{get_name}"
  end
  @owner
end

#set_owner(owner) ⇒ Object

owner を設定する



153
154
155
156
# File 'lib/tecsgen/core/syntaxobj.rb', line 153

def set_owner(owner)
  dbgPrint "set_owner: #{owner.class.name}\n"
  @owner = owner
end