Changeset 916


Ignore:
Timestamp:
Feb 14, 2011, 11:23:14 AM (8 years ago)
Author:
lindanl
Message:

Create a Do_check_streams pass.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/parabix2_pablo.py

    r913 r916  
    521521        check_streams.non_ascii_name_starts = name_start &~lex.ASCII_name_start
    522522        check_streams.non_ascii_names = (name_stream &~ name_start) & ~lex.ASCII_name_char & ~u8.suffix
    523 
    524 def Main(basis_bits, lex, u8, xml_char, scope1, ctCDPI_Callouts, ref_Callouts, tag_Callouts, xml_names, check_streams):
     523   
     524def Do_check_streams(ctCDPI_Callouts, tag_Callouts, lex, u8, scope1, ref_Callouts, xml_names, check_streams):
     525    # Ensure that no occurrence of ]]> occurs outside of markup.
     526    CD_end_error = ctCDPI_Callouts.CD_end & ~(ctCDPI_Callouts.CtCDPI_mask | tag_Callouts.AttVal_spans)
     527           
     528    # Consolidate and check for errors
     529    check_streams.error_mask = lex.error & EOF_mask | u8.error | u8.FFFE_FFFF | ctCDPI_Callouts.error | tag_Callouts.error | CD_end_error | ref_Callouts.error | xml_names.namespace_error
     530
     531    check_streams.tag_marks = tag_Callouts.EmptyTag_marks | tag_Callouts.LAngleFollow | tag_Callouts.AttName_starts
     532    check_streams.name_follows = tag_Callouts.ElemName_ends | tag_Callouts.AttName_ends
     533    check_streams.att_refs = tag_Callouts.AttVal_spans & scope1.RefStart
     534   
     535   
     536#def main(basis_bits, lex, u8, scope1, ctCDPI_Callouts, masks, check_streams, tag_Callouts, ref_Callouts, xml_names):
     537def Main(basis_bits, lex, u8, xml_char, scope1, ctCDPI_Callouts, ref_Callouts, tag_Callouts, masks, xml_names, check_streams): 
    525538       
    526539        # Classify bytes for UTF-8 processing, whitespace and control
     
    544557        Parse_refs(lex, scope1, ctCDPI_Callouts, ref_Callouts)
    545558       
    546         # Ensure that no occurrence of ]]> occurs outside of markup.
    547         CD_end_error = ctCDPI_Callouts.CD_end & ~(ctCDPI_Callouts.CtCDPI_mask | tag_Callouts.AttVal_spans)
    548        
    549559        # Validate XML namespaces and generate bit streams to post validate non-ascii range XML names
    550560        Validate_xml_names(ctCDPI_Callouts, ref_Callouts, tag_Callouts, lex, u8, xml_names, check_streams)
     561   
     562   
     563        Do_check_streams(ctCDPI_Callouts, tag_Callouts, lex, u8, scope1, ref_Callouts, xml_names, check_streams)
     564
    551565               
    552         # Consolidate and check for errors
    553         check_streams.error_mask = lex.error & EOF_mask | u8.error | u8.FFFE_FFFF | ctCDPI_Callouts.error | tag_Callouts.error | CD_end_error | ref_Callouts.error | xml_names.namespace_error
    554 
    555         check_streams.tag_marks = tag_Callouts.EmptyTag_marks | tag_Callouts.LAngleFollow | tag_Callouts.AttName_starts
    556         check_streams.name_follows = tag_Callouts.ElemName_ends | tag_Callouts.AttName_ends
    557         check_streams.att_refs = tag_Callouts.AttVal_spans & scope1.RefStart           
Note: See TracChangeset for help on using the changeset viewer.