Skip to main content
Log in

A predictive bottom-up parser

  • Published:
Computing Aims and scope Submit manuscript

Abstract

Despite all advances in parsing, parser size, conflict resolution and error recovery are still of important consideration. In this research, we propose a predictive bottom-up parser. The parser is implemented in two versions. Both versions constitute an algorithm that simulates the run of a shift–reduce automaton, defined and constructed in a way that integrates its parsing actions with reduction prediction, conflict resolution and error recovery. However, the first implementation version performs explicit shift–reduce parsing actions based on implicit prediction of the reduction sequences. The second one performs parsing actions based on explicit prediction of the reduction sequences with implied shift–reduce actions. The proposed parser has been experimented against the ones based on similar approaches. 10–20% reduction of the parser size has been achieved, with a parsing behaviour proportional to a factor reflecting the grammar ambiguity.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Aho AV, Lam M, Sethi R, Ullman JD (2007) Compilers principles, techniques, &tools, 2nd edn. Addison Wesely, New York

    Google Scholar 

  2. Aycock J, Horspool N, Janousek J, Melichar B (2001) Even faster generalized LR parsing. Acta Inf 37: 633–651

    Article  MathSciNet  MATH  Google Scholar 

  3. Donnely C, Stallman R, Bison (2002) The YACC-compatible parser generator. The Free Software Foundation

  4. Farre J, Galvez FJ (2001) A bounded-connect Construction for LR-regular parsers. In: Wilhelm R (ed), CC’ 01. Lecture Notes in Computer Science, vol 2027, pp 244–258

  5. Galves JF, Schmitz S, Farree J (2006) Shift-resolve parsing: simple, unbounded lookahead, linear time. In: Lecture Notes in Computer Science, vol 4094, pp 253–264

  6. Johnstone A, Scott E (2007) Automatic recursion engineering of reduction incorporated parsers. Sci Comput Progr 68: 95–110

    Article  MathSciNet  MATH  Google Scholar 

  7. Lee G (2004) On the prediction of reduction goals: a deteministic approach. Comput Lang Syst Struct 31: 49–70

    Article  Google Scholar 

  8. Lee G, Choe K (1999) An LR parser with predetrmined reductions goals. Inf Process Lett 72: 189–196

    Article  MathSciNet  MATH  Google Scholar 

  9. Leung H, Wotschke D (2000) On The size of parsers and LR(k)-grammars. Theor Comput Sci 242: 59–69

    Article  MathSciNet  MATH  Google Scholar 

  10. Passos LT, Bigonha MAS, Bigonha S (2007) A methodology for removing LALR(K) conflicts. J Univers Comput Sci 13(6): 737–752

    Google Scholar 

  11. Schmitz S (2006) Noncanonical LALR(1) parsing. In: Lecture Notes on Computer Science, vol 4036. pp 95–107

  12. Scott E, Johnstone A (2005) Generalized bottom-up parsers with reduced stack activity. Comput J 48(5): 565–587

    Article  Google Scholar 

  13. Scott E, Johnstone A (2006) A right nulled GLR parsers. ACM Trans Program Lang Syst 28(4): 577–618

    Article  Google Scholar 

  14. Shankar P, Ganttati A, Yuvraj AR, Madhaven M (2000) A new algorithm for linear tree pattern Matching. Theor Comput Sci 242: 125–142

    Article  MATH  Google Scholar 

  15. Sippu S, Soisalon-Soininen E (1983) A syntax-error-handling technique and its experimental analysis. ACM Trans Program Lang Syst 5(4): 656–679

    Article  MATH  Google Scholar 

  16. Szymanski TG, Williams JH (1976) Noncanonical extension of bottom-up parsing techniques. SIAM J Comput 5(2): 231–250

    Article  MathSciNet  MATH  Google Scholar 

  17. Tomita M (1986) Efficient parsing for natural language. Kluwer Academic Publishers, Norwell

    Google Scholar 

  18. Vilares M, Darriba VM, Vilares J, Ribadas F (2004) A formal frame for robust parsing. Theor Comput Sci 328: 171–186

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Riad Jabri.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Jabri, R. A predictive bottom-up parser. Computing 92, 123–167 (2011). https://doi.org/10.1007/s00607-010-0134-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00607-010-0134-8

Keywords

Mathematics Subject Classification (2000)

Navigation