Global Information Lookup Global Information

Canonical LR parser information


A canonical LR parser (also called a LR(1) parser) is a type of bottom-up parsing algorithm used in computer science to analyze and process programming languages. It is based on the LR parsing technique, which stands for "left-to-right, rightmost derivation in reverse."

Formally, a canonical LR parser is an LR(k) parser for k=1, i.e. with a single lookahead terminal. The special attribute of this parser is that any LR(k) grammar with k>1 can be transformed into an LR(1) grammar.[1] However, back-substitutions are required to reduce k and as back-substitutions increase, the grammar can quickly become large, repetitive and hard to understand. LR(k) can handle all deterministic context-free languages.[1] 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[citation needed], is being offered by several parser generators.

Like most parsers, the LR(1) parser is automatically generated by compiler-compilers like GNU Bison, MSTA, Menhir,[2] HYACC,[3] and LRSTAR.[4]

  1. ^ a b Knuth, D. E. (July 1965). "On the translation of languages from left to right". Information and Control. 8 (6): 607–639. doi:10.1016/S0019-9958(65)90426-2.
  2. ^ "What is Menhir?". INRIA, CRISTAL project. Retrieved 29 June 2012.
  3. ^ "HYACC, minimal LR(1) parser generator".
  4. ^ "LRSTAR parser generator".

and 13 Related for: Canonical LR parser information

Request time (Page generated in 0.823 seconds.)

Canonical LR parser

Last Update:

A canonical LR parser (also called a LR(1) parser) is a type of bottom-up parsing algorithm used in computer science to analyze and process programming...

Word Count : 2253

LR parser

Last Update:

parsers: SLR parsers, LALR parsers, canonical LR(1) parsers, minimal LR(1) parsers, and generalized LR parsers (GLR parsers). LR parsers can be generated...

Word Count : 8128

LALR parser

Last Update:

grammar for a computer language. An LALR parser is a simplified version of a canonical LR parser. The LALR parser was invented by Frank DeRemer in his 1969...

Word Count : 1483

Simple LR parser

Last Update:

The parser is mechanically generated from a formal grammar for the language. SLR and the more-general methods LALR parser and Canonical LR parser have...

Word Count : 825

LALR parser generator

Last Update:

lookahead LR parser (LALR) generator is a software tool that reads a context-free grammar (CFG) and creates an LALR parser which is capable of parsing files...

Word Count : 789

Parsing

Last Update:

Variants: Canonical LR parser LALR (look-ahead LR) parser Operator-precedence parser SLR (Simple LR) parser Simple precedence parser Packrat parser: a linear...

Word Count : 4857

History of compiler construction

Last Update:

LR parser is a parser that reads input from Left to right (as it would appear if visually displayed) and produces a Rightmost derivation. The term LR(k)...

Word Count : 6356

List of algorithms

Last Update:

Variants: Canonical LR parser LALR (look-ahead LR) parser Operator-precedence parser SLR (Simple LR) parser Simple precedence parser Packrat parser: a linear...

Word Count : 7843

Goto

Last Update:

particularly in automatically generated C code. For example, goto in the canonical LR parser. Implementing multi-level break and continue if not directly supported...

Word Count : 5906

GNU Bison

Last Update:

generated parsers are portable: they do not require any specific compilers. Bison by default generates LALR(1) parsers but it can also generate canonical LR, IELR(1)...

Word Count : 2306

Index of computing articles

Last Update:

Burrows-Abadi-Needham logic – Business computing C++ – C# – C – Cache – Canonical LR parser – Cat (Unix) – CD-ROM – Central processing unit – Chimera – Chomsky...

Word Count : 1383

Formal grammar

Last Update:

grammar into a working parser. Strictly speaking, a generative grammar does not in any way correspond to the algorithm used to parse a language, and various...

Word Count : 3431

Tagged Deterministic Finite Automaton

Last Update:

regular languages, TDFA is also capable of submatch extraction and parsing. While canonical DFA can find out if a string belongs to the language defined by...

Word Count : 4605

PDF Search Engine © AllGlobal.net