Design and implementation of NC code compiler based on ANTLR

A design model of NC code complier based on ANother Tool for Language Recognition(ANTLR)was presented,which adopted the Extended Backus Naur Form(EBNF)to define the NC program syntax rule.The model was implemented with Java language,which can make it independent of operating system.The design and implementation of compiler were described from different aspects:lexical analysis,syntax and semantic analysis,information draws and so on.The practical results show that the model can construct the compiler prototype efficiently,compile the NC code faster and more correctly,and can be expanded easily.