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

作者在 2007-06-02 21:49:00 发布以下内容
             case END_REGEXP:
                 while_notfinish = 0; /*一会儿退出循环*/
                 printf("debug: end scan the regexp:\n\t\"%s\"\n", g_strRegExp);
                 /*做一次状态机结束操作*/
                         case OR_MACHINE_END:
                 if (symboltype == OR_MACHINE_END) {
                     /*将g_ele_ary[]连接到OR_MACHINE中*/
                     for (OR_MACHINE_i=0; OR_MACHINE_i<sizeof(g_ele_ary); OR_MACHINE_i++) {
                         if (g_mstk->topM->not_mode == '^') {
                             /*否定模式*/
                             if (g_ele_ary[OR_MACHINE_i] == 0) {
                                 setdestState(g_mstk->topM->state_start, OR_MACHINE_i, g_mstk->topM->state_end);
                             }
                         } else {
                             if (g_ele_ary[OR_MACHINE_i] == 1) {
                                 setdestState(g_mstk->topM->state_start, OR_MACHINE_i, g_mstk->topM->state_end);
                             }
                         }
                     }
                     g_st->curState = g_mstk->topM->state_end;
                 }
                         case AND_MACHINE_END:
                                 /*关闭一个子状态机,右括号: ')'*/
              &n
C语言 | 阅读 1737 次
文章评论,共0条
游客请输入验证码