<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>lexparse/README.md - +/EE379K @ master</title>
<meta name="description" content="lexparse/README.md in +/EE379K at master.">
<meta property="og:title" content="lexparse/README.md - +/EE379K @ master">
<meta property="og:description" content="lexparse/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="8658c63e7f329a5f3c866d07a220431d260d70bf">Fix ambiguity bug and add docs</span><span class="snapshot-sha sha" data-commit="8658c63e7f329a5f3c866d07a220431d260d70bf">8658c63</span><time datetime="2019-09-14T19:36:04-05:00" title="2019-09-14 19:36:04 -0500">2019-09-14</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/lexparse/">lexparse</a> / <span class="cur">README.md</span></nav>
<span class="view-stats"><span>1.0 KiB</span><span>12 lines</span></span><span class="actions"><a class="raw" href="/%2B/EE379K/raw/ace270df5a03c77773ab50156af053efdc4a1bea/lexparse/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>Building instructions</h2>
<p>Running <code>./build.sh</code> will produce <code>lexparse.jar</code> which will accept code on STDIN.</p>
<h2>Assumptions</h2>
<ul>
<li>Enums, methods, classes, constants, and variables at the top level all share the same namespace.</li>
<li>The program name ("program <em>Foo</em> ...") is not in a shared namespace with anything else.</li>
<li>The unicode minus signs in the given example were meant to be ascii</li>
<li>The "constint" in the given example is meant to be "const int"</li>
<li><code>this</code> is handled specially in that it is not a keyword, but we don't have to verify that it's been defined before being used like other identifiers.</li>
<li>We don't have to write a type checker. For example if a class <code>Foo</code> has a method <code>bar()</code> that returns an object of type <code>Baz</code>, and the program contains a variable <code>x</code> of type <code>Foo</code>, we can't distinguish if <code>x.bar().quack()</code> is valid because we'd have to know the return type of <code>bar()</code> and look at the declared methods of <code>Baz</code>. In general this means that while we can resolve whether or not a name has been defined, we can't actually check their usages correctly.</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>Building 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 `./build.sh` will produce `lexparse.jar` which will accept code on STDIN.</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"><a-p>##</a-p> <a-tt>Assumptions</a-tt></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>Enums, methods, classes, constants, and variables at the top level all share the same namespace.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"><a-p>- </a-p>The program name (&quot;program *Foo* ...&quot;) is not in a shared namespace with anything else.</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>The unicode minus signs in the given example were meant to be ascii</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>The &quot;constint&quot; in the given example is meant to be &quot;const int&quot;</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>`this` is handled specially in that it is not a keyword, but we don&#39;t have to verify that it&#39;s been defined before being used like other identifiers.</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>We don&#39;t have to write a type checker. For example if a class `Foo` has a method `bar()` that returns an object of type `Baz`, and the program contains a variable `x` of type `Foo`, we can&#39;t distinguish if `x.bar().quack()` is valid because we&#39;d have to know the return type of `bar()` and look at the declared methods of `Baz`. In general this means that while we can resolve whether or not a name has been defined, we can&#39;t actually check their usages correctly.</span></span></pre></div></div>
</main>
</body>
</html>
