Abstract
A simple grammar scheme for expressions containing mixfix operators is presented. The scheme is parameterised by a precedence relation which is only restricted to be a directed acyclic graph; this makes it possible to build up precedence relations in a modular way. Efficient and simple implementations of parsers for languages with user-defined mixfix operators, based on the grammar scheme, are also discussed. In the future we plan to replace the support for mixfix operators in the language Agda with a grammar scheme and an implementation based on this work.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aasa, A.: Precedences in specifications and implementations of programming languages. Theoretical Computer Science 142(1), 3–26 (1995)
Aasa, A.: User Defined Syntax. PhD thesis, Chalmers University of Technology (1992)
The Agda Team. The Agda Wiki (2009), http://wiki.portal.chalmers.se/agda/
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)
Allen, E., Chase, D., Hallett, J., Luchangco, V., Maessen, J.-W., Ryu, S., Steele Jr., G.L., Tobin-Hochstadt, S., et al.: The Fortress Language Specification, Version 1.0 (2008)
The Coq Development Team. The Coq Proof Assistant Reference Manual, Version 8.2 (2009)
Danielsson, N.A., Altenkirch, T.: Mixing induction and coinduction. Draft (2009)
Floyd, R.W.: Syntactic analysis and operator precedence. Journal of the ACM 10(3), 316–333 (1963)
Frost, R.A., Szydlowski, B.: Memoizing purely functional top-down backtracking language processors. Science of Computer Programming 27(3), 263–288 (1996)
Goguen, J.A., Winkler, T., Meseguer, J., Futatsugi, K., Jouannaud, J.-P.: Introducing OBJ (1999)
Heinlein, C.: C+++: User-defined operator symbols in C++. In: INFORMATIK 2004 – Informatik verbindet, Band 2, Beiträge der 34. Jahrestagung der Gesellschaft für Informatik e.V (GI). Lecture Notes in Informatics, vol. P-51, pp. 459–468 (2004)
Lotfallah, W.B.: Characterizing unambiguous precedence systems in expressions without superfluous parentheses. International Journal of Computer Mathematics 86(1), 1–20 (2009)
McBride, C., Paterson, R.: Applicative programming with effects. Journal of Functional Programming 18, 1–13 (2008)
Missura, S.A.: Higher-Order Mixfix Syntax for Representing Mathematical Notation and its Parsing. PhD thesis, ETH Zürich (1997)
Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML. MIT Press, Cambridge (1997) (revised edition)
Norell, U.: Towards a practical programming language based on dependent type theory. PhD thesis, Chalmers University of Technology and Göteborg University (2007)
Norvig, P.: Techniques for automatic memoization with applications to context-free parsing. Computational Linguistics 17(1), 91–98 (1991)
Odersky, M.: The Scala Language Specification, Version 2.7. Programming Methods Laboratory, EPFL, Switzerland. Draft (2009)
Paulson, L.C., Nipkow, T., Wenzel, M.: The Isabelle Reference Manual (2008)
Pettersson, M., Fritzson, P.: A general and practical approach to concrete syntax objects within ML. In: Proceedings of the ACM SIGPLAN Workshop on ML and its Applications (1992)
Peyton Jones, S. (ed.): Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge (2003)
Peyton Jones, S.L.: Parsing distfix operators. Communications of the ACM 29(2), 118–122 (1986)
Sterling, L., Shapiro, E.: The Art of Prolog, 2nd edn., Advanced Programming Techniques. MIT Press, Cambridge (1994)
Wadler, P.: How to replace failure by a list of successes; a method for exception handling, backtracking, and pattern matching in lazy functional languages. In: Jouannaud, J.-P. (ed.) FPCA 1985. LNCS, vol. 201, pp. 113–128. Springer, Heidelberg (1985)
Wansbrough, K.: Macros and preprocessing in Haskell, unpublished manuscript (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Danielsson, N.A., Norell, U. (2011). Parsing Mixfix Operators. In: Scholz, SB., Chitil, O. (eds) Implementation and Application of Functional Languages. IFL 2008. Lecture Notes in Computer Science, vol 5836. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-24452-0_5
Download citation
DOI: https://doi.org/10.1007/978-3-642-24452-0_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-24451-3
Online ISBN: 978-3-642-24452-0
eBook Packages: Computer ScienceComputer Science (R0)