<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>cfg/README.md - +/EE379K @ master</title>
<meta name="description" content="cfg/README.md in +/EE379K at master.">
<meta property="og:title" content="cfg/README.md - +/EE379K @ master">
<meta property="og:description" content="cfg/README.md in +/EE379K at master.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="master" data-tip="5a7dde36c42fbee781e1702d49c728080b21c956">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>+/EE379K</h1>
<p class="desc">programming paradigms</p>
</div>
<pre class="clone">git clone https://git.julia.blue/+/EE379K</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Joseph Ryan</span><span class="commit-message" data-commit="99be18a7030fa651a60d1598509090705094fa03">Tweak docs</span><span class="snapshot-sha sha" data-commit="99be18a7030fa651a60d1598509090705094fa03">99be18a</span><time datetime="2019-10-17T04:18:33-05:00" title="2019-10-17 04:18:33 -0500">2019-10-17</time></p>
<header class="topbar"><details class="switcher"><summary>master</summary><div class="menu"><strong>branches</strong><a class="current" href="/%2B/EE379K/ref/master/">master</a><a class="all" href="/%2B/EE379K/refs">all refs →</a></div></details><nav class="crumbs"><a href="/%2B/EE379K/">EE379K</a> / <a href="/%2B/EE379K/ref/master/tree/cfg/">cfg</a> / <span class="cur">README.md</span></nav>
<span class="view-stats"><span>1.2 KiB</span><span>12 lines</span></span><span class="actions"><a class="raw" href="/%2B/EE379K/raw/4b127e23f7d43894e362a60788220d5d73cbfe0a/cfg/README.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h2>Instructions</h2>
<p>Running <code>run_all.sh</code> will build CFGs for all of my test inputs. I hand inspected them to ensure correctness so there is no automated checker. The easiest way to check if a given CFG is correct is to look at the graph of basic blocks in a graphical form so I've included a command in the script to output <code>.png</code>s for each one for this purpose. For this to work the system must have the <code>dot</code> utility available (usually found in a <code>graphviz</code> package)</p>
<p>The script <code>run.sh</code> takes a single <code>.class</code> file as an argument and outputs the corresponding CFG in <code>${filename}.cfg</code>.</p>
<h2>Assumptions</h2>
<ul>
<li>Exception handling (try/catch/finally) isn't within the scope of this assignment as they require more semantic analysis to determine if a given sequence of instructions can throw or not.</li>
<li>Since creating non-primitives requires calling a function (the constructor), the code will only contain primitive data types.</li>
<li><code>return</code> instructions all jump to a single "final" basic block, even if they're the last instruction in the function</li>
<li>The IDs of the basic blocks produced don't need to be in any particular order (I use <code>0</code> for the final one and <code>1</code> for the starting block).</li>
</ul>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>##</a-p> <a-tt>Instructions</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">Running `run_all.sh` will build CFGs for all of my test inputs. I hand inspected them to ensure correctness so there is no automated checker. The easiest way to check if a given CFG is correct is to look at the graph of basic blocks in a graphical form so I&#39;ve included a command in the script to output `.png`s for each one for this purpose. For this to work the system must have the `dot` utility available (usually found in a `graphviz` package)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">The script `run.sh` takes a single `.class` file as an argument and outputs the corresponding CFG in `${filename}.cfg`.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"><a-p>##</a-p> <a-tt>Assumptions</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"><a-p>- </a-p>Exception handling (try/catch/finally) isn&#39;t within the scope of this assignment as they require more semantic analysis to determine if a given sequence of instructions can throw or not.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"><a-p>- </a-p>Since creating non-primitives requires calling a function (the constructor), the code will only contain primitive data types.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"><a-p>- </a-p>`return` instructions all jump to a single &quot;final&quot; basic block, even if they&#39;re the last instruction in the function</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"><a-p>- </a-p>The IDs of the basic blocks produced don&#39;t need to be in any particular order (I use `0` for the final one and `1` for the starting block).</span></span></pre></div></div>
</main>
</body>
</html>
