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+.



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

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.



184
185
186
187
188
189
190
191
# File 'lib/HDLRuby/verilog_hruby.rb', line 184

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