LL (1) grammar for hovering yet

In compiler building, one of the main problems of ambiguity is dangling else . As mentioned in compiler collections: “Principles, Methods, and Tools” by Aho, Lama, Network, and Ulman, the grammar for hovering cannot be used with LL parsers (1).

Is it true that it cannot be treated as LL (1)?

+3
source share
1 answer

Verily, it cannot be analyzed by LL (k) or LALR (k) in their pure forms. The problem is that there are two possible interpretations of else; its ambiguity problem (“else” refers to the closest “if” or does not belong).

, , , "else , ".

" "; LL , , , " ". LR - "shift on else", , "" "" .

, , GLR. , , " ".

+4

All Articles