通用数控代码编译器研究
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
本文研究了通用数控(NC)代码编译器的技术构成,探讨了系统开发的实施策略及应用方式,开发出了一个具有通用意义的NC代码编译系统,研究了系统组成的相关问题。
     1. 将编译技术引入NC代码分析处理过程中,把NC代码编译过程分为词法分析、语法分析和代码转换三个阶段。基于JB 3208-83和JB3832-85,建立了不同NC系统相同功能指令间的相互关联,实现了NC系统间的代码相互转换。
     2. 对NC程序结构进行了深入分析,整理出NC程序中常见错误类型,并对每种错误原因进行清楚界定。应用正规文法和LALR(1)方法对NC程序进行词法、语法分析,利用专用编译工具LEX & YACC开发出NC代码编译模块,保证了词法、语法分析的全面性和准确性。
     3. 为增强系统实用范围,开发出系统定制模块,提出“分层递进”树型数据管理模式,简化了数据处理的复杂度,保证了系统运行的可靠性。引入数据库技术处理系统复杂数据,应用DAO对数据库引擎进行操作,提高了数据存取效率,避免了系统对数据库系统的依赖,使编译器的扩展性和通用性得到充分保障。
     4. 将面向对象技术应用到NC代码编译中,提出了面向对象通用编译器设计方法,该方法可有效实现同一编译系统针对不同语言形式的合理应用,改善了编译系统的可维护性和可扩充性。
     5. 系统开发遵循软件工程思想,程序结构合理,用户界面友好,具有较高的可靠性及实用性。
This paper studies the technical structure of General NC Code Compiler and the enforceable tactics of its application in various NC systems. In the light of compiler substance,a practical compiler system for NC code is developed and solved. Key technologies are investigated as follows:
    1. Having introduced the compile technology into the process of NC code analysis,the process of NC code compile is divided into three stages:Lexical Analysis,Syntactic Analysis and NC Code Conversion. Based on JB 3208-83 and JB 3832-85,and through establishing the relationship among different NC system in terms of same functional instruction,NC Code conversion between NC systems is realized.
    2. By thorough analyzing the structure of NC code,the normal errors type of the NC program is summarized and the cause of each kind of errors is distinguished clearly. Applying the Normal Grammar Method and LALR(1) Method in NC code's Lexical & Syntactic Analysis,and using specific
    compile tools------ LEX & YACC to develop the NC compiler module,the
    completeness and veracity of Lexical & Syntactic Analysis is ensured successfully.
    3. In order to increase the applied field of the system,the module of System Customization is developed. By the tree type data process model of "manage gradually through stage" which is presented in this paper,the complex degree of data processing is simplified;furthermore,the reliability of system is guaranteed. For the sake of avoiding system's dependency to the database system,the Database Technology is introduced to process the complicated data of this system,DAO is applied to manipulate the database engine,the efficiency and veracity of the data operation is increased,and expandability and generality of the system is ensured.
    4. By introducing the Object Oriented Technology into NC code
    
    
    
    compile,the Object Oriented Design Method of General Compiler is summarized. Using this method,the same compiler applying in different language form is realized efficiently,the maintainability and expandability of the system is improved.
    5. In system developing,owing to following the thought of Software Engineering,the procedure structure is rational,the user interface is friendly,and the system has high reliability and practicability.
