Skip to main content

Lazy Combinators for Executable Specifications of General Attribute Grammars

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2010)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 5937))

Included in the following conference series:

Abstract

A lazy-evaluation based top-down parsing algorithm has been implemented as a set of higher-order functions (combinators) which support directly-executable specifications of fully general attribute grammars. This approach extends aspects of previous approaches, and allows natural language processors to be constructed as modular and declarative specifications while accommodating ambiguous context-free grammars (including direct and indirect left-recursive rules), augmented with semantic rules with arbitrary attribute dependencies (including dependencies from right). This one-pass syntactic and semantic analysis method has polynomial time and space (w.r.t. the input length) for processing ambiguous input, and helps language developers build and test their models with little concern for the underlying computational methods.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Knuth, D.: Semantics of context-free languages. Theory of Computing Systems 2(2), 127–145 (1968)

    MATH  MathSciNet  Google Scholar 

  2. Warren, D.: Programming the ptq grammar in xsb. In: Workshop on Programming with Logic Databases, pp. 217–234 (1993)

    Google Scholar 

  3. Frost, R., Hafiz, R., Callaghan, P.: Modular and efficient top-down parsing for ambiguous left-recursive grammars. In: 10th IWPT, pp. 109–120. ACL (2007)

    Google Scholar 

  4. Frost, R., Hafiz, R., Callaghan, P.: Parser combinators for ambiguous left-recursive grammars. In: Hudak, P., Warren, D.S. (eds.) PADL 2008. LNCS, vol. 4902, pp. 167–181. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  5. Bird, R.: Intro. to Functional Programming using Haskell. Prentice Hall, Englewood Cliffs (1998)

    Google Scholar 

  6. De Moor, O., Backhouse, K., Swierstra, D.: First-class attribute grammars. In: Third Workshop on Attribute Grammars and their Applications, pp. 245–256 (2000)

    Google Scholar 

  7. Tienari, M.: On the definition of attribute grammar. Semantics-Directed Compiler Generation 94, 408–414 (1980)

    Google Scholar 

  8. Vogt, H.H., Swierstra, S.D., Kuiper, M.F.: Higher order attribute grammars. In: PLDI, pp. 131–145. ACM, New York (1989)

    Google Scholar 

  9. Frost, R., Launchbury, J.: Constructing natural language interpreters in a lazy functional language. The Computer Journal 32(2), 108–112 (1989)

    Article  Google Scholar 

  10. Hutton, G., Meijer, E.: Monadic parser combinators. J. Funct. Program. 8(4), 437–444 (1998)

    Article  MATH  Google Scholar 

  11. Wadler, P.: How to replace failure by a list of successes. In: Jouannaud, J.-P. (ed.) FPCA 1985. LNCS, vol. 201, pp. 113–128. Springer, Heidelberg (1985)

    Google Scholar 

  12. Wadler, P.: Monads for functional programming. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925, pp. 24–52. Springer, Heidelberg (1995)

    Google Scholar 

  13. Hudak, P., Peterson, J., Fasel, J.: A gentle introduction to haskell 98. Technical report (1999)

    Google Scholar 

  14. Norvig, P.: Techniques for automatic memoization with applications to context-free parsing. Computational Linguistics 17(1), 91–98 (1991)

    Google Scholar 

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

    Article  MATH  Google Scholar 

  16. Frost, R., Szydlowski, B.: Memoizing purely functional top-down backtracking language processors. Science of Computer Programming 27(3), 263–288 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  17. Tomita, M.: Efficient Parsing for Natural Language: A Fast Algorithm for Practical Systems. Kluwer Academic Publishers, Boston (1986)

    Google Scholar 

  18. Frost, R., Fortier, R.: An efficient denotational semantics for natural language database queries. In: Applications of NLDB, pp. 12–24 (2007)

    Google Scholar 

  19. Paakki, J.: Attribute grammar paradigms a high-level methodology in language implementation. ACM Comput. Survey 27(2), 196–255 (1995)

    Article  Google Scholar 

  20. Swierstra, S.D., Alcocer, P., Saraiva, J.: Designing and implementing combinator languages. In: 3rd Summer School on Advanced FP, pp. 150–206 (1998)

    Google Scholar 

  21. Swierstra, S.D., Vogt, H.: Higher order attribute grammars. In: Alblas, H., Melichar, B. (eds.) SAGA School 1991. LNCS, vol. 545, pp. 256–296. Springer, Heidelberg (1991)

    Google Scholar 

  22. Boyland, J.: Remote attribute grammars. Journal of the ACM 52(4), 627–687 (2005)

    Article  MathSciNet  Google Scholar 

  23. Ekman, T.: Extensible Compiler Construction. PhD thesis, Comp Science, Lund University (2006)

    Google Scholar 

  24. Van Wyk, E., Bodin, D., Gao, J., Krishnan, L.: Silver: an extensible attribute grammar system. In: LDTA, pp. 103–116 (2007)

    Google Scholar 

  25. Kats, L., Sloane, A., Visser, E.: Decorated attribute grammars. attribute evaluation meets strategic programming. In: 18th International Conference on Compiler Construction, pp. 142–157 (2009)

    Google Scholar 

  26. Augusteijn, L.: The elegant compiler generator system. In: Deransart, P., Jourdan, M. (eds.) Attribute Grammars and their Applications. LNCS, vol. 461, pp. 238–254. Springer, Heidelberg (1990)

    Google Scholar 

  27. Johnsson, T.: Attribute grammars as a functional programming paradigm. In: Kahn, G. (ed.) FPCA 1987. LNCS, vol. 274, pp. 154–173. Springer, Heidelberg (1987)

    Google Scholar 

  28. Levison, M., Lessard, G.: Application of attribute grammars to natural language sentence generation. In: Deransart, P., Jourdan, M. (eds.) Attribute Grammars and their Applications. LNCS, vol. 461, pp. 298–312. Springer, Heidelberg (1990)

    Google Scholar 

  29. Mcroy, S., Channarukul, S., Ali, S.: An augmented template-based approach to text realization. Natural Language Engineering 9(4), 381–420 (2003)

    Article  Google Scholar 

  30. Channarukul, S., Mcroy, S., Ali, S.: Enriching partially-specified representations for text realization using an attribute grammar. In: 1st International Natural Language Generation Conference, pp. 163–170 (2000)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hafiz, R., Frost, R.A. (2010). Lazy Combinators for Executable Specifications of General Attribute Grammars. In: Carro, M., Peña, R. (eds) Practical Aspects of Declarative Languages. PADL 2010. Lecture Notes in Computer Science, vol 5937. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11503-5_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-11503-5_15

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-11502-8

  • Online ISBN: 978-3-642-11503-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics