Disambiguation Filters for Scannerless Generalized LR Parsers

  • Mark G. J. van den Brand
  • Jeroen Scheerder
  • Jurgen J. Vinju
  • Eelco Visser
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2304)

Abstract

In this paper we present the fusion of generalized LR parsing and scannerless parsing. This combination supports syntax definitions in which all aspects (lexical and context-free) of the syntax of a language are defined explicitly in one formalism. Furthermore, there are no restrictions on the class of grammars, thus allowing a natural syntax tree structure. Ambiguities that arise through the use of unrestricted grammars are handled by explicit disambiguation constructs, instead of implicit defaults that are taken by traditional scanner and parser generators. Hence, a syntax definition becomes a full declarative description of a language. Scannerless generalized LR parsing is a viable technique that has been applied in various industrial and academic projects.

References

  1. 1.
    A. V. Aho, R. Sethi, and J. D. Ullman. Compilers. Principles, Techniques and Tools. Addison-Wesley, 1986.Google Scholar
  2. 2.
    J. Aycock and R. N. Horspool. Faster generalized LR parsing. In S. Jähnichen, editor, CC’99, volume 1575 of LNCS, pages 32–46. Springer-Verlag, 1999.Google Scholar
  3. 3.
    J. Aycock and R. N. Horspool. Schrödinger’s token. Software, Practice & Experience, 31:803–814, 2001.MATHCrossRefGoogle Scholar
  4. 4.
    M. G. J. van den Brand, A. van Deursen, J. Heering, H. A. de Jong, M. de Jonge, T. Kuipers, P. Klint, L. Moonen, P. A. Olivier, J. Scheerder, J. J. Vinju, E. Visser, and J. Visser. The ASF+SDF Meta-Environment: a Component-Based Language Development Environment. In R. Wilhelm, editor, CC’01, volume 2027 of LNCS, pages 365–370. Springer-Verlag, 2001.Google Scholar
  5. 5.
    M. G. J. van den Brand, H. A. de Jong, P. Klint, and P. A. Olivier. Efficient Annotated Terms. Software, Practice & Experience, 30(3):259–291, 2000.CrossRefGoogle Scholar
  6. 6.
    J. R. Cordy, C. D. Halpern-Hamu, and E. Promislow. TXL: Ara pid prototyping system for programming language dialects. Computer Languages, 16(1):97–107, 1991.CrossRefGoogle Scholar
  7. 7.
    M. de Jonge, E. Visser, and J. Visser. XT: A bundle of program transformation tools. In M. G. J. van den Brand and D. Parigot, editors, Workshop on Language Descriptions, Tools and Applications (LDTA’01), volume 44 of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, 2001.Google Scholar
  8. 8.
    A. van Deursen, J. Heering, and P. Klint, editors. Language Prototyping, volume 5 of AMAST Series in Computing. World Scientific, 1996.Google Scholar
  9. 9.
    K.-G. Doh and P. D. Mosses. Composing programming languages by combining action-semantics modules. In M. G. J. van den Brand and D. Parigot, editors, Electronic Notes in Theoretical Computer Science, volume 44, 2001.Google Scholar
  10. 10.
    J. Heering, P. R. H. Hendriks, P. Klint, and J. Rekers. The syntax definition formalism SDF— reference manual. SIGPLAN Notices, 24(11):43–75, 1989.CrossRefGoogle Scholar
  11. 11.
    S. C. Johnson. YACC—yet another compiler-compiler. Technical Report CS-32, AT & T Bell Laboratories, Murray Hill, N. J., 1975.Google Scholar
  12. 12.
    P. Klint and E. Visser. Using filters for the disambiguation of context-free grammars. In G. Pighizzini and P. San Pietro, editors, Proc. ASMICS Workshop on Parsing Theory, pages 1–20, Milano, Italy, 1994. Tech. Rep. 126-1994, Dipartimento di Scienze dell’Informazione, Università di Milano.Google Scholar
  13. 13.
    R. Lämmel and C. Verhoef. VS COBOL II grammar, 2001.Google Scholar
  14. 14.
    B. Lang. Deterministic techniques for efficient non-deterministic parsers. In J. Loeckx, editor, Proceedings of the Second Colloquium on Automata, Languages and Programming, volume 14 of LNCS, pages 255–269. Springer-Verlag, 1974.Google Scholar
  15. 15.
    M. E. Lesk and E. Schmidt. LEX— A lexical analyzer generator. Bell Laboratories, 1986. UNIX Programmer’s Supplementary Documents, Volume 1 (PS1).Google Scholar
  16. 16.
    L. Moonen. Generating robust parsers using island grammars. In Proceedings of the 8th Working Conference on Reverse Engineering, pages 13–22. IEEE Computer Society Press, 2001.Google Scholar
  17. 17.
    J. Rekers. Parser Generation for Interactive Environments. PhD thesis, University of Amsterdam, 1992. ftp://ftp.cwi.nl/pub/gipe/reports/Rek92.ps.Z.
  18. 18.
    D. J. Salomon and G. V. Cormack. Scannerless NSLR(1) parsing of programming languages. SIGPLAN Notices, 24(7):170–178, 1989.CrossRefGoogle Scholar
  19. 19.
    D. J. Salomon and G. V. Cormack. The disambiguation and scannerless parsing of complete character-level grammars for programming languages. Technical Report 95/06, Dept. of Computer Science, University of Manitoba, 1995.Google Scholar
  20. 20.
    E. Scott, A. Johnstone, and S. S. Hussain. Technical Report TR-00-12, Royal Holloway, University of London, Computer Science Dept., 2000.Google Scholar
  21. 21.
    M. Tomita. Efficient Parsing for Natural Languages. A Fast Algorithm for Practical Systems. Kluwer Academic Publishers, 1985.Google Scholar
  22. 22.
    E. Visser. Scannerless generalized-LR parsing. Technical Report P9707, Programming Research Group, University of Amsterdam, 1997.Google Scholar
  23. 23.
    E. Visser. Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam, 1997.Google Scholar
  24. 24.
    E. Visser. Stratego: Alan guage for program transformation based on rewriting strategies. System description of Stratego 0.5. In A. Middeldorp, editor, RTA’01, volume 2051 of LNCS, pages 357–361. Springer-Verlag, 2001.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Mark G. J. van den Brand
    • 1
    • 4
  • Jeroen Scheerder
    • 2
  • Jurgen J. Vinju
    • 1
  • Eelco Visser
    • 3
  1. 1.Centrum voor Wiskunde en Informatica (CWI)AmsterdamThe Netherlands
  2. 2.Department of PhilosophyUtrecht UniversityUtrechtThe Netherlands
  3. 3.Institute of Information and Computing SciencesUtrecht UniversityUtrechtThe Netherlands
  4. 4.LORIAINRIAVillers-lès-Nancy CedexFrance

Personalised recommendations