Ignore:
Timestamp:
Aug 21, 2010, 11:10:19 AM (9 years ago)
Author:
lindanl
Message:

name space checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/parabix2_compilable.py

    r591 r593  
    399399        #CD_end_error = validate_no_CD_end(lex, CT_callouts, callouts)
    400400        CD_end_error = lex.CD_end & ~(CT_callouts.CtCDPI_mask | callouts.Tags)
    401 
    402 
    403         # Consolidate and check for errors
    404         error_mask = u8.error | xmlchar_error | CT_callouts.error | callouts.error | CD_end_error | refs.error
    405 
    406        
     401       
     402
     403       
     404        #name and name start checking streams
    407405        qname_stream =  callouts.ElemNames | callouts.AttNames
    408406        ncname_stream = CT_callouts.PI_name | refs.GenRefs
     
    411409        name_start_check = name_start & ~lex.ASCII_name_start
    412410        name_check = (name_stream &~ name_start) & ~lex.ASCII_name_char & ~u8.suffix
     411       
     412        #namespace validation
     413        name_cursor = name_stream & ~bitutil.Advance(name_stream)
     414        void_prefix_err = name_cursor & lex.Colon
     415        namespace_sep = bitutil.ScanThru(name_cursor, lex.NameScan &~ lex.Colon) & lex.Colon
     416        local_part_start = bitutil.Advance(namespace_sep)
     417        local_part_err = local_part_start &~ lex.NameScan
     418        colon2_err = bitutil.ScanThru(local_part_start, lex.NameScan &~ lex.Colon) & lex.Colon
     419        ncname_err = ncname_stream & lex.Colon
     420        namespace_error = void_prefix_err | local_part_err | colon2_err | ncname_err
     421       
     422       
     423        # Consolidate and check for errors
     424        error_mask = u8.error | xmlchar_error | CT_callouts.error | callouts.error | CD_end_error | refs.error | namespace_error
     425
    413426
    414427        #return (CT_callouts, callouts, refs, u16hi, u16lo, delmask, error, lex, u16delmask, EOF_mask)
Note: See TracChangeset for help on using the changeset viewer.