Module: HDLRuby::Low::Hparent
- Included in:
- Behavior, Chunk, Code, Delay, Event, Expression, Scope, SignalI, Statement, SystemI, SystemT, Type, When
- Defined in:
- lib/HDLRuby/hruby_low.rb
Overview
Gives parent definition and access properties to an hardware object.
Instance Attribute Summary collapse
-
#parent ⇒ Object
The parent.
Instance Method Summary collapse
-
#hierarchy ⇒ Object
Get the full parents hierachy.
-
#no_parent! ⇒ Object
Clears the parent.
-
#scope ⇒ Object
Get the parent scope.
Instance Attribute Details
#parent ⇒ Object
The parent.
45 46 47 |
# File 'lib/HDLRuby/hruby_low.rb', line 45 def parent @parent end |
Instance Method Details
#hierarchy ⇒ Object
Get the full parents hierachy.
73 74 75 76 77 78 79 80 81 |
# File 'lib/HDLRuby/hruby_low.rb', line 73 def hierarchy res = [] cur = self while(cur) do res << cur cur = cur.parent end return res end |
#no_parent! ⇒ Object
Clears the parent.
61 62 63 |
# File 'lib/HDLRuby/hruby_low.rb', line 61 def no_parent! @parent = nil end |
#scope ⇒ Object
Get the parent scope.
66 67 68 69 70 |
# File 'lib/HDLRuby/hruby_low.rb', line 66 def scope cur = self.parent cur = cur.parent until cur.is_a?(Scope) return cur end |