Skip to main content
Log in

Pattern matching compilation of functions defined in context-free languages

  • Correspondence
  • Published:
Journal of Computer Science and Technology Aims and scope Submit manuscript

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.

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

Access this article

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. 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.

  2. Chen Haiming. Function definition language FDL and its implementation.Journal of Computer Science & Technology, 1999, 14(4): 414–421.

    Article  Google Scholar 

  3. 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.

  4. Peyton Jones S L. The Implementation of Functional Programming Languages. Prentice-Hall International, 1987.

  5. Sekar R C, Ramesh R, Ramakrishnan I V. Adaptive pattern matching. InICALP’92, LNCS 632, Springer-Verlag, 1992, pp.247–260.

  6. Graf A. Left-to-right tree pattern matching. InRTA’91, LNCS 488, Springer-Verlag, 1991, pp.323–334.

  7. Schnoebelen Ph. Refined compilation of pattern matching for functional languages.Science of Computer Programming, 1988, 11: 133–159.

    Article  MATH  MathSciNet  Google Scholar 

  8. Appel A W. Modern Compiler Implementation in C. Cambridge University Press, 1998.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Chen Haiming.

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

Reprints 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

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF02950420

Keywords

Navigation