Concrete syntax for data objects in functional languages

Annika Aasa, Kent Petersson, Dan Synek
{"title":"Concrete syntax for data objects in functional languages","authors":"Annika Aasa, Kent Petersson, Dan Synek","doi":"10.1145/62678.62688","DOIUrl":null,"url":null,"abstract":"Many functional languages have a construction to define inductive data types [Hoa75] (also called general :structured types [Pey87], structures [Lan64], datatypes [Mil84] and free algebras [GTWW77]). An inductive defin.ition of a data type can also be seen as a grammar for at language and the elements of the data type as the phrases of the language. So defining an inductive data type can be seen as introducing an embedded language of values into the programming language. This correspondence is however not fully exploited in existing functional languages. The elements can presently only be written in a very restricted form. They are just the parse trees of the elements written in prefix form. A generalization, that we will consider in this paper, is to allow the elements to be written in a more general form. Instead of directly writing the parse trees of the embedded language, we would like to use a more concrete syntactical form and let an automatically generated parser translate the concrete syntactical form to the corresponding parse tree. We think that this is especi.ally useful when we manipulate languages in programs, for example, when implementing compilers, interpreters, program transformation systems, and programming logics. It is also convenient if we want to use the concrete syntax for other kinds of data in a program.","PeriodicalId":119710,"journal":{"name":"Proceedings of the 1988 ACM conference on LISP and functional programming","volume":"2 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1988-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"27","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 1988 ACM conference on LISP and functional programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/62678.62688","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 27

Abstract

Many functional languages have a construction to define inductive data types [Hoa75] (also called general :structured types [Pey87], structures [Lan64], datatypes [Mil84] and free algebras [GTWW77]). An inductive defin.ition of a data type can also be seen as a grammar for at language and the elements of the data type as the phrases of the language. So defining an inductive data type can be seen as introducing an embedded language of values into the programming language. This correspondence is however not fully exploited in existing functional languages. The elements can presently only be written in a very restricted form. They are just the parse trees of the elements written in prefix form. A generalization, that we will consider in this paper, is to allow the elements to be written in a more general form. Instead of directly writing the parse trees of the embedded language, we would like to use a more concrete syntactical form and let an automatically generated parser translate the concrete syntactical form to the corresponding parse tree. We think that this is especi.ally useful when we manipulate languages in programs, for example, when implementing compilers, interpreters, program transformation systems, and programming logics. It is also convenient if we want to use the concrete syntax for other kinds of data in a program.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
函数式语言中数据对象的具体语法
许多函数式语言都有定义归纳数据类型的构造[Hoa75](也称为通用:结构化类型[Pey87]、结构类型[Lan64]、数据类型[Mil84]和自由代数[GTWW77])。归纳定义。数据类型的定义也可以看作是一种语言的语法,数据类型的元素可以看作是该语言的短语。因此,定义归纳数据类型可以看作是在编程语言中引入了一种嵌入式值语言。然而,这种对应关系在现有的函数式语言中没有得到充分利用。元素目前只能以非常有限的形式编写。它们只是以前缀形式编写的元素的解析树。我们将在本文中考虑的概括是,允许以更一般的形式编写元素。我们不直接编写嵌入式语言的解析树,而是希望使用更具体的语法形式,并让自动生成的解析器将具体的语法形式转换为相应的解析树。我们认为这是特别的。当我们在程序中操作语言时非常有用,例如,在实现编译器、解释器、程序转换系统和编程逻辑时。如果我们想在程序中对其他类型的数据使用具体语法,它也很方便。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Objects as closures: abstract semantics of object-oriented languages Continuations may be unreasonable Exact real computer arithmetic with continued fractions A unified system of parameterization for programming languages Syntactic closures
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1