Class: Rhdl::Variable

Inherits:
Expression show all
Defined in:
lib/rhdl/variable.rb

Instance Method Summary collapse

Methods inherited from Expression

#!, #&

Constructor Details

#initialize(name, owner) ⇒ Variable

Returns a new instance of Variable.



3
4
5
6
# File 'lib/rhdl/variable.rb', line 3

def initialize(name, owner)
  @name = name.to_s
  @owner = owner
end

Instance Method Details

#<=(rhs) ⇒ Object



8
9
10
11
# File 'lib/rhdl/variable.rb', line 8

def <=(rhs)
  @owner.add_assign_statement(@name, rhs)
  nil
end

#fanout(check_context, statement) ⇒ Object



25
26
27
# File 'lib/rhdl/variable.rb', line 25

def fanout(check_context, statement)
  check_context.notify_fanout(@name, statement)
end

#generateObject



17
18
19
# File 'lib/rhdl/variable.rb', line 17

def generate
  "#{@name}"
end

#get_output_type(check_context) ⇒ Object



21
22
23
# File 'lib/rhdl/variable.rb', line 21

def get_output_type(check_context)
  check_context.get_var_type(@name)
end

#varnamesObject



13
14
15
# File 'lib/rhdl/variable.rb', line 13

def varnames
  [@name]
end