Ignore:
Timestamp:
Sep 14, 2011, 5:43:40 PM (8 years ago)
Author:
vla24
Message:

SymbolTable?: Fixed integration with IDISA, it does not work well for pbgs_log and pbgs_id_adv. Changed bitutil.* to pablo.* for compiler generated files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/SymbolTable/parabix2_symtab_pbs_log.py

    r1232 r1442  
    261261                u8.badprefix = (temp68 | temp71);
    262262                u8_error = u8.badprefix
    263                 u8.scope22 = bitutil.Advance(u8.prefix2)
     263                u8.scope22 = pablo.Advance(u8.prefix2)
    264264                u8anyscope = u8.scope22
    265265                if u8.prefix3 | u8.prefix4:
     
    277277                        u8.xBF = (temp73 & temp23);
    278278                        u8.xBE = (temp73 & temp15);
    279                         u8.xE0_scope = bitutil.Advance(xE0);
    280                         u8.xED_scope = bitutil.Advance(xED);
    281                         u8.xF0_scope = bitutil.Advance(xF0);
    282                         u8.xF4_scope = bitutil.Advance(xF4);
    283                         u8.xEF_scope = bitutil.Advance(xEF);
    284                         u8.scope32 = bitutil.Advance(u8.prefix3)
    285                         u8.scope33 = bitutil.Advance(u8.scope32)
    286                         u8.scope42 = bitutil.Advance(u8.prefix4)
    287                         u8.scope43 = bitutil.Advance(u8.scope42)
    288                         u8.scope44 = bitutil.Advance(u8.scope43)
     279                        u8.xE0_scope = pablo.Advance(xE0);
     280                        u8.xED_scope = pablo.Advance(xED);
     281                        u8.xF0_scope = pablo.Advance(xF0);
     282                        u8.xF4_scope = pablo.Advance(xF4);
     283                        u8.xEF_scope = pablo.Advance(xEF);
     284                        u8.scope32 = pablo.Advance(u8.prefix3)
     285                        u8.scope33 = pablo.Advance(u8.scope32)
     286                        u8.scope42 = pablo.Advance(u8.prefix4)
     287                        u8.scope43 = pablo.Advance(u8.scope42)
     288                        u8.scope44 = pablo.Advance(u8.scope43)
    289289
    290290                        u8lastscope = u8.scope22 | u8.scope33 | u8.scope44
     
    298298                        u8_error |= u8error1 | u8error2 | u8error3 | u8error4
    299299
    300                         EF_BF_pending = bitutil.Advance(u8.xEF_scope & u8.xBF)
     300                        EF_BF_pending = pablo.Advance(u8.xEF_scope & u8.xBF)
    301301
    302302                        u8_FFFE_FFFF = (EF_BF_pending & (u8.xBE | u8.xBF))
     
    308308
    309309def Add_scope_streams(lex, scope1):
    310         #scope1.LAngle = bitutil.Advance(lex.LAngle)
    311         #scope1.Hyphen = bitutil.Advance(lex.Hyphen)
    312         #scope1.QMark = bitutil.Advance(lex.QMark)
     310        #scope1.LAngle = pablo.Advance(lex.LAngle)
     311        #scope1.Hyphen = pablo.Advance(lex.Hyphen)
     312        #scope1.QMark = pablo.Advance(lex.QMark)
    313313        v = lex.LAngle | lex.Hyphen
    314314        w = lex.Hyphen | lex.QMark
    315         v1 = bitutil.Advance(v)
    316         w1 = bitutil.Advance(w)
     315        v1 = pablo.Advance(v)
     316        w1 = pablo.Advance(w)
    317317        scope1.LAngle = v1 &~ w1
    318318        scope1.Hyphen = v1 & w1
     
    336336
    337337        if lex.RBracket:
    338                 scope1.RBracket = bitutil.Advance(lex.RBracket)
    339                 ctCDPI_Callouts.CD_end = bitutil.Advance(scope1.RBracket & lex.RBracket) & lex.RAngle
     338                scope1.RBracket = pablo.Advance(lex.RBracket)
     339                ctCDPI_Callouts.CD_end = pablo.Advance(scope1.RBracket & lex.RBracket) & lex.RAngle
    340340        PI_start = scope1.LAngle & lex.QMark
    341341        CtCD_start = scope1.LAngle & lex.Exclam
     
    348348        #
    349349        # Initiate the scan
    350         CtCDPI_Cursor = bitutil.ScanToFirst(CtCDPI_start)
     350        CtCDPI_Cursor = pablo.ScanToFirst(CtCDPI_start)
    351351        while CtCDPI_Cursor:
    352352                CtCDPI_starts |= CtCDPI_Cursor
    353353                PI_Cursor = CtCDPI_Cursor & PI_start
    354                 CD_Ct_Cursor = bitutil.Advance(CtCDPI_Cursor & ~PI_Cursor)
     354                CD_Ct_Cursor = pablo.Advance(CtCDPI_Cursor & ~PI_Cursor)
    355355                CD_Cursor = CD_Ct_Cursor & lex.LBracket
    356356                Ct_Cursor = CD_Ct_Cursor & lex.Hyphen
     
    358358                ctCDPI_Callouts.CD_starts |= CD_Cursor
    359359                ctCDPI_Callouts.Ct_starts |= Ct_Cursor
    360                 Ct_Cursor = bitutil.Advance(Ct_Cursor)
     360                Ct_Cursor = pablo.Advance(Ct_Cursor)
    361361                Ct_errors |= Ct_Cursor & ~ lex.Hyphen
    362362                # Advance twice past <!--, so that we don't treat <!---
    363363                # as being a terminated comment.
    364                 Ct_Cursor = bitutil.Advance(bitutil.Advance(Ct_Cursor))
    365                 PI_Cursor = bitutil.Advance(PI_Cursor)
     364                Ct_Cursor = pablo.Advance(pablo.Advance(Ct_Cursor))
     365                PI_Cursor = pablo.Advance(PI_Cursor)
    366366                ctCDPI_Callouts.PI_name_starts |= PI_Cursor
    367                 PI_name_end = bitutil.ScanThru(PI_Cursor, lex.NameScan)
     367                PI_name_end = pablo.ScanThru(PI_Cursor, lex.NameScan)
    368368                ctCDPI_Callouts.PI_name_ends |= PI_name_end
    369                 PI_Cursor = bitutil.ScanTo(PI_name_end, PI_end)
    370                 CD_Cursor = bitutil.ScanTo(CD_Cursor, ctCDPI_Callouts.CD_end)
    371                 Ct_Cursor = bitutil.Advance(bitutil.ScanTo(Ct_Cursor, DoubleHyphen))
     369                PI_Cursor = pablo.ScanTo(PI_name_end, PI_end)
     370                CD_Cursor = pablo.ScanTo(CD_Cursor, ctCDPI_Callouts.CD_end)
     371                Ct_Cursor = pablo.Advance(pablo.ScanTo(Ct_Cursor, DoubleHyphen))
    372372                ctCDPI_Callouts.PI_ends |= PI_Cursor
    373373                ctCDPI_Callouts.CD_ends |= CD_Cursor
    374374                ctCDPI_Callouts.Ct_ends |= Ct_Cursor
    375375                CtCDPI_Cursor = PI_Cursor | CD_Cursor | Ct_Cursor
    376                 CtCDPI_Cursor = bitutil.ScanTo(CtCDPI_Cursor, CtCDPI_start)
    377 
    378                 ctCDPI_Callouts.CtCDPI_mask = bitutil.Advance(ctCDPI_Callouts.CD_ends | ctCDPI_Callouts.Ct_ends | ctCDPI_Callouts.PI_ends) - CtCDPI_starts
     376                CtCDPI_Cursor = pablo.ScanTo(CtCDPI_Cursor, CtCDPI_start)
     377
     378                ctCDPI_Callouts.CtCDPI_mask = pablo.Advance(ctCDPI_Callouts.CD_ends | ctCDPI_Callouts.Ct_ends | ctCDPI_Callouts.PI_ends) - CtCDPI_starts
    379379                #ctCDPI_Callouts.error = Ct_ends & ~lex.RAngle | Ct_starts & ~ lex.Hyphen
    380380                ctCDPI_error = Ct_errors | ctCDPI_Callouts.Ct_ends & ~lex.RAngle
    381                 ctCDPI_error |= bitutil.Advance(ctCDPI_Callouts.PI_name_ends & ~ lex.WS) & ~ PI_end
     381                ctCDPI_error |= pablo.Advance(ctCDPI_Callouts.PI_name_ends & ~ lex.WS) & ~ PI_end
    382382                ctCDPI_error |= ctCDPI_Callouts.PI_name_starts & ctCDPI_Callouts.PI_name_ends
    383383                # If any of the Comment, CDATA or PI markups are unterminated, it is an error.
     
    387387                error_tracker.NoteError("Error in comment, CDATA or processing instruction syntax", ctCDPI_error)
    388388
    389         check_streams.misc_mask = (lex.WS | lex.LAngle | (bitutil.Advance(ctCDPI_Callouts.Ct_ends | ctCDPI_Callouts.PI_ends) - (ctCDPI_Callouts.Ct_starts | ctCDPI_Callouts.PI_starts)) | CtCDPI_starts) & EOF_mask
     389        check_streams.misc_mask = (lex.WS | lex.LAngle | (pablo.Advance(ctCDPI_Callouts.Ct_ends | ctCDPI_Callouts.PI_ends) - (ctCDPI_Callouts.Ct_starts | ctCDPI_Callouts.PI_starts)) | CtCDPI_starts) & EOF_mask
    390390
    391391def Parse_tags(lex, scope1, ctCDPI_Callouts, tag_Callouts):
     
    406406
    407407        # Advance all cursors by scanning through the tag name.
    408         tag_Callouts.ElemName_ends = bitutil.ScanThru(tag_Callouts.ElemName_starts, lex.NameScan)
     408        tag_Callouts.ElemName_ends = pablo.ScanThru(tag_Callouts.ElemName_starts, lex.NameScan)
    409409        # Must have at least one name character for a legal start tag.
    410410        # Mark any occurrences of null names as errors.
     
    420420
    421421        # After the element name, there may or may not be an attlist.
    422         AfterWS = bitutil.ScanThru(tag_Callouts.ElemName_ends, lex.WS)
     422        AfterWS = pablo.ScanThru(tag_Callouts.ElemName_ends, lex.WS)
    423423        AttListEnd = AfterWS & AttListDelim
    424424        AttNameStart = AfterWS & ~AttListDelim
     
    433433        while AttNameStart:
    434434                tag_Callouts.AttName_starts |= AttNameStart
    435                 AttNameFollow = bitutil.ScanThru(AttNameStart, lex.NameScan)
     435                AttNameFollow = pablo.ScanThru(AttNameStart, lex.NameScan)
    436436                tag_Callouts.AttName_ends |= AttNameFollow
    437437                # Scan through WS to the expected '=' delimiter.
    438                 # EqExpected = bitutil.ScanThru(AttNameFollow, lex.WS)
     438                # EqExpected = pablo.ScanThru(AttNameFollow, lex.WS)
    439439                # But use if test to optimize.
    440440                if AttNameFollow & lex.WS:
    441                         EqExpected = bitutil.ScanThru(AttNameFollow, lex.WS)
     441                        EqExpected = pablo.ScanThru(AttNameFollow, lex.WS)
    442442                else: EqExpected = AttNameFollow
    443443                EqToCheck |= EqExpected
    444                 AttValPos = bitutil.ScanThru(EqExpected, EqExpected | lex.WS)
     444                AttValPos = pablo.ScanThru(EqExpected, EqExpected | lex.WS)
    445445                tag_Callouts.AttVal_starts |= AttValPos
    446446                DQuoteAttVal = AttValPos & lex.DQuote
    447447                SQuoteAttVal = AttValPos & lex.SQuote
    448                 DQuoteAttEnd = bitutil.ScanTo(DQuoteAttVal, DQuoteDelim &~ DQuoteAttVal)
    449                 SQuoteAttEnd = bitutil.ScanTo(SQuoteAttVal, SQuoteDelim &~ SQuoteAttVal)
     448                DQuoteAttEnd = pablo.ScanTo(DQuoteAttVal, DQuoteDelim &~ DQuoteAttVal)
     449                SQuoteAttEnd = pablo.ScanTo(SQuoteAttVal, SQuoteDelim &~ SQuoteAttVal)
    450450                AttValEnd = DQuoteAttEnd | SQuoteAttEnd
    451451                AttValEnds |= AttValEnd
    452                 AttValFollow = bitutil.Advance(AttValEnd)
     452                AttValFollow = pablo.Advance(AttValEnd)
    453453                tag_Callouts.AttVal_ends |= AttValFollow
    454                 #  AfterWS = bitutil.ScanThru(AttValFollow, lex.WS)
     454                #  AfterWS = pablo.ScanThru(AttValFollow, lex.WS)
    455455                if AttValFollow & lex.WS:
    456                         AfterWS = bitutil.ScanThru(AttValFollow, lex.WS)
     456                        AfterWS = pablo.ScanThru(AttValFollow, lex.WS)
    457457                else: AfterWS = AttValFollow
    458                 AfterWS = bitutil.ScanThru(AttValFollow, lex.WS)
     458                AfterWS = pablo.ScanThru(AttValFollow, lex.WS)
    459459                AttListEnd |= AfterWS & AttListDelim
    460460                AttNameStart = AfterWS & ~AttListDelim
     
    463463        STagEnds = AttListEnd & lex.RAngle
    464464        # Mark any "/" characters found as the ends of empty element tags.
    465         tag_Callouts.EmptyTag_marks = bitutil.Advance(AttListEnd & lex.Slash)
     465        tag_Callouts.EmptyTag_marks = pablo.Advance(AttListEnd & lex.Slash)
    466466
    467467        # Check for errors.
     
    475475        # End Tag Parsing
    476476
    477         EndTagEnds = bitutil.ScanThru(tag_Callouts.EndTag_marks, tag_Callouts.EndTag_marks | lex.NameScan)
     477        EndTagEnds = pablo.ScanThru(tag_Callouts.EndTag_marks, tag_Callouts.EndTag_marks | lex.NameScan)
    478478        if EndTagEnds & lex.WS:
    479                 EndTagEnds = bitutil.ScanThru(EndTagEnds, lex.WS)
     479                EndTagEnds = pablo.ScanThru(EndTagEnds, lex.WS)
    480480        ParseError |= EndTagEnds & ~lex.RAngle
    481481        if ParseError:
     
    498498        # All remaining "&" must be reference start characters; parse them.
    499499        if Ref1:
    500                 scope1.RefStart = bitutil.Advance(Ref1)
     500                scope1.RefStart = pablo.Advance(Ref1)
    501501                NumRef2 = scope1.RefStart & lex.Hash
    502502                ref_Callouts.GenRef_starts = scope1.RefStart &~ lex.Hash
    503                 NumRef3 = bitutil.Advance(NumRef2)
     503                NumRef3 = pablo.Advance(NumRef2)
    504504                HexRef3 = NumRef3 & lex.x
    505505                ref_Callouts.DecRef_starts = NumRef3 &~ lex.x
    506                 ref_Callouts.HexRef_starts = bitutil.Advance(HexRef3)
    507                 ref_Callouts.GenRef_ends = bitutil.ScanThru(ref_Callouts.GenRef_starts, lex.NameScan)
    508                 ref_Callouts.DecRef_ends = bitutil.ScanThru(ref_Callouts.DecRef_starts, lex.Digit)
    509                 ref_Callouts.HexRef_ends = bitutil.ScanThru(ref_Callouts.HexRef_starts, lex.Hex)
     506                ref_Callouts.HexRef_starts = pablo.Advance(HexRef3)
     507                ref_Callouts.GenRef_ends = pablo.ScanThru(ref_Callouts.GenRef_starts, lex.NameScan)
     508                ref_Callouts.DecRef_ends = pablo.ScanThru(ref_Callouts.DecRef_starts, lex.Digit)
     509                ref_Callouts.HexRef_ends = pablo.ScanThru(ref_Callouts.HexRef_starts, lex.Hex)
    510510                # Error checks
    511511                # At least one digit required for DecRef, one hex digit for HexRef.
     
    529529        ncname_stream = PI_names | GenRefs
    530530        name_stream = qname_stream | ncname_stream
    531         name_start = name_stream &~ bitutil.Advance(name_stream)
    532         name_cursor = name_stream & ~bitutil.Advance(name_stream)
     531        name_start = name_stream &~ pablo.Advance(name_stream)
     532        name_cursor = name_stream & ~pablo.Advance(name_stream)
    533533        void_prefix_err = name_cursor & lex.Colon
    534         namespace_sep = bitutil.ScanThru(name_cursor, lex.NameScan &~ lex.Colon) & lex.Colon
    535         local_part_start = bitutil.Advance(namespace_sep)
     534        namespace_sep = pablo.ScanThru(name_cursor, lex.NameScan &~ lex.Colon) & lex.Colon
     535        local_part_start = pablo.Advance(namespace_sep)
    536536        local_part_err = local_part_start &~ lex.NameScan
    537         colon2_err = bitutil.ScanThru(local_part_start, lex.NameScan &~ lex.Colon) & lex.Colon
     537        colon2_err = pablo.ScanThru(local_part_start, lex.NameScan &~ lex.Colon) & lex.Colon
    538538        ncname_err = ncname_stream & lex.Colon
    539539        namespace_error = void_prefix_err | local_part_err | colon2_err | ncname_err
     
    564564
    565565    # Group symbols of length 1
    566     starts_1 = bitutil.Advance(starts)
     566    starts_1 = pablo.Advance(starts)
    567567    tag_Callouts.ElemName_ends_1 = starts_1 & remaining_ends
    568568    remaining_ends = remaining_ends & ~tag_Callouts.ElemName_ends_1
    569569
    570570    # Group symbols of length 2
    571     starts_2 = bitutil.Advance(starts_1)
     571    starts_2 = pablo.Advance(starts_1)
    572572    tag_Callouts.ElemName_ends_2 = starts_2 & remaining_ends
    573573    remaining_ends = remaining_ends & ~tag_Callouts.ElemName_ends_2
     
    575575    # Group symbols of length 3_to_4
    576576    temp = starts_1 | starts_2
    577     temp32 = bitutil.Advance32(temp)
    578     #starts_3_to_4 = bitutil.Advance(bitutil.Advance(temp))
     577    temp32 = pablo.Advance32(temp)
     578    #starts_3_to_4 = pablo.Advance(pablo.Advance(temp))
    579579    starts_3_to_4 = interpose32 (temp, temp32, 2)
    580580    tag_Callouts.ElemName_ends_3_to_4 = starts_3_to_4 & remaining_ends
     
    583583    # Group symbols of length 5_to_8
    584584    temp = temp | starts_3_to_4
    585     temp32 = bitutil.Advance32(temp)
    586     #starts_5_to_8 = bitutil.Advance(bitutil.Advance(bitutil.Advance(bitutil.Advance(temp))))
     585    temp32 = pablo.Advance32(temp)
     586    #starts_5_to_8 = pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(temp))))
    587587    starts_5_to_8 = interpose32 (temp, temp32, 4)
    588588    tag_Callouts.ElemName_ends_5_to_8 = starts_5_to_8 & remaining_ends
     
    591591    # Group symbols of length 9_to_16
    592592    temp = temp | starts_5_to_8
    593     temp32 = bitutil.Advance32 (temp)
    594     #starts_9_to_16 = bitutil.Advance(bitutil.Advance(bitutil.Advance(bitutil.Advance(bitutil.Advance(bitutil.Advance(bitutil.Advance(bitutil.Advance(temp))))))))
     593    temp32 = pablo.Advance32 (temp)
     594    #starts_9_to_16 = pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(pablo.Advance(temp))))))))
    595595    starts_9_to_16 = interpose32 (temp, temp32, 8)
    596596    tag_Callouts.ElemName_ends_9_to_16 = starts_9_to_16 & remaining_ends
Note: See TracChangeset for help on using the changeset viewer.