Class: VHDL_Parser::Package

Inherits:
Object
  • Object
show all
Defined in:
lib/vhdl_parser/package.rb

Overview

Represents a VHDL Package

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePackage

Returns a new instance of Package.



9
10
11
# File 'lib/vhdl_parser/package.rb', line 9

def initialize
  @constants = Hash.new
end

Instance Attribute Details

#constantsHash

A Hash of all the constants defined in this Package.

Returns:

  • (Hash)


7
8
9
# File 'lib/vhdl_parser/package.rb', line 7

def constants
  @constants
end

Instance Method Details

#processnil

Processes the constants defined in the package. This resolves constants being dependent on other constants in this package.

Returns:

  • (nil)

    Nothing



21
22
23
24
25
26
27
# File 'lib/vhdl_parser/package.rb', line 21

def process
  @constants.each do |k,v|
    @constants.each do |k2,v2|
      @constants[k2] = Utility.sub_constants(v2, k, v)
    end
  end
end

#to_sString

Returns:



14
15
16
# File 'lib/vhdl_parser/package.rb', line 14

def to_s
  @constants.to_s
end