In
computer science, a
canonical LR parser or
LR(1) parser is an
LR(k) parser for
k=1, i.e. with a single lookahead
terminal. The special attribute of this parser is that all LR(k) parsers with
k>1 can be transformed into a LR(1) parser. It can handle all
deterministic context-free languages. In the past this LR(k) parser has been avoided because of its huge memory requirements in favor of less powerful alternatives such as the
LALR and the
LL(1) parser. Recently, however, a "minimal LR(1) parser" whose space requirements are close to
LALR parsers, is being offered by several parser generators.