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 but is mostly avoided because of its high memory requirements in favor of less powerful but more efficient alternatives such as the LALR and the LL(1) parser.
Like most parsers, this parser is automatically generated by compiler compilers like GNU Bison and Menhir.
Read more about Canonical LR Parser: History, Overview, Constructing LR(1) Parsing Tables
Famous quotes containing the word canonical:
“If God bestowed immortality on every man then when he made him, and he made many to whom he never purposed to give his saving grace, what did his Lordship think that God gave any man immortality with purpose only to make him capable of immortal torments? It is a hard saying, and I think cannot piously be believed. I am sure it can never be proved by the canonical Scripture.”
—Thomas Hobbes (15791688)