Ignore:
Timestamp:
Oct 16, 2008, 2:09:54 PM (11 years ago)
Author:
ksherdy
Message:

SVG Open 2008 branch.

Location:
branches/gml2svg_parabix
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • branches/gml2svg_parabix

    • Property svn:ignore
      •  

        old new  
        11.project
         2.cdtproject
         3.cproject
         4cc_analyzer.cxx
  • branches/gml2svg_parabix/markup_stats.cxx

    r195 r205  
    2626#ifdef PAPI
    2727#include "../code_clocker/clocker/cc.h"
    28 #include "../code_clocker/clocker/cc.cxx"
     28//#include "../code_clocker/clocker/cc.cxx"
    2929
    3030CC * code_clocker;
     
    155155inline void ParsingEngine<B>::PI_action(unsigned char * item, int lgth) {
    156156        PI_count +=1;
    157        
     157
    158158        #if defined(CALC_AVG)
    159159                PI_length += lgth;
     
    182182        at_start = 1;
    183183#endif
    184        
     184
    185185        #if defined(CALC_AVG)
    186186                start_tag_length += lgth;
    187187        #endif
    188        
     188
    189189        nesting_depth += 1;
    190190        if (nesting_depth > max_nesting_depth) max_nesting_depth = nesting_depth;
     
    201201        at_start = 0;
    202202#endif
    203        
     203
    204204        #if defined(CALC_AVG)
    205205                end_tag_length += lgth;
    206206        #endif
    207        
     207
    208208        nesting_depth -= 1;
    209209}
     
    213213inline void ParsingEngine<B>::Error_action(unsigned char * item, int lgth) {
    214214        error_item_count +=1;
    215        
     215
    216216        #if defined(CALC_AVG)
    217217                error_item_length += lgth;
    218218        #endif
    219        
     219
    220220        fprintf(stderr, "Error: illegal markup at positions %i of length %i.\n", AbsPos()-lgth, lgth);
    221221        cerr << string((char *) item, lgth) << endl;
     
    226226inline void ParsingEngine<B>::Text_action(unsigned char * item, int lgth, bool more) {
    227227        text_item_count +=1;
    228        
     228
    229229        #if defined(CALC_AVG)
    230230                text_item_length += lgth;
     
    235235inline void ParsingEngine<B>::Reference_action(unsigned char * item, int lgth) {
    236236        reference_count +=1;
    237        
     237
    238238        #if defined(CALC_AVG)
    239239                reference_length += lgth;
     
    251251It is called with two parameters identifying the
    252252first and last character positions of the expected XML_name.
    253 Similarly, |PI_Target_action| is the action routine called upon recognition 
     253Similarly, |PI_Target_action| is the action routine called upon recognition
    254254of the XML Name that occurs immediately after the opening "<?"
    255255delimiter of a processing instruction.
     
    262262
    263263/* Semantic action routines for markup components. */
    264 /* Action routine for an element name occurring immediately after the 
     264/* Action routine for an element name occurring immediately after the
    265265   opening "<" of a start tag or empty element tag. */
    266266template <class B>
     
    268268}
    269269
    270 /* Action routine for a processing instruction target name occurring immediately 
     270/* Action routine for a processing instruction target name occurring immediately
    271271   after the opening "<?" of a processing instruction. */
    272272template <class B>
     
    277277   a element start tag or an empty element tag. */
    278278template <class B>
    279 inline void ParsingEngine<B>::AttributeValue_action(unsigned char * name, int name_lgth, 
     279inline void ParsingEngine<B>::AttributeValue_action(unsigned char * name, int name_lgth,
    280280                                 unsigned char * val, int val_lgth) {
    281281        total_attribute_count+=1;
    282        
     282
    283283        #if defined(CALC_AVG)
    284284                total_att_name_length += name_lgth;
     
    293293                             unsigned char * URI, int URI_lgth) {
    294294        namespace_count+=1;
    295        
     295
    296296        #if defined(CALC_AVG)
    297297                total_namespace_name_length += name_lgth;
     
    303303template <class B>
    304304void ParsingEngine<B>::FinalizeBuffer_action() {
    305        
    306        
     305
     306
    307307#ifdef DEBUG
    308308        printf ("FinalizeBuffer; last 16 bytes + lookahead 16 =\n");
     
    315315                code_clocker->start_interval();
    316316        #endif
    317        
     317
    318318}
    319319
     
    404404                exit(-1);
    405405        }
    406        
     406
    407407        char * src_filename = argv[1];
    408         char * cmdline = new char[strlen(argv[0]) + strlen(argv[1]) +1 +1]; 
     408        char * cmdline = new char[strlen(argv[0]) + strlen(argv[1]) +1 +1];
    409409        strcat(cmdline, argv[0]);
    410410        strcat(cmdline," ");
     
    421421        #endif
    422422
    423         // Read the entire file into a memory buffer   
     423        // Read the entire file into a memory buffer
    424424        FILE * src_file;
    425425        struct stat fileinfo;
    426426        int src_filesize;
    427427
    428         // open file and fstat 
     428        // open file and fstat
    429429        src_file = fopen ( src_filename , "rb" );
    430430        if (!src_file) {
    431                 fprintf(stderr, "Cannot open '%s'. Terminating the process ...\n", src_filename); 
     431                fprintf(stderr, "Cannot open '%s'. Terminating the process ...\n", src_filename);
    432432                exit(-1);
    433433        }
    434434        if(fstat(fileno(src_file), &fileinfo)!=0) {
    435                 fprintf(stderr, "Cannot fstat '%s'. Terminating the process ...\n", src_filename); 
     435                fprintf(stderr, "Cannot fstat '%s'. Terminating the process ...\n", src_filename);
    436436                exit(-1);
    437437        }
    438        
     438
    439439        src_filesize = fileinfo.st_size;
    440        
     440
    441441        // close file
    442442        fclose (src_file);
    443        
     443
    444444        for (int run = 0; run < REPEAT_RUNS; run++) {
    445445
     
    449449
    450450                parser = Parser_Interface::ParserFactory(src_filename);
    451        
    452                
     451
     452
    453453                if (!parser->has_ByteOrderMark()) printf("No ");
    454454                printf("Byte Order Mark found.\n");
    455        
     455
    456456                if (parser->get_version() == XML_1_0) printf("XML version 1.0 declared.\n");
    457457                else if (parser->get_version() == XML_1_1) printf("XML version 1.1 declared.\n");
     
    460460                        printf("XML encoding declared:  %s\n", parser->get_Encoding());
    461461                }
    462                 if (parser->standalone_status() == Standalone_yes) 
     462                if (parser->standalone_status() == Standalone_yes)
    463463                        printf("XML standalone = yes declared.\n");
    464                 else if (parser->standalone_status() == Standalone_no) 
     464                else if (parser->standalone_status() == Standalone_no)
    465465                        printf("XML standalone = no declared.\n");
    466466                else printf ("XML standalone = no by default.\n");
    467                
     467
    468468
    469469//              #ifdef PAPI
    470470//                      code_clocker->start_interval();
    471471//              #endif
    472                
     472
    473473                parser->Parse_Prolog();
    474474                parser->Parse_DocumentContent();
     
    485485
    486486        #ifdef PAPI
    487        
     487
    488488        #if defined(CODE_CLOCKING) and (CODE_CLOCKING == CHARSET_VALIDATION)
    489489                code_clocker->set_param("CODE_CLOCKING", "CHARSET_VALIDATION");
    490         #endif 
     490        #endif
    491491        #if defined(CODE_CLOCKING) and (CODE_CLOCKING == WS_CONTROL)
    492492                code_clocker->set_param("CODE_CLOCKING", "WS_CONTROL");
     
    534534                code_clocker->set_param("VALIDATION_MODE", "OFF");
    535535        #endif
    536        
     536
    537537                code_clocker->write_xml_file();
    538538                code_clocker->display_system_info();
    539539                code_clocker->display_raw_event_data();
    540540                delete code_clocker;
    541         #endif 
    542        
     541        #endif
     542
    543543        print_stats("comment", comment_count, comment_length);
    544544        print_stats("CDATA section", CDATA_end_count, CDATA_length);
     
    559559        printf("%i leaf nodes, %i interior nodes.\n", leaf_count, interior_count);
    560560#endif
    561        
     561
    562562        return(0);
    563563}
Note: See TracChangeset for help on using the changeset viewer.