引文
[1] 刘雄伟,冯培锋等.数控机床操作与编程培训教程.北京:机械工业出版社,2001
    [2] 冯勇等.现代计算机数控系统.北京:机械工业出版社,1996
    [3] 刘雄伟,张定华等.数控加工理论与编程技术.北京:机械工业出版社,2000
    [4] http://www.caria.com
    [5] http://www.ugs.com
    [6] http://www.ptc.com
    [7] http://www.mastercam.com
    [8] 吕映芝,张素琴等.编译原理.北京:清华大学出版社,1998
    [9] http://www.aikoku.com
    [10] http://www.siriussys.com
    [11] http://www.nccs.com
    [12] 肖田元,韩向利,王新龙.通用NC代码翻译技术.系统仿真学报.1998,10(5):1~7
    [13] 姚习武,朱志红,田文超.Windows平台下数控代码解释系统的研究与实践.机械设计与制造工程.1999,28(3):24~26
    [14] 刘磊,吴明华,周济.通用数控加工过程仿真中数控代码解释器的一种实现.组合机床与自动化加工技术.1995(12):12~16
    [15] 解旭东,尚立库,彭炎午.数控加工程序的计算机识别方法.组合机床与加工自动化技术
    [16] 周惠群,莫蓉,方炜.数控加工程序的正确性检查系统的研制.机械科学与技术.1998
    [17] 文登敏,蔡淮.微机数控加工程序的编译.组合机床与自动化加工技术.1996(3):27~30
    [18] 谢明红,林碧.数控加工程序的检验与仿真系统的研制.华侨大学学报(自然科学版).1999,20(4):392~395
    [19] 王治森,赵福民,张勇等.数控系统加工程序的编译.合肥工业大学学报(自然科学版).2000,23(1):95~98
    
    
    [20] Aho A V, Ullman J D. Compilers Principles, Techniques, and Tools. Massachusetts: Addison-Wesley, 1986
    [21] 刘卡林,面向加工中心的多轴数控加工仿真软件平台研究:[博士学位论文],哈尔滨:哈尔滨工业大学,1995
    [22] 全国数控培训网络天津分中心编.数控编程.北京:机械工业出版社,1997
    [23] 数字控制机床点位和直线切削加工用可变程序段格式.中华人民共和国机械工业部部标准.JB 3832-85
    [24] 数字控制机床穿孔带程序段格式中的准备功能G和辅助功能M的代码.中华人民共和国机械工业部部标准.JB 3208-83
    [25] M.E Lesk and E. Schmidt. Lex-A Lexical Analyzer Generator. Http://www. cs. ucsb.edu/~cs 160/machines/lex-docs.txt
    [26] Stephen C. Johnson. YACC: Yet Another Compiler-Compiler. AT&T Bell Laboratories, Murray Hill, New Jersey, 07974. Http://www. csc.calpoly.edu/~gfisher/450/doc/yacc/paper. txt
    [27] 蒋立源,康慕宁等编,编译原理,西安:西北工业大学出版社,1999
    [28] A.V. Aho and M. J. Corasick. Efficient String Matching: An Aid to Bibliographic Search. comm. ACM 18. 1975:333~340
    [29] Abo A V, Sethi R, and Ullman J D. Compilers Principles, Techniques, and Tools. Readind, Mass: Addison-Wesley. 1986. 796-769
    [30] (美)Bennett,D.等著,徐军等译.Visual C++5.0开发人员指南.
    [31] 官章全,唐晓卫.Visual C++6.0编程实例详解.北京:电子工业出版社,1999
    [32] Jon Bates,Tim Tompkins著,何建辉等译.实用VC++6.0教程.北京:清华大学出版社,2000
    [33] 北京:机械工业出版社,1998汪成为等.面向对象分析、设计与应用.北京:国防工业出版社,1993
    [34] Peter Coad, Edward Yourdon. Object-Oriented Design. New York:Pretice-Hall, 1991
    [35] Rumbaugh J.等. Object-Oriented Modeling and Design. New York: Prentice Hall, 1991
    [36] 程景云,倪亦泉等.人机界面设计与开发工具.北京:电子工业出版社,1994
    [37] 丁茂顺.用户接口技术与交互系统构造方法.科学出版社,1992
    
    
    [38] 汤智华.人—计算机交互工具的人机工程设计.计算机世界.1994.3.2,135~137
    [39] 张海藩等.软件工程导论.修订版.北京:清华大学出版社,1992
    [40] 郑人杰,殷人昆等.实用软件工程.第二版.北京:清华大学出版社,1997
    [41] 郑人杰.计算机软件测试技术.北京:清华大学出版社,1992

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700