model_server/project_pdf/src/path.h.cxx
//
// The routine will convert the definition of index portion into detailed
// structure. Please refer to the example for wkIdxDef in the include file.
//
The routine will convert the definition of index portion into detailed
structure. Please refer to the example for wkIdxDef in the include file.
The routine will convert the definition of index portion into detailed structure . Please refer to the example for wkIdxDef in the include file .
static int analyze_idx_def(char const *idx_def, wkIdxDef **idx_strs,
                           char  )
{
    Initialize(analyze_idx_def);
    if (strlen(idx_def) == 0)
        {
            create_new_idx_def(IDX_CONST_STRING, "", 0, idx_strs, 0);
            return 0;
        }
    char const *p         = idx_def;
    genString working_buf = p;
    wkIdxDef *cur         = 0;
    *idx_strs = 0;
    while(1)
        {
            int  match_index;
            char *w = (char *)working_buf.str();
            char *q = 0;
            char const *s = p;
            char found_const_string_flag = 0;
            char found_match_index_flag  = 0;
            char first = 1;
            while(*s)
                {
                    if (*s == '(' && (first || (!first && *(s-1) != '\\')))
                        found_idx_left_parenthesis(&q, &s, w);
                    else if (*s == ')' && (first || (!first && *(s-1) != '\\')))
                        {
                            if (found_idx_right_parenthesis(&q, &s, w, &match_index, &found_match_index_flag,
                                                            &found_const_string_flag))
                                break;
                        }
                    else
                        {
                            *w++ = *s++;
                            if (q == 0)
                                found_const_string_flag = 1;
                        }
                    first = 0;
                }
            if (q && !found_match_index_flag)
                {
                    if (parse_is_being_executed)
                        create_one_path_parser_error(PATH_PARSE_MISS_PARENTHESES_ERR, 0, 0, 0, 0);
                }
            *w = '\0';
            if (found_const_string_flag)
                create_new_idx_def(IDX_CONST_STRING, (char *)working_buf.str(), 0, idx_strs, &cur);
            if (found_match_index_flag)
                create_new_idx_def(IDX_MATCH_INDEX, 0, match_index, idx_strs, &cur);
            p = s;
            if (*p == '\0')
                break;
        }
    return(0); 
}
static int analyze_idx_def ( char const * idx_def , wkIdxDef * * idx_strs , char ) { Initialize ( analyze_idx_def ) ; if ( strlen ( idx_def ) == 0 ) { create_new_idx_def ( IDX_CONST_STRING , " " , 0 , idx_strs , 0 ) ; return 0 ; } char const * p = idx_def ; genString working_buf = p ; wkIdxDef * cur = 0 ; * idx_strs = 0 ; while ( 1 ) { int match_index ; char * w = ( char * ) working_buf . str ( ) ; char * q = 0 ; char const * s = p ; char found_const_string_flag = 0 ; char found_match_index_flag = 0 ; char first = 1 ; while ( * s ) { if ( * s == ' ' && ( first || ( ! first && * ( s - 1 ) != ' \\ ' ) ) ) found_idx_left_parenthesis ( & q , & s , w ) ; else if ( * s == ' ' && ( first || ( ! first && * ( s - 1 ) != ' \\ ' ) ) ) { if ( found_idx_right_parenthesis ( & q , & s , w , & match_index , & found_match_index_flag , & found_const_string_flag ) ) break ; } else { * w ++ = * s ++ ; if ( q == 0 ) found_const_string_flag = 1 ; } first = 0 ; } if ( q && ! found_match_index_flag ) { if ( parse_is_being_executed ) create_one_path_parser_error ( PATH_PARSE_MISS_PARENTHESES_ERR , 0 , 0 , 0 , 0 ) ; } * w = ' \0 ' ; if ( found_const_string_flag ) create_new_idx_def ( IDX_CONST_STRING , ( char * ) working_buf . str ( ) , 0 , idx_strs , & cur ) ; if ( found_match_index_flag ) create_new_idx_def ( IDX_MATCH_INDEX , 0 , match_index , idx_strs , & cur ) ; p = s ; if ( * p == ' \0 ' ) break ; } return ( 0 ) ; }
The routine will convert the definition of index portion into detailed
structure.
The routine will convert the definition of index portion into detailed structure .
/* direction_flag */ // Find a constant string. // successful