Format improvements in 1993/vanb/index.html

The list of expressions in the judges' remarks has been changed so that
it fits nicer on smaller screens (it is no longer a code block but a
list and each operator is surrounded by backticks).

The grammar provided by the author (not the code that explains it but
the grammar) now also fits on smaller screens in a nicer way by breaking
it into multiple lines.
This commit is contained in:
Cody Boone Ferguson committed 2024-06-24 13:22:42 -07:00
1 parent 836d5308f4
commit 850e5b4181
2 files changed
+56 -26

No files matched your search

+27 -14
View File
@@ -39,14 +39,12 @@ What happens if you use something other than valid digits?
The octal expression may contain: The octal expression may contain:
``` - unary operators: `+`, `-`
unary operators: +, - - binary operators: `+`, `-`, `*`, `/`, `%`
binary operators +, -, *, /, % - hex numbers: `x` or `X` followed by hex digits
hex numbers: x or X followed by hex digits - decimal numbers: `d` or `D` followed by decimal digits
decimal numbers: d or D followed by decimal digits - octal numbers: octal digits
octal numbers: octal digits - grouping: `()`
grouping: ()
```
No spaces are allowed in the expression. To avoid shell expansion, No spaces are allowed in the expression. To avoid shell expansion,
one should surround the expression in single quotes. one should surround the expression in single quotes.
@@ -105,14 +103,29 @@ Here's the grammar (`'e'` denotes the empty string) :
``` ```
<E> ::= <T><E'> <E> ::= <T><E'>
<E'> ::= +<T><E'> | -<T><E'> | e <E'> ::= +<T><E'> |
-<T><E'> | e
<T> ::= <F><T'> <T> ::= <F><T'>
<T'> ::= *<F><T'> | /<F><T'> | %<F><T'> | e <T'> ::= *<F><T'> |
<F> ::= +<F> | -<F> | (<E><C> | d<D> | D<D> | x<X> | X<X> | <O> /<F><T'> |
%<F><T'> | e
<F> ::= +<F> |
-<F> |
(<E><C> |
d<D> |
D<D> |
x<X> |
X<X> |
<O>
<C> ::= ) <C> ::= )
<D> ::= [0-9]<D> | e <D> ::= [0-9]<D> |
<X> ::= [0-9]<X> | [A-F]<X> | [a-f]<X> | e e
<O> ::= [0-7]<O> | e <X> ::= [0-9]<X> |
[A-F]<X> |
[a-f]<X> |
e
<O> ::= [0-7]<O> |
e
``` ```
Here's how the grammar nonterminals map to octal state numbers: Here's how the grammar nonterminals map to octal state numbers:
+29 -12
View File
@@ -416,12 +416,14 @@ hexadecimal and decimal numbers.</p>
<p>What happens if you use something other than valid digits?</p> <p>What happens if you use something other than valid digits?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2> <h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The octal expression may contain:</p> <p>The octal expression may contain:</p>
<pre><code> unary operators: +, - <ul>
binary operators +, -, *, /, % <li>unary operators: <code>+</code>, <code>-</code></li>
hex numbers: x or X followed by hex digits <li>binary operators: <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, <code>%</code></li>
decimal numbers: d or D followed by decimal digits <li>hex numbers: <code>x</code> or <code>X</code> followed by hex digits</li>
octal numbers: octal digits <li>decimal numbers: <code>d</code> or <code>D</code> followed by decimal digits</li>
grouping: ()</code></pre> <li>octal numbers: octal digits</li>
<li>grouping: <code>()</code></li>
</ul>
<p>No spaces are allowed in the expression. To avoid shell expansion, <p>No spaces are allowed in the expression. To avoid shell expansion,
one should surround the expression in single quotes.</p> one should surround the expression in single quotes.</p>
<p>It is a good thing that this program consists of only one <p>It is a good thing that this program consists of only one
@@ -457,14 +459,29 @@ what grammar non-terminal to parse. <code>**O7</code> is the next character.
involving <code>**O7</code> and octal constants are looking for certain characters.</p> involving <code>**O7</code> and octal constants are looking for certain characters.</p>
<p>Here’s the grammar (<code>'e'</code> denotes the empty string) :</p> <p>Here’s the grammar (<code>'e'</code> denotes the empty string) :</p>
<pre><code> &lt;E&gt; ::= &lt;T&gt;&lt;E&#39;&gt; <pre><code> &lt;E&gt; ::= &lt;T&gt;&lt;E&#39;&gt;
&lt;E&#39;&gt; ::= +&lt;T&gt;&lt;E&#39;&gt; | -&lt;T&gt;&lt;E&#39;&gt; | e &lt;E&#39;&gt; ::= +&lt;T&gt;&lt;E&#39;&gt; |
-&lt;T&gt;&lt;E&#39;&gt; | e
&lt;T&gt; ::= &lt;F&gt;&lt;T&#39;&gt; &lt;T&gt; ::= &lt;F&gt;&lt;T&#39;&gt;
&lt;T&#39;&gt; ::= *&lt;F&gt;&lt;T&#39;&gt; | /&lt;F&gt;&lt;T&#39;&gt; | %&lt;F&gt;&lt;T&#39;&gt; | e &lt;T&#39;&gt; ::= *&lt;F&gt;&lt;T&#39;&gt; |
&lt;F&gt; ::= +&lt;F&gt; | -&lt;F&gt; | (&lt;E&gt;&lt;C&gt; | d&lt;D&gt; | D&lt;D&gt; | x&lt;X&gt; | X&lt;X&gt; | &lt;O&gt; /&lt;F&gt;&lt;T&#39;&gt; |
%&lt;F&gt;&lt;T&#39;&gt; | e
&lt;F&gt; ::= +&lt;F&gt; |
-&lt;F&gt; |
(&lt;E&gt;&lt;C&gt; |
d&lt;D&gt; |
D&lt;D&gt; |
x&lt;X&gt; |
X&lt;X&gt; |
&lt;O&gt;
&lt;C&gt; ::= ) &lt;C&gt; ::= )
&lt;D&gt; ::= [0-9]&lt;D&gt; | e &lt;D&gt; ::= [0-9]&lt;D&gt; |
&lt;X&gt; ::= [0-9]&lt;X&gt; | [A-F]&lt;X&gt; | [a-f]&lt;X&gt; | e e
&lt;O&gt; ::= [0-7]&lt;O&gt; | e</code></pre> &lt;X&gt; ::= [0-9]&lt;X&gt; |
[A-F]&lt;X&gt; |
[a-f]&lt;X&gt; |
e
&lt;O&gt; ::= [0-7]&lt;O&gt; |
e</code></pre>
<p>Here’s how the grammar nonterminals map to octal state numbers:</p> <p>Here’s how the grammar nonterminals map to octal state numbers:</p>
<pre><code> &lt;E&gt; is 012 <pre><code> &lt;E&gt; is 012
&lt;E&#39;&gt; is 011 &lt;E&#39;&gt; is 011