Content deleted Content added
m Reverted edits by 201.175.151.158 (talk) (HG) (3.4.10) |
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
||
Line 14:
The following [[Extended Backus–Naur Form|EBNF]]-like [[formal grammar|grammar]] (for [[Niklaus Wirth]]'s [[PL/0]] programming language, from ''[[Algorithms + Data Structures = Programs]]'') is in [[LL parser|LL(1)]] form:
<
program = block "." .
Line 41:
| number
| "(" expression ")" .
</syntaxhighlight>
[[terminal symbol|Terminals]] are expressed in quotes. Each [[nonterminal symbol|nonterminal]] is defined by a rule in the grammar, except for ''ident'' and ''number'', which are assumed to be implicitly defined.
Line 53:
The implementations of the functions ''nextsym'' and ''error'' are omitted for simplicity.
<
typedef enum {ident, number, lparen, rparen, times, slash, plus,
minus, eql, neq, lss, leq, gtr, geq, callsym, beginsym, semicolon,
Line 179:
expect(period);
}
</syntaxhighlight>
== Examples ==
|