A discipline of tree processing

A. Schreiner, J. Heliotis
{"title":"A discipline of tree processing","authors":"A. Schreiner, J. Heliotis","doi":"10.1145/1596655.1596668","DOIUrl":null,"url":null,"abstract":"This paper discusses a set of new tools to facilitate the implementation of language processors in Java. First, by decoupling recognition based on grammars from tree building based on semantic actions we can choose to represent grammars in BNF or EBNF, and to parse based on LL, LR, or functional engines, and still completely control how trees represent structured input. Second, we use a Java custom annotation to generate tree factories, thus encouraging a more functional approach to backend processing by tree transformation. Third, we replace the traditional visitor design pattern in the backend by a more rule-oriented approach using inheritance on tree node classes for pattern matching. Taken together, language implementation turns into a problem of tree creation and transformation with concise, Java-based notations to focus on the algorithms.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-08-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Principles and Practice of Programming in Java","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1596655.1596668","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

This paper discusses a set of new tools to facilitate the implementation of language processors in Java. First, by decoupling recognition based on grammars from tree building based on semantic actions we can choose to represent grammars in BNF or EBNF, and to parse based on LL, LR, or functional engines, and still completely control how trees represent structured input. Second, we use a Java custom annotation to generate tree factories, thus encouraging a more functional approach to backend processing by tree transformation. Third, we replace the traditional visitor design pattern in the backend by a more rule-oriented approach using inheritance on tree node classes for pattern matching. Taken together, language implementation turns into a problem of tree creation and transformation with concise, Java-based notations to focus on the algorithms.
树处理的一门学科
本文讨论了一套新的工具,以方便在Java中实现语言处理器。首先,通过将基于语法的识别与基于语义动作的树构建解耦,我们可以选择在BNF或EBNF中表示语法,并基于LL、LR或功能引擎进行解析,并且仍然完全控制树如何表示结构化输入。其次,我们使用Java自定义注释来生成树工厂,从而鼓励通过树转换实现更实用的后端处理方法。第三,我们用一种更面向规则的方法取代后端传统的访问者设计模式,该方法使用树节点类的继承进行模式匹配。总之,语言实现变成了一个树的创建和转换问题,使用简洁的、基于java的符号来关注算法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信