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

作者在 2007-06-02 21:41:00 发布以下内容

             case START_REGEXP:
                 printf("debug: start scan the regexp:\n\t\"%s\"\n", g_strRegExp);
                 /*做一次状态机开始操作*/
             case AND_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);
                                 break;         /*AND_MACHINE_BEGIN -- 结束*/

C语言 | 阅读 1727 次
文章评论,共0条
游客请输入验证码