首页 | 本学科首页   官方微博 | 高级检索  
     

基于语法树和JavaCC的程序题自动评分系统
引用本文:屠方博,杨志强.基于语法树和JavaCC的程序题自动评分系统[J].微机发展,2012(1):126-128.
作者姓名:屠方博  杨志强
作者单位:同济大学电子与信息学院,上海201804
摘    要:为了提高程序题自动评分的准确性,及解决传统评分方法无法从语法结构和语义角度衡量错误的学生程序与正确答案之间的相似度,提出了一种基于抽象语法树匹配的程序题自动评分方法。文中以JavaCC技术为核心,首先通过词法分析、语法分析和语义分析生成错误列表和抽象语法树的中间表示,然后通过语法树切片匹配得分,最后和错误列表结合给出评分结果。文中详细论述了各个模块的设计方法,着重讨论了抽象语法树生成并匹配的细节,设计并实现了一个传统方法与语义分析结合的C++程序题自动评分系统。通过对实际考试的结果进行实验,进而验证了该系统的实用性与有效性。

关 键 词:抽象语法树  程序评分  JavaCC

Grading of Programs Using Abstract Syntax Tree & JavaCC
TU Fang-bo,YANG Zhi-qiang.Grading of Programs Using Abstract Syntax Tree & JavaCC[J].Microcomputer Development,2012(1):126-128.
Authors:TU Fang-bo  YANG Zhi-qiang
Affiliation:( School of Electronics and Information, Tongji University, Shanghai 201804, China)
Abstract:A system for grading student programs is designed to enhance the accuracy, and solve the problem that traditional automatic grading approaches can not evaluate the similarity of the source code to correct solutions by using syntax structure and semantic analysis. Present a tool for quickly comparing the source code of student programs and correct solutions. The approach is based on partial abstract syntax tree matching (AST) ,and using JavaCC to generate the AST,then making the score by Tree Cuts and combine the parse error. In this paper, designed and implemented a grading system on C++ programs, and the semantic analysis is used in conjunction with traditional approaches. And then, verify the practicability and effectiveness of the system.
Keywords:syntax tree matching  grading of programs  JavaCC
本文献已被 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号