|
Slide 8.4: Logical inference rules Slide 8.6: Reduction rules for integer arithmetic expressions (cont.) Home |
|
E ::= E1 '+' E2 | E1 '–' E2 | E1 '*' E2 | '(' E1 ')' | N N ::= N1 D | D D ::= '0' | '1' | … | '9'Same as the denotational semantics, the symbols
< and > enclosing a nonterminal are removed.
For example,
<N> ::= <N> <D> | <D> → N ::= N D | D
Terminal symbols are enclosed by single quotes.
For the time being, we can ignore the storage, since this grammar does not include identifiers.
We use the following notation:
E, E1, and so on are used to denote expression that have not yet been reduced to values;
V, V1, and so on will stand for integer values;
E ⇒ E1 states that expression E reduces to expression E1 by some reduction rule.