摘要
针对嵌入式数控系统运行过程中对NC代码解释的高准确率与高效率的要求,基于自顶向下的递归下降分析法,提出一种应用于嵌入式数控系统NC代码编译器的设计方法。文章主要分别从词法分析、语法分析和解释执行等方面进行编译器的设计与实现。实际运行结果表明:该方法能够高效地构建编译器,可快速、准确地对NC代码进行编译,具有良好的可移植性;为嵌入式数控系统的NC代码编译提供了一种简单有效的解决方案。
In allusion to the demand for high precision and high efficiency of the NC code compiler from the NC system,based on the top-down analysis method of recursive descent grammar,a novel design of general NC code complier in embedded NC system is presented.The design and implementation of compiler are described from different aspects: lexical analysis,syntax analysis,interpreted executing and so on.The practical results show that the method can construct the compiler efficiently,compile the NC code faster and more correctly,owned fine portability;which provides a simple and effective solution for NC code compiler in embedded NC system.
出处
《组合机床与自动化加工技术》
北大核心
2012年第2期45-48,53,共5页
Modular Machine Tool & Automatic Manufacturing Technique
基金
国家科技重大专项"高档数控机床与基础制造装备"的子课题"全数字高档数控装置"(2009ZX04009-014)
关键词
NC编译器
嵌入式数控
指令特征分类
递归下降分析
NC code compiler
embedded NC system
NC code classification
recursive descent analysis