Abstract
LFC is a functional language based on recursive functions defined in context-free languages. In this paper, a new pattern matching algorithm for LFC is presented, which can represent a sequence of patterns as an integer by an encoding method. It is a rather simple method and produces efficient case-expressions for pattern matching definitions of LFC. The algorithm can also be used for other functional languages, but for nested patterns it may become complicated and further studies are needed.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Dong Yunmei. Recursive functions defined on context-free languages (I). Technical Report ISCAS-LCS-2K-03, Computer Science Laboratory, Institute of Software, The Chinese Academy of Sciences, 2000.
Chen Haiming. Function definition language FDL and its implementation.Journal of Computer Science & Technology, 1999, 14(4): 414–421.
Augustsson L. Compiling pattern matching. InProc. Conference on Functional Programming Languages and Computer Architecture, Jouannaud J-P (ed.), Nancy, France, LNCS 201, Springer-Verlag, Sept. 1985, pp.368–381.
Peyton Jones S L. The Implementation of Functional Programming Languages. Prentice-Hall International, 1987.
Sekar R C, Ramesh R, Ramakrishnan I V. Adaptive pattern matching. InICALP’92, LNCS 632, Springer-Verlag, 1992, pp.247–260.
Graf A. Left-to-right tree pattern matching. InRTA’91, LNCS 488, Springer-Verlag, 1991, pp.323–334.
Schnoebelen Ph. Refined compilation of pattern matching for functional languages.Science of Computer Programming, 1988, 11: 133–159.
Appel A W. Modern Compiler Implementation in C. Cambridge University Press, 1998.
Author information
Authors and Affiliations
Corresponding author
Additional information
This research was supported by the National Natural Science Foundation (No. 69873042), the National ‘863’ High-Tech Programme (No.863-306-05-04-1), and the National “Ninth-Five” Sci-Tech Programme (No.98-780-01-07-02) of China.
CHEN Haiming received his B.S. degree from University of Science and Technology of China in 1989 and his M.S. and Ph.D. degrees from Institute of Software, The Chinese Academy of Sciences (CAS) in 1992 and 1999, respectively. He is now an associate professor at Computer Science Laboratory, Institute of Software, CAS. His current research interests include software design methodology and programming languages.
DONG Yunmei graduated from Jilin University in 1956. He is a professor of Computer Science Laboratory, Institute of Software, CAS. He was elected a member of CAS in 1993. His recent research interests include specification acquisition and reuse.
Rights and permissions
About this article
Cite this article
Chen, H., Dong, Y. Pattern matching compilation of functions defined in context-free languages. J. Comput. Sci. & Technol. 16, 159–167 (2001). https://doi.org/10.1007/BF02950420
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF02950420