Bottom-Up Parser: Look-Ahead LR Parser
Pooja Rani, Department of Computer Science at HP University, Shimla, India.
Manuscript received on 5 August 2019. | Revised Manuscript received on 11 August 2019. | Manuscript published on 30 September 2019. | PP: 2406-2410 | Volume-8 Issue-3 September 2019 | Retrieval Number: C4666098319/2019©BEIESP | DOI: 10.35940/ijrte.C4666.098319
Open Access | Ethics and Policies | Cite | Mendeley | Indexing and Abstracting
© The Authors. Blue Eyes Intelligence Engineering and Sciences Publication (BEIESP). This is an open access article under the CC-BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Abstract: Compiler is used for the purpose of converting high level code to machine code. For doing this procedure we have six steps. On these steps the syntax analyses is the second step of compiler. The lexical analyzer produce token in the output. The tokens are used as input to syntax analyzer. Syntax analyzer performs parsing operation. The parsing can be used for deriving the string from the given grammar called as derivation. It depend upon how derivation will be performed either top down or bottom up. The bottom up parsers LR (Left-to-right), SLR (simple LR) has some conflicts. To remove these conflicts we use LALR (Look ahead LR parser). The conflicts are available if the state contains minimum two or more productions. If there is one shift operation in state and other one is reduce operation it means that shift-reduce operation at the same time. Then this state is called as inadequate state. This Inadequate state problem is solved in LALR parser. Other problem with other parsers is that they have more states as compared to LALR parser. So cost will be high. But in LALR parser minimum states used and cost will automatically be reduced. LALR is also called as Minimization algorithm of CLR (Canonical LR parser).
Keyword: Lexical Analyzer, Syntax Analyzer, Shift, Reduce, Look Ahead Parser.
Scope of the Article: Computer Science and Its Applications