Exception: VerilogTools::GenerateError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/HDLRuby/verilog_hruby.rb

Overview

The class describing generation errors.

Instance Method Summary collapse

Constructor Details

#initialize(msg, lpos, filename) ⇒ GenerateError

Create a new parse error with message +msg+, faulty line number +lpos+, and possibly file name +filename+.



163
164
165
166
167
168
# File 'lib/HDLRuby/verilog_hruby.rb', line 163

def initialize(msg,lpos,filename)
  @msg  = msg.to_s
  @lpos = lpos.to_i
  @filename = filename.to_s if filename
  super(self.make_message)
end

Instance Method Details

#make_messageObject

Generate the error message. NOTE: if you want to translate the error message, please redefine the function.



173
174
175
176
177
178
179
180
# File 'lib/HDLRuby/verilog_hruby.rb', line 173

def make_message
  if @filename then
    head = "Generation error for file '#{@filename}' "
  else
    head = "Generation error "
  end
  return head + "line #{@lpos}: " + @msg + "."
end