RegExp DEMO version -- [3]核心函数(4)dealState()

作者在 2007-06-02 21:43:00 发布以下内容
                         case OR_MACHINE_BEGIN:
                                 /*开始一个或运算子状态机(字母表),左括号: '['*/
                                 pmnew = newMachine(NULL, NULL, g_scan_pos, -1, '|', NULL);
                                 pmnew->state_start = newState();         /*状态机开始状态*/
                                 pmnew->state_end = newState();         /*状态机开始状态*/
                                 /*将开始状态与当前状态连接*/
                                 appendStateTable(g_st, pmnew->state_start);         /*添加到状态表格*/
                 setdestState(g_st->curState, g_st->eleCount, pmnew->state_start);
                                 g_st->curState = pmnew->state_start; /*移动到新的状态*/
                                
                                 /*调用这一个状态机,将它的断点,运算模式压入堆栈*/
                                 pushMachine(g_mstk, pmnew);

                 getSymbol();
                 /*处理子状态机的否定模式*/
                 if (g_symbol_type == NOT_OP) {
                     g_mstk->topM->not_mode = '^';
                     getSymbol();     /*继续下一个符号*/
                 }
                 /*初始化*/
                 for (OR_MACHINE_i=0; OR_MACHINE_i<sizeof(g_ele_ary); OR_MACHINE_i++) {
                
C语言 | 阅读 1710 次
文章评论,共0条
游客请输入验证码