res = Node("A")
switch (curToken) :
for \alpha_1, \alpha_2 .. \alpha_k case : <tex>FIRST(\alpha_1) \cup ((\varepsilon \in FIRST(\alpha_1)) ? FOLLOW(A) : \varnothing)</tex> : // \alpha_1 = X_1x_2x_1x_2..x_{t_1} // X_1 for x_1 .. x_{{---t_1}} нетерминал if x_1 is terminal consume(x_1) res.addChild(new Node("x_1") nextToken() else Node t = X_1() res.addChild(t) // x_2 {{---}} терминал break consume case <tex>FIRST(x_2\alpha_2) res.addChild\cup ((new Node\varepsilon \in FIRST("x_2"\alpha_2)) nextToken ? FOLLOW(A) : \varnothing)<// x_3 tex> : ... break; ...
default :
error("unexpected char")