Skip to content

Commit

Permalink
update page
Browse files Browse the repository at this point in the history
  • Loading branch information
nadia-polikarpova committed May 24, 2024
1 parent 7770421 commit 24315bb
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 38 deletions.
11 changes: 8 additions & 3 deletions docs/lectures/06-parsing.html
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ <h2 id="exercise">EXERCISE</h2>
<li>cannot be empty</li>
</ul>
<p><br></p>
<p><em>Answer:</em> <code class="sourceCode haskell">[a<span class="op">-</span>z <span class="dt">A</span><span class="op">-</span><span class="dt">Z</span>] [a<span class="op">-</span>z <span class="dt">A</span><span class="op">-</span><span class="dt">Z</span> <span class="dv">0</span><span class="op">-</span><span class="dv">9</span>]<span class="op">*</span></code></p>
<!--
## QUIZ
Expand Down Expand Up @@ -542,6 +543,7 @@ <h2 id="quiz">QUIZ</h2>
<p><strong>(C)</strong> <code class="sourceCode haskell">[<span class="dt">ID</span> <span class="st">&quot;x+&quot;</span>]</code></p>
<p><strong>(D)</strong> <code class="sourceCode haskell">[<span class="dt">ID</span> <span class="st">&quot;x&quot;</span>, <span class="dt">PLUS</span>]</code></p>
<p><br></p>
<p><em>Answer:</em> D</p>
<p><br>
<br>
<br>
Expand Down Expand Up @@ -647,6 +649,7 @@ <h2 id="quiz-1">QUIZ</h2>
<p><strong>(D)</strong> <code class="sourceCode haskell">x <span class="op">+</span> <span class="dv">5</span> <span class="op">+</span> <span class="dv">1</span></code></p>
<p><strong>(E)</strong> B and C</p>
<p><br></p>
<p><em>Answer:</em> E</p>
<p><br>
<br>
<br>
Expand Down Expand Up @@ -750,6 +753,7 @@ <h2 id="quiz-2">QUIZ</h2>
<p><strong>(C)</strong> <code class="sourceCode haskell"><span class="dt">APlus</span> (<span class="dt">APlus</span> (<span class="dt">AConst</span> <span class="dv">1</span>) (<span class="dt">AConst</span> <span class="dv">2</span>)) (<span class="dt">AConst</span> <span class="dv">3</span>)</code></p>
<p><strong>(D)</strong> <code class="sourceCode haskell"><span class="dt">APlus</span> (<span class="dt">AConst</span> <span class="dv">1</span>) (<span class="dt">APlus</span> (<span class="dt">AConst</span> <span class="dv">2</span>) (<span class="dt">AConst</span> <span class="dv">3</span>))</code></p>
<p><br></p>
<p><em>Answer:</em> Could be C or D</p>
<p><br>
<br>
<br>
Expand All @@ -771,13 +775,13 @@ <h2 id="running-the-parser">Running the Parser</h2>
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a><span class="dv">10</span></span>
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true" tabindex="-1"></a>λ<span class="op">&gt;</span> evalString [(<span class="st">&quot;x&quot;</span>, <span class="dv">100</span>), (<span class="st">&quot;y&quot;</span>, <span class="dv">20</span>)] <span class="st">&quot;x - y&quot;</span></span>
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true" tabindex="-1"></a><span class="op">???</span></span>
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true" tabindex="-1"></a><span class="dv">80</span></span>
<span id="cb26-6"><a href="#cb26-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb26-7"><a href="#cb26-7" aria-hidden="true" tabindex="-1"></a>λ<span class="op">&gt;</span> evalString [] <span class="st">&quot;2 * 5 + 5&quot;</span></span>
<span id="cb26-8"><a href="#cb26-8" aria-hidden="true" tabindex="-1"></a><span class="op">???</span></span>
<span id="cb26-8"><a href="#cb26-8" aria-hidden="true" tabindex="-1"></a><span class="dv">20</span></span>
<span id="cb26-9"><a href="#cb26-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb26-10"><a href="#cb26-10" aria-hidden="true" tabindex="-1"></a>λ<span class="op">&gt;</span> evalString [] <span class="st">&quot;2 - 1 - 1&quot;</span></span>
<span id="cb26-11"><a href="#cb26-11" aria-hidden="true" tabindex="-1"></a><span class="op">???</span></span></code></pre></div>
<span id="cb26-11"><a href="#cb26-11" aria-hidden="true" tabindex="-1"></a><span class="dv">2</span></span></code></pre></div>
<p><br>
<br>
<br>
Expand Down Expand Up @@ -892,6 +896,7 @@ <h2 id="quiz-3">QUIZ</h2>
<p><strong>(A)</strong> Yes</p>
<p><strong>(B)</strong> No</p>
<p><br></p>
<p><em>Answer:</em> A</p>
<p><br>
<br>
<br>
Expand Down
Loading

0 comments on commit 24315bb

Please sign in to comment.