| Open numerical control system is research hotspot of NC technology now. While developing the performance about high-speed ,high-efficiency, high-precision and intelligence, demanding for good function which demand software to cany out all of the NC function and hardware to minimize scale. Machine logic, as the whole movement control kernel, also demanding soft PLC to realize function. we can write machine logic with advanced language directly, but implementing soft PLC call for compiler. So it is important of PLC Compiled system based on PC as hardware exploitation platform and Windows as software exploitation platform.The paper takes SIPROM as source program of machine logic, analyzes compiled system with compiled phase and run phase written by C . At the whole compiled system design, takes grammar as the base of program design, referring to hard PLC working theoty, syntax analysis program as center to organize the whole compiled process. According to compiler抯 own function, partitioning compiler to several segments~ respectively introducing every segment which ought to complete basic work and logic relation.The paper describes symbolic structure of word of program language with regular grammar and regular expression, constructs converted-state chart to identify word symbol. At the base of converted-state chart, building morphology table, designing a section of program for every status, in order to enable lexical analysis to recognize word from character string. After comparing strongpoint and shortcoming of the methods, which are recursion, LL (1), simple-priority relation, layer, functor priority, LR (0) and LR (1), choosing to make use of LR (1). And describing logic framework and work process of LR( 1) analyzer ,explaining the kernel of analyzer, analyzing algorithm of table with instance, in order to enable syntax analysis to judge whether a group of word is a right sentence or not. Syntax-lead translator appends lingual attribute on grammar symbol, calculating attribute value with semantic regulation, which attach to a group of producer expression. At the base of compiler forepart, considering repertoire, addressing mode and instruction period of object machine, adopting backfill to fill data for machine code in order to generate right object code, assemble language program. Symbol table management use for seeking table or filling table. Error management looks for mistake.The paper uses one time scan compiled program framework. One time scan can scan the source program from stem to stem, and doing relative work, completing compiler from source program to object code, that is, translating advanced language adopt compiler mode. Because compiler scan program with static order of program, not dynamic order. While using compiler, compile source program only one time, run more times. The part of source program that repeats to execute is on run stage, not on compiler stage. The advantage of compiled phase and run phase compile only once in the whole process. In a word, the compiled system implement soft PLC function, achieve the purpose of machine logic control, have the great advantage comparing whit hardware PLC. |