Changeset 584 for proto


Ignore:
Timestamp:
Aug 19, 2010, 4:58:41 PM (9 years ago)
Author:
lindanl
Message:

check for undefined reference

Location:
proto/parabix2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/parabix2_compilable.py

    r582 r584  
    361361        refs.GenRefs = 0
    362362        refs.error = 0
     363        GenRef2 = 0
    363364        Ref1 = lex.RefStart &~ CT_callouts.CtCDPI_mask
    364365        if Ref1:
     
    408409        tag_marks = callouts.EmptyTagMarks | LAngleFollow | AttNameStarts
    409410        NameFollows = ElemNameFollows | AttNameFollows
    410         return (CT_callouts, callouts, refs, error, lex, EOF_mask, name_check, name_start_check, control, tag_marks, NameFollows, CD_starts)
    411 
    412        
     411        return (CT_callouts, callouts, refs, error, lex, EOF_mask, name_check, name_start_check, control, tag_marks, NameFollows, CD_starts, GenRef2)
     412
     413       
  • proto/parabix2/src/bytelex.h

    r579 r584  
    401401inline bool at_xml(unsigned char x8data[]) {
    402402  return (s4int32(x8data) == c4int32<C, '?', 'x', 'm', 'l'>::value);
     403}
     404
     405template<CodeUnit_Base C>
     406inline bool at_Ref_gt(unsigned char x8data[]) {
     407        return s3int32(x8data) == c3int32<C, 'g', 't', ';'>::value;
     408}
     409
     410template<CodeUnit_Base C>
     411inline bool at_Ref_lt(unsigned char x8data[]) {
     412        return s3int32(x8data) == c3int32<C, 'l', 't', ';'>::value;
     413}
     414
     415template<CodeUnit_Base C>
     416inline bool at_Ref_amp(unsigned char x8data[]) {
     417  return (s4int32(x8data) == c4int32<C, 'a', 'm', 'p', ';'>::value);
     418}
     419
     420template<CodeUnit_Base C>
     421inline bool at_Ref_quot(unsigned char x8data[]) {
     422        return s5int64(x8data) == c5int64<C, 'q', 'u', 'o', 't', ';'>::value;
     423}
     424
     425template<CodeUnit_Base C>
     426inline bool at_Ref_apos(unsigned char x8data[]) {
     427        return s5int64(x8data) == c5int64<C, 'a', 'p', 'o', 's', ';'>::value;
    403428}
    404429
  • proto/parabix2/template_tag_match.c

    r582 r584  
    175175        if (!at_CDATA1<ASCII>((unsigned char*)&source[block_pos])){
    176176              fprintf(stderr, "CDATA error found at position %i\n",block_pos+buffer_base);
     177              exit(-1);
     178        }
     179        return 0;
     180}
     181
     182static inline int GenRef_check(int pos) {
     183        int block_pos = block_base + pos;
     184        unsigned char* s = (unsigned char*)&source[block_pos];
     185        if (!(at_Ref_gt<ASCII>(s)||at_Ref_lt<ASCII>(s)||at_Ref_amp<ASCII>(s)||at_Ref_quot<ASCII>(s)||at_Ref_apos<ASCII>(s))){
     186              fprintf(stderr, "Undefined Reference found at position %i\n",block_pos+buffer_base);
    177187              exit(-1);
    178188        }
     
    341351        }
    342352       
     353        if (bitblock_has_bit(GenRef2)){
     354          StreamScan((ScanBlock *) &GenRef2, sizeof(BitBlock)/sizeof(ScanBlock), GenRef_check);
     355        }
     356       
    343357        t.store_streams(tag_marks, NameFollows);
    344358       
     
    383397        if (bitblock_has_bit(CD_starts)){
    384398          StreamScan((ScanBlock *) &CD_starts, sizeof(BitBlock)/sizeof(ScanBlock), CD_check);
     399        }
     400       
     401        if (bitblock_has_bit(GenRef2)){
     402          StreamScan((ScanBlock *) &GenRef2, sizeof(BitBlock)/sizeof(ScanBlock), GenRef_check);
    385403        }
    386404       
Note: See TracChangeset for help on using the changeset viewer.