Class: OrigenTesters::Decompiler::Pattern::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/decompiler/pattern/elements/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node:, context:, **options) ⇒ Base

Returns a new instance of Base.



11
12
13
14
# File 'lib/origen_testers/decompiler/pattern/elements/base.rb', line 11

def initialize(node:, context:, **options)
  @context = context
  @node = node
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/origen_testers/decompiler/pattern/elements/base.rb', line 24

def method_missing(m, *args, &block)
  if platform_nodes.include?(m) || node.respond_to?(m)
    node.send(m)
  else
    super
  end
end

Instance Attribute Details

#contextObject (readonly) Also known as: decompiled_pattern

Returns the value of attribute context.



5
6
7
# File 'lib/origen_testers/decompiler/pattern/elements/base.rb', line 5

def context
  @context
end

#nodeObject (readonly) Also known as: processor

Returns the value of attribute node.



8
9
10
# File 'lib/origen_testers/decompiler/pattern/elements/base.rb', line 8

def node
  @node
end

Instance Method Details

#[](node) ⇒ Object



16
17
18
# File 'lib/origen_testers/decompiler/pattern/elements/base.rb', line 16

def [](node)
  node.find(node)
end

#execute!Object



32
33
34
35
36
# File 'lib/origen_testers/decompiler/pattern/elements/base.rb', line 32

def execute!
  if node.execute?
    node.execute!(self)
  end
end

#pinlistObject



38
39
40
# File 'lib/origen_testers/decompiler/pattern/elements/base.rb', line 38

def pinlist
  decompiled_pattern.pinlist.pinlist
end

#platform_nodesObject



20
21
22
# File 'lib/origen_testers/decompiler/pattern/elements/base.rb', line 20

def platform_nodes
  node.platform_nodes
end