Content deleted Content added
→Principle of syntax diagrams: square => rectangular |
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
||
Line 10:
We use arithmetic expressions as an example. First we provide a simplified BNF grammar:
<
<expression> ::= <term> | <term> "+" <expression>
<term> ::= <factor> | <factor> "*" <term>
Line 18:
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
</syntaxhighlight>
This grammar can also be expressed in EBNF:
<
expression = term , [ "+" , expression ];
term = factor , [ "*" , term ];
Line 29:
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
</syntaxhighlight>
One possible set of syntax diagrams for either of these grammars is:
|