期刊文献+

基于Java语言的抽象语法树的创建与遍历 被引量:5

Build and Traverse of Abstract Syntax Tree Based on Java Program
下载PDF
导出
摘要 抽象语法树(AbstractSyntaxTree,AST)作为程序的一种中间表示形式,在程序分析等诸多领域有广泛的应用.利用抽象语法树可以方便地实现多种源程序处理工具,比如源程序浏览器、智能编辑器、语言翻译器等.本文作者介绍了抽象语法树涉及的原理及解释器的设计方案,针对Java语言,利用设计模式理论提出了创建和遍历抽象语法树的思路,并给出较为详细的代码说明. Abstract Syntax Tree, referred as intermediate representation of program, has many applications in Program Analysis. Using Abstract Syntax Tree, we can develop tools such as Source Code Explorer, Intellectual Editor, etc. This paper introduces the principles of Abstract Syntax Tree, and presents an appropriate solution to design Interpreter based on Java Program. With the help of Design Patterns, we can build and traverse an Abstract Syntax Tree. Moreover, the paper gives illustrations of concerned source codes.
出处 《长沙大学学报》 2004年第4期50-53,57,共5页 Journal of Changsha University
基金 国家自然科学基金(批准号:60176028)资助项目.
关键词 抽象语法树 解释器 模式 创建 遍历 Abstract Syntax Tree Interpreter Pattern Build Traverse
  • 相关文献

参考文献5

  • 1http://cougaar.org/projects/cougaar-pmd/,2003.
  • 2Marius Scurtescu. Java Program Representation and Manipulation in Prolog. http://fas.sfu.ca/pub/cs/theses/2000/MariusScurtescuMSc.pdf, 2000.
  • 3Sriram Sankar, David Williamns , Andrea Gini. JavaCC Grammar Repository. http://www.cobase.cs.ucla.edu/pub/javacc/, 2002.
  • 4Joel Jones. Abstract Syntax Tree Implementation Idioms. http://jerry.cs.uiuc.edu/-plop/plop2003/Papers/Jones-ImplementingASTs.pdf.
  • 5ErichGramma RichardHelm RalphJohnson JohnVlissides.Design Patterns Elements of Reusable Object-Oriented Software[M].北京:机械工业出版社,2002..

同被引文献23

引证文献5

二级引证文献8

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部