Sha256: c34cbe27c61106702d9da6f2a5804e4be572e4e19bb04e4af4a9c4ae6c861970

Contents?: true

Size: 1.96 KB

Versions: 5

Compression:

Stored size: 1.96 KB

Contents

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>new (VerilogParser)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre>    <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 12</span>
12:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aInput</span>
13:     <span class="ruby-identifier">input</span> = <span class="ruby-identifier">aInput</span>.<span class="ruby-identifier">dup</span>
14: 
15:     <span class="ruby-comment cmt"># strip comments</span>
16:       <span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{//.*$}</span>, <span class="ruby-value str">''</span>
17:       <span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{/\*.*?\*/}</span><span class="ruby-identifier">m</span>, <span class="ruby-value str">''</span>
18: 
19:     <span class="ruby-ivar">@modules</span> = <span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{(module.*?;)(.*?)endmodule}</span><span class="ruby-identifier">m</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">matches</span><span class="ruby-operator">|</span>
20:       <span class="ruby-constant">Module</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">matches</span>)
21:     <span class="ruby-keyword kw">end</span>
22:   <span class="ruby-keyword kw">end</span></pre>
</body>
</html>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby-vpi-18.0.0 ref/ruby/classes/VerilogParser.src/M000004.html
ruby-vpi-17.0.0 ref/ruby/classes/VerilogParser.src/M000004.html
ruby-vpi-18.0.2 ref/ruby/classes/VerilogParser.src/M000004.html
ruby-vpi-18.0.1 ref/ruby/classes/VerilogParser.src/M000004.html
ruby-vpi-19.0.0 ref/ruby/classes/VerilogParser.src/M000002.html