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.
Similar content being viewed by others
References
Aho AV, Lam M, Sethi R, Ullman JD (2007) Compilers principles, techniques, &tools, 2nd edn. Addison Wesely, New York
Aycock J, Horspool N, Janousek J, Melichar B (2001) Even faster generalized LR parsing. Acta Inf 37: 633–651
Donnely C, Stallman R, Bison (2002) The YACC-compatible parser generator. The Free Software Foundation
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
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
Johnstone A, Scott E (2007) Automatic recursion engineering of reduction incorporated parsers. Sci Comput Progr 68: 95–110
Lee G (2004) On the prediction of reduction goals: a deteministic approach. Comput Lang Syst Struct 31: 49–70
Lee G, Choe K (1999) An LR parser with predetrmined reductions goals. Inf Process Lett 72: 189–196
Leung H, Wotschke D (2000) On The size of parsers and LR(k)-grammars. Theor Comput Sci 242: 59–69
Passos LT, Bigonha MAS, Bigonha S (2007) A methodology for removing LALR(K) conflicts. J Univers Comput Sci 13(6): 737–752
Schmitz S (2006) Noncanonical LALR(1) parsing. In: Lecture Notes on Computer Science, vol 4036. pp 95–107
Scott E, Johnstone A (2005) Generalized bottom-up parsers with reduced stack activity. Comput J 48(5): 565–587
Scott E, Johnstone A (2006) A right nulled GLR parsers. ACM Trans Program Lang Syst 28(4): 577–618
Shankar P, Ganttati A, Yuvraj AR, Madhaven M (2000) A new algorithm for linear tree pattern Matching. Theor Comput Sci 242: 125–142
Sippu S, Soisalon-Soininen E (1983) A syntax-error-handling technique and its experimental analysis. ACM Trans Program Lang Syst 5(4): 656–679
Szymanski TG, Williams JH (1976) Noncanonical extension of bottom-up parsing techniques. SIAM J Comput 5(2): 231–250
Tomita M (1986) Efficient parsing for natural language. Kluwer Academic Publishers, Norwell
Vilares M, Darriba VM, Vilares J, Ribadas F (2004) A formal frame for robust parsing. Theor Comput Sci 328: 171–186
Author information
Authors and Affiliations
Corresponding author
Rights 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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00607-010-0134-8