-
Notifications
You must be signed in to change notification settings - Fork 0
/
tinyPascal.bnf
20 lines (20 loc) · 935 Bytes
/
tinyPascal.bnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<program> ::= <program-header> <block> '.'
<program-header> ::= PROGRAM <ident>
<block> ::= <declarations> <statements>
<declarations> ::= ( <label list> |
<constant list> |
<type list> |
<variable list> |
<procedure> |
<function> )*
<statements> ::= <compound statement>
<compound statement> ::= BEGIN <statement> (';' <statement>)* END
<statement> ::= <simple statement> | <structured statement>
<simple statement> ::= <assignment> | <procedure call> | null
<structured statement> ::= <compound statement> |
<if statement> |
<case statement> |
<while statement> |
<repeat statement> |
<for statement> |
<with statement>