Extension of Type-Based Approach to Generation of Stream-Processing Programs by Automatic Insertion of Buffering Primitives
In our previous paper, we have proposed a framework for automatically translating tree-processing programs into stream-processing programs. However, in writing programs that require buffering of input data, a user has to explicitly use buffering primitives which copy data from input stream to memory or copy constructed trees from memory to an output stream. Such explicit insertion of buffering primitives is often cumbersome and worsens the readability of the program. We overcome the above-mentioned problems by developing an algorithm which, given any simply-typed tree-processing program, automatically inserts buffering primitives. The resulting program is guaranteed to be well-typed under our previous ordered-linear type system, so that the program can be further transformed into an equivalent stream-processing program using our previous framework.
KeywordsInput Stream Input Tree Type Environment Output Stream Type Judgment
Unable to display preview. Download preview PDF.
- 1.Bray, T., Paoli, J., Sperberg-McQueen, C.M., Maler, E.: Extensible markup language (XML) 1.0 (second edition). Technical report, World Wide Web Consortium (October 2000), http://www.w3.org/TR/REC-xml
- 3.Ganzinger, H., Giegerich, R.: Attribute coupled grammars. In: Proceedings of the ACM SIGPLAN 1984 Symposium on Compiler Construction (1984)Google Scholar
- 5.Hosoya, H., Vouillon, J., Pierce, B.C.: Regular expression types for XML. In: Proceedings of the International Conference on Functional Programming (ICFP), pp. 11–22 (September 2000)Google Scholar
- 6.Kodama, K.: Derivation of XML stream processor based on ordered linear type. Master’s thesis, Tokyo Institute of Technology (March 2005)Google Scholar
- 8.Nakano, K.: Composing stack-attributed tree transducers. Technical Report METR–2004–01, Department of Mathematical Informatics, University of Tokyo, Japan (2004)Google Scholar
- 10.Nakano, K., Nishimura, S.: Deriving event-based document transformers from tree-based specifications. In: van den Brand, M., Parigot, D. (eds.) Electronic Notes in Theoretical Computer Science, vol. 44, Elsevier Science Publishers, Amsterdam (2001)Google Scholar
- 12.Polakow, J.: Ordered linear logic and applications. PhD thesis, Carnegie Mellon University, Available as Technical Report CMU-CS-01-152 (June 2001)Google Scholar
- 14.Suenaga, K., Kobayashi, N., Yonezawa, A.: Extension of type-based approach to generation of stream-processing programs by automatic insertion of buffering primitives. Full paper, Available from http://www.yl.is.s.u-tokyo.ac.jp/~kohei/doc/paper/lopstr05-full.pdf
- 15.Benzaken, V., Castagna, G., Frisch, A.: CDuce: An XML-centric general-purpose language. In: Proceedings of the ACM International Conference on Functional Programming (2003)Google Scholar
- 16.W3C. Document Object Model (DOM) Level 1 Specification (October 1998)Google Scholar