THE METHOD.
a ( (V_{T} V_{N})^{ * }) a | (40) |
So match(a) moves the cursor lookahead one symbol forward iff lookahead points to a. Otherwise an error is produced.
In other words, given a nonterminal A the call proc chooses an A-production A such that lookahead belomgs to FIRST(). If such a production exists then for each symbol X in (reading from left to right)
FIRST() FIRST() = . | (41) |
S | cAd | |
A | ab | a |
type | simple | id | array[simple] of type | |
simple | integer | char | num dotdot num |
FIRST(simple) | = | { integer, char, num } |
FIRST(id) | = | { } |
FIRST(array[simple] of type) | = | { array } |
FIRST(integer) | = | { integer } |
FIRST(char) | = | { char } |
FIRST(num dotdot num) | = | { num } |