节点文献

通用数控代码编译器研究

Study on General NC Code Compiler

【作者】 张生芳

【导师】 葛研军;

【作者基本信息】 大连铁道学院 , 机械制造及其自动化, 2002, 硕士

【摘要】 本文研究了通用数控(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. 系统开发遵循软件工程思想,程序结构合理,用户界面友好,具有较高的可靠性及实用性。

【Abstract】 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 specificcompile tools------ LEX & YACC to develop the NC compiler module,thecompleteness 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 codecompile,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.

【关键词】 NC系统定制代码编译LEX&YACC
【Key words】 NC SystemCustomizationCode CompileLEX & YACC
  • 【分类号】TG659
  • 【被引频次】20
  • 【下载频次】415
节点文献中: