diff --git a/1993/vanb/README.md b/1993/vanb/README.md index 247fbd8c6..e604ae6e4 100644 --- a/1993/vanb/README.md +++ b/1993/vanb/README.md @@ -39,14 +39,12 @@ What happens if you use something other than valid digits? The octal expression may contain: -``` - unary operators: +, - - binary operators +, -, *, /, % - hex numbers: x or X followed by hex digits - decimal numbers: d or D followed by decimal digits - octal numbers: octal digits - grouping: () -``` +- unary operators: `+`, `-` +- binary operators: `+`, `-`, `*`, `/`, `%` +- hex numbers: `x` or `X` followed by hex digits +- decimal numbers: `d` or `D` followed by decimal digits +- octal numbers: octal digits +- grouping: `()` No spaces are allowed in the expression. To avoid shell expansion, one should surround the expression in single quotes. @@ -105,14 +103,29 @@ Here's the grammar (`'e'` denotes the empty string) : ``` ::= - ::= + | - | e + ::= + | + - | e ::= - ::= * | / | % | e - ::= + | - | ( | d | D | x | X | + ::= * | + / | + % | e + ::= + | + - | + ( | + d | + D | + x | + X | + ::= ) - ::= [0-9] | e - ::= [0-9] | [A-F] | [a-f] | e - ::= [0-7] | e + ::= [0-9] | + e + ::= [0-9] | + [A-F] | + [a-f] | + e + ::= [0-7] | + e ``` Here's how the grammar nonterminals map to octal state numbers: diff --git a/1993/vanb/index.html b/1993/vanb/index.html index e20f9c968..f4eceb4bb 100644 --- a/1993/vanb/index.html +++ b/1993/vanb/index.html @@ -416,12 +416,14 @@ hexadecimal and decimal numbers.

What happens if you use something other than valid digits?

Judges’ remarks:

The octal expression may contain:

-
    unary operators:    +, -
-    binary operators    +, -, *, /, %
-    hex numbers:        x or X followed by hex digits
-    decimal numbers:    d or D followed by decimal digits
-    octal numbers:      octal digits
-    grouping:           ()
+
    +
  • unary operators: +, -
  • +
  • binary operators: +, -, *, /, %
  • +
  • hex numbers: x or X followed by hex digits
  • +
  • decimal numbers: d or D followed by decimal digits
  • +
  • octal numbers: octal digits
  • +
  • grouping: ()
  • +

No spaces are allowed in the expression. To avoid shell expansion, one should surround the expression in single quotes.

It is a good thing that this program consists of only one @@ -457,14 +459,29 @@ what grammar non-terminal to parse. **O7 is the next character. involving **O7 and octal constants are looking for certain characters.

Here’s the grammar ('e' denotes the empty string) :

    <E>  ::=  <T><E'>
-    <E'> ::=  +<T><E'> | -<T><E'> | e
+    <E'> ::=  +<T><E'> |
+              -<T><E'> | e
     <T>  ::=  <F><T'>
-    <T'> ::=  *<F><T'> | /<F><T'> | %<F><T'> | e
-    <F>  ::=  +<F> | -<F> | (<E><C> | d<D> | D<D> |  x<X> | X<X> | <O>
+    <T'> ::=  *<F><T'> |
+              /<F><T'> |
+              %<F><T'> | e
+    <F>  ::=  +<F> |
+              -<F> |
+              (<E><C> |
+              d<D> |
+              D<D> |
+              x<X> |
+              X<X> |
+              <O>
     <C>  ::=  )
-    <D>  ::=  [0-9]<D> | e
-    <X>  ::=  [0-9]<X> | [A-F]<X> | [a-f]<X> | e
-    <O>  ::=  [0-7]<O> | e
+ <D> ::= [0-9]<D> | + 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:

    <E>  is  012
     <E'> is  011