Changeset 199 for branches


Ignore:
Timestamp:
Oct 16, 2008, 1:44:53 PM (10 years ago)
Author:
ksherdy
Message:

SVG Open 2008 version.

Location:
branches/gml2svg_parabix
Files:
1 edited
9 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/Makefile

    r172 r199  
    11CC= g++ $(CFLAGS)
    2 CFLAGS= -O3
     2CFLAGS= -O3 #-fprofile-use
    33
    44OS = $(shell uname)
     
    1414else
    1515    AFLAGS=-march=nocona -m64
    16     PAPI=-DPAPI -I/usr/local/papi-3.5.0-linux-x86/include -L/usr/local/papi-3.5.0-linux-x86/lib64 -lpapi
     16    PAPI=-DPAPI -I/usr/local/papi-3.5.0-linux-x86/include -L/usr/local/papi-3.5.0-linux-x86/lib64 -lpapi -I../code_clocker/clocker ../code_clocker/clocker/cc.o
    1717endif
     18
     19INCLUDES=-I../gml2svg_commons -I../style_ext_c
     20OBJECTS=../style_ext_c/style_ext.o ../gml2svg_commons/gml2svg_util.o ../gml2svg_commons/gml2svg_constants.o ../gml2svg_commons/vancouver_constants.o
     21PREDIRS=-DMORE -DMEMCPY_IO -DILAX_COORDS_TO_PATH #-DWORLD2SCREEN #-DSYSTEM_TIME #-DGML2SVG_DEBUG   
     22
     23gml2svg:        gml2svg.cxx src/byteplex.h src/multiliteral.h src/engine.h\
     24                src/bitlex.h src/byteplex.c src/bitlex.c src/engine.c\
     25                lib/lib_simd.h lib/sse_simd.h src/xmldecl.h src/xmldecl.c\
     26                src/bitplex.h src/bitplex.c src/xmlmodel.h src/xmlmodel.c\
     27                src/bytelex.h src/charsets/ASCII_EBCDIC.h
     28        $(CC) -o gml2svg gml2svg.cxx $(AFLAGS) $(INCLUDES) $(OBJECTS) $(PREDIRS) $(PAPI)
    1829
    1930markup_stats:   markup_stats.cxx src/byteplex.h src/multiliteral.h src/engine.h\
     
    2233                src/bitplex.h src/bitplex.c src/xmlmodel.h src/xmlmodel.c\
    2334                src/bytelex.h src/charsets/ASCII_EBCDIC.h
    24         $(CC) -o markup_stats markup_stats.cxx $(AFLAGS) -DCALC_AVG     
     35        $(CC) -o markup_stats markup_stats.cxx $(AFLAGS) $(PAPI) -DCALC_AVG     
    2536
    2637markup_stats_omp:       markup_stats.cxx src/byteplex.h src/multiliteral.h src/engine.h\
     
    4354
    4455clean: 
    45         rm -f markup_stats markup_stats_omp markup_stats_g4 cc_analyzer
     56        rm -f markup_stats markup_stats_omp markup_stats_g4 cc_analyzer gml2svg
  • branches/gml2svg_parabix/markup_stats.cxx

    r195 r199  
    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}
  • branches/gml2svg_parabix/src/engine.h

    r188 r199  
    4747        /* Co-classes */
    4848
    49         Byteplex * byteplex;   
     49        Byteplex * byteplex;
    5050        Bitplex * bitplex;
    5151        Lexer_Interface * lexer;
     
    5353        BytePack * x8data;
    5454        LexicalStreamSet * buf;
    55                
     55
    5656        int buffer_base_pos;
    5757        int buffer_rel_pos;
    5858        int buffer_limit_pos;
    59        
     59
    6060};
    6161
     
    7171        vector<int> LastAttOccurrence;
    7272        XML_Decl_Parser<B::Base> * decl_parser;
    73        
     73
    7474        int text_or_markup_start;
    7575        /* Getters for current point/position information. */
     
    9494        void Validity_Error (XML_Constraint errCode);
    9595        void Syntax_Error (XML_NonTerminal errNT);
    96        
     96
    9797        void Parse_Comment ();
    9898        void Parse_StartTag ();
     
    100100        void Parse_CDATA ();
    101101        void Parse_PI ();
    102         void Parse_CharRef (); 
     102        void Parse_CharRef ();
    103103        void Parse_EntityRef ();
    104104        void Parse_EntityRef_inMixed(symbol_set_t elems);
    105105        void Parse_EntityRef_inAnyContent();
    106        
     106
    107107        /* Parsing routine for Document Type*/
    108108        void Parse_DocType ();
     
    130130        void Parse_Prolog();
    131131        void Parse_DocumentContent();
    132        
     132
    133133        void Parse_WF_Element();
    134134        void Parse_WF_Content();
     
    141141        void Parse_AnyContent();
    142142        void Parse_MixedContent(symbol_set_t elems);
    143        
     143
    144144        int Parse_ValidStartTag(bool& is_empty);
    145        
     145
    146146        int Parse_Nmtoken();
    147         int Parse_Name(); 
    148        
     147        int Parse_Name();
     148
    149149        /*Parsing routine for external entities*/
    150150        void Parse_ExtSubsetDecl ();
    151        
     151
    152152        /* Action routine for document start. */
    153         void DocumentStart_action();   
    154        
     153        void DocumentStart_action();
     154
    155155        /* Action routine for document end. */
    156156        void DocumentEnd_action();
    157        
     157
    158158        /* Action routine for an XML comment in "<!--"  "-->" brackets. */
    159159        void Comment_action(unsigned char * item, int lgth);
    160        
     160
    161161        /* Action routine called upon recognizing "<![CDATA[" to start a CDATA section. */
    162162        void CDATA_start_action(unsigned char * CDATA_ptr);
     
    164164        /* Action routine called upon recognizing "]]>" to end a CDATA section. */
    165165        void CDATA_end_action(unsigned char * CDATA_end_ptr);
    166        
     166
    167167        /* Action routine for an XML processing instruction enclosed in "<?" and "?>" brackets. */
    168168        void PI_action(unsigned char * item, int lgth);
    169        
     169
    170170        /* Action routine for an empty element enclosed in "<" and "/>" brackets. */
    171171        void EmptyElement_action(unsigned char * item, int lgth);
    172        
     172
    173173        /* Action routine for a start tag enclosed in "<" and ">" brackets. */
    174174        void StartTag_action(unsigned char * item, int lgth);
    175        
     175
    176176        /* Action routine for an end tag enclosed in "</" and ">" brackets. */
    177177        void EndTag_action(unsigned char * item, int lgth);
    178        
     178
    179179        /* Action routine for an error item */
    180180        void Error_action(unsigned char * item, int lgth);
    181        
     181
    182182        /* Action routine for a text item */
    183183        void Text_action(unsigned char * item, int lgth, bool more);
    184        
     184
    185185        /* Action routine for a character or entity reference.*/
    186186        void Reference_action(unsigned char * item, int lgth);
    187        
    188         /* Action routine for an element name occurring immediately after the 
     187
     188        /* Action routine for an element name occurring immediately after the
    189189        opening "<" of a start tag or empty element tag. */
    190190        void ElementName_action(unsigned char * item, int lgth);
    191        
    192         /* Action routine for a processing instruction target name occurring immediately 
     191
     192        /* Action routine for a processing instruction target name occurring immediately
    193193        after the opening "<?" of a processing instruction. */
    194194        void PI_Target_action(unsigned char * item, int lgth);
    195        
     195
    196196        /* Action routine for an individual attribute/value pair occurring in
    197197        a element start tag or an empty element tag. */
    198         void AttributeValue_action(unsigned char * name, int name_lgth, 
     198        void AttributeValue_action(unsigned char * name, int name_lgth,
    199199                                   unsigned char * val, int val_lgth);
    200        
     200
    201201        /* Action routine for an individual namespace binding occurring in
    202202        a element start tag or an empty element tag. */
    203         void Namespace_action(unsigned char * name, int name_end, 
     203        void Namespace_action(unsigned char * name, int name_end,
    204204                              unsigned char * URI, int URI_end);
    205        
     205
    206206        /*Action routine for end of buffer events. */
    207207        void FinalizeBuffer_action();
    208        
     208
    209209        /*Document Type actions.*/
    210210        void Doctype_action(unsigned char * item, int lgth);
    211211        void PEReference_action(unsigned char * item, int lgth);
    212        
     212
    213213        void Prolog_action(unsigned char * item, int lgth);
    214        
     214
    215215        void ExtSubsetDecl_action(unsigned char * item, int lgth);
     216
     217        void ilax_coords_to_path(char ts, char cs, char decimal);
    216218};
    217219
Note: See TracChangeset for help on using the changeset viewer.