当前位置: 首页 > 工具软件 > JaMoPP > 使用案例 >

Jamopp Semantics Analysis

平学
2023-12-01

Tomorrow I will talk about one of the Jamopp features which is semantics analysis with James and Rosemary. Based on recent my intensive research, the Java1.5 semantics analysis consists of serveral reference resolvers. These reference resolvers are called after parsing java source file. The decider package is used for initialization of resolved identifiers. Scopewalk class walks up or down the java model tree, and once an identifier resolved, a proper decider will be applied. The lexical analyzer and parser are generated by calling of ANTLR. Among all the source file that I downloaded from the Jamopp website only an implementation of Java1.5 semantics analysis is implemented. Jamopp generates reference resolvers under the package with a name of org.emftext.language.<languagename>.language.resource. A factory pattern is applied for creating a resource that contain certain semantics analysis on the language. To add semantics analysis into the language, you must code your reference resolver's algorithm, type checking into these generated reference resolvers. So from meta model, concrete syntax to generation of lexical analysis, parsing routines and semantics analysis, everything is based on EMText.

 

But one problem is I couldnt get office model working from command line. If I can get it work and this probably would give me a better understanding of Jamopp overall structure. Anyway, I have overview sheet done for tomorrow's weekly meeting this afternoon in the lab. On the other hand, OCL queries can also be applied onto these code for checking coding errors at static level. BTW,this paper is already accepted by SLE this year.

 类似资料:

相关阅读

相关文章

相关问答