Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

BRNGLR: a cubic Tomita-style GLR parsing algorithm

  • Original article
  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

Tomita-style generalised LR (GLR) algorithms extend the standard LR algorithm to non-deterministic grammars by performing all possible choices of action. Cubic complexity is achieved if all rules are of length at most two. In this paper we shall show how to achieve cubic time bounds for all grammars by binarising the search performed whilst executing reduce actions in a GLR-style parser. We call the resulting algorithm Binary Right Nulled GLR (BRNGLR) parsing. The binarisation process generates run-time behaviour that is related to that shown by a parser which pre-processes its grammar or parse table into a binary form, but without the increase in table size and with a reduced run-time space overhead. BRNGLR parsers have worst-case cubic run time on all grammars, linear behaviour on LR(1) grammars and produce, in worst-case cubic time, a cubic size binary SPPF representation of all the derivations of a given sentence.

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

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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. Aycock, J., Horspool, N.: Faster generalised LR parsing. In: Compiler Construction, 8th International Conference, CC’99, vol. 1575 of Lecture Notes in Computer Science, pp. 32–46. Springer, Heidelberg (1999)

  2. Aycock J., Nigel Horspool R., Janousek J., Melichar B. (2001). Even faster generalized LR parsing. Acta Informatica 37(8): 633–651

    Article  MATH  MathSciNet  Google Scholar 

  3. Aho A.V., Sethi R., Ullman J.D. (1986). Compilers: principles, techniques and tools. Addison-Wesley, Reading

    Google Scholar 

  4. Breuer P.T., Bowen J.P. (1995). A PREttier Compiler-Compiler: Generating higher-order parsers in C. Softw. Pract. Exp. 25(11): 1263–1297

    Article  Google Scholar 

  5. Billot, S., Lang, B.: The structure of shared forests in ambiguous parsing. In: Proceedings of the 27th conference on Association for Computational Linguistics, pp. 143–151. Association for Computational Linguistics (1989)

  6. Coppersmith D. (1997). Rectangular matrix multiplication revisited. J. Complex. 13: 42–49

    Article  MATH  MathSciNet  Google Scholar 

  7. Dodd, C., Maslov, V.: http://www.siber.com/btyacc. June (2002)

  8. Donnelly, C., Stallman, R.: Bison, the YACC compatible parser generator. Version 2.1 manual., September (2005)

  9. Earley J. (1970). An efficient context-free parsing algorithm. Commun. ACM 13(2): 94–102

    Article  MATH  Google Scholar 

  10. Eggert, P.: http://compilers.iecc.com/comparch/article/03-01-042 (2003)

  11. JAVACC home page http://www.metamata.com/JavaCC, 2000.

  12. Johnson, M.: The computational complexity of GLR parsing. In: Masaru, T. (ed.) Generalized LR parsing, pp. 35–42. Kluwer, The Netherlands (1991)

  13. Johnstone, A.: bool—a boolean function minimiser. Technical Report CSD–TR–93–25, Computer Science Department, Royal Holloway, University of London, London (1993)

  14. Johnstone, A., Scott, E.: rdp—an iterator based recursive descent parser generator with tree promotion operators. SIGPLAN notices, 33(9) (1998)

  15. Johnstone, A., Scott, E.: Generalised regular parsers. In: Gorel, H. (ed.) Compiler Construction, 12th International Conference CC’03, vol. 2622 of Lecture Notes in Computer Science, pp. 232–246. Springer, Berlin (2003)

  16. Johnstone, A., Scott, E.: RHUL compiler group home page. http://www.cs.rhul.ac.uk/research/languages/ (2006)

  17. Johnstone, A., Scott, E., Economopoulos, G.: Generalised parsing: some costs. In: Evelyn, D. (ed.) Compiler Construction, 13th International Conference CC’04, vol. 2985 of Lecture Notes in Computer Science, pp. 89–103. Springer, Berlin (2004)

  18. Johnstone A., Scott E., Economopoulos G. (2004). The grammar tool box: a case study comparing GLR parsing algorithms. Electron. Notes Theoret. Comput. Sci. 110: 97–133

    Article  Google Scholar 

  19. Johnstone, A., Scott, E., Economopoulos, G.: The GTB and PAT tools. In: Gorel, H., Eric Van, W. (eds.) Proceedings of the 4th Workshop on Language Descriptions, Tools and Applications LDTA2004. INRIA (2004)

  20. Kipps, J.R.: GLR parsing in time O(n 3). In: Masaru, T. (ed.) Generalized LR parsing, pp. 43–59. Kluwer, The Netherlands (1991)

  21. Kernighan, B.W., Ritchie, D.M.: The C Programming Language, second edition. Prentice-Hall, Englewood Cliffs (1988)

  22. Lang, B.: Deterministic techniques for efficient non-deterministic parsers. In: Automata, Lanugages and Programming: 2nd Colloquium, vol. 14 of Lecture Notes in Computer Science, pp. 255–269. Springer, Heidelberg (1974)

  23. Lee L. (2002). Fast context-free grammar parsing requires fast boolean matrix multiplication. J. ACM 49: 1–15

    Article  MathSciNet  Google Scholar 

  24. Lämmel R., Verhoef C. (2001). Semi-automatic Grammar Recovery. Softw. Pract. Exp. 31(15): 1395–1438

    Article  MATH  Google Scholar 

  25. McPeak, S., Necula, G.: Elkhound: a fast, practical GLR parser generator. In: Evelyn, D. (ed.) Compiler Construction, 13th International Conference CC’04, Lecture Notes in Computer Science. Springer, Berlin (2004)

  26. Nozohoor-Farshi, R.: GLR parsing for ε-grammars. In: Masaru, T. (ed.) Generalized LR Parsing, pp. 60–75. Kluwer, The Netherlands (1991)

  27. Parr, T.: ANTLR home page. http://www.antlr.org, Last visited: Dec (2004)

  28. Rekers, J.G.: Parser generation for interactive environments. PhD thesis, Universty of Amsterdam (1992)

  29. Scott E., Johnstone A. (2004). Reducing non-determinism in right nulled GLR parsers. Acta Informatica 40: 459–489

    Article  MATH  MathSciNet  Google Scholar 

  30. Scott, E., Johnstone, A.: Right nulled GLR parsers. ACM Trans. Program. Lang. Syst. pp. 1–43 (2006)

  31. Scott, E.A., Johnstone, A.I.C., Economopoulos, G.R.: BRN-table based GLR parsers. Technical Report TR-03-06, Computer Science Department, Royal Holloway, University of London, London (2003)

  32. Scott, E., Johnstone, A., Hussain, S.S.: Tomita-style generalised LR parsers. Updated Version. Technical Report TR-00-12, Computer Science Department, Royal Holloway, University of London, London, December (2000)

  33. Valiant L. (1975). General context-free recognition in less than cubic time. J. Comput. Syst. Sci. 10: 308–315

    MATH  MathSciNet  Google Scholar 

  34. van den Brand M.G.J., Heering J., Klint P., Olivier P.A. (2002). Compiling language definitions: the ASF+SDF compiler. ACM Trans. Program. Lang. Syst. 24(4): 334–368

    Article  Google Scholar 

  35. Visser, E.: Syntax definition for language prototyping. PhD thesis, Universty of Amsterdam (1997)

  36. Younger D.H. (1967). Recognition of context-free languages in time n 3. Inform. Control 10(2): 189–208

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Elizabeth Scott.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Scott, E., Johnstone, A. & Economopoulos, R. BRNGLR: a cubic Tomita-style GLR parsing algorithm. Acta Informatica 44, 427–461 (2007). https://doi.org/10.1007/s00236-007-0054-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-007-0054-z

Keywords