Changeset 859 for proto/parabix2


Ignore:
Timestamp:
Jan 2, 2011, 8:39:35 AM (9 years ago)
Author:
cameron
Message:

Unify XML scope streams into Scope1 class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/parabix2_pablo.py

    r858 r859  
    4545  error = 0
    4646
    47 class Lex ():
     47class Lex (BitStreamSet):
    4848  x00_x1F = 0
    4949  CR = 0
     
    8080  DoubleHyphen = 0
    8181  PI_end = 0
    82   LAngle_scope = 0
    83   Hyphen_scope = 0
    84   QMark_scope = 0
    85   RBracket_scope = 0
    8682  CtCDPI_start = 0
     83
     84class Scope1 (BitStreamSet):
     85  RefStart = 0
     86  LAngle = 0
     87  Hyphen = 0
     88  QMark = 0
     89  RBracket = 0
    8790
    8891class cT_callouts:
     
    280283        xmlchar_error |= FFFE_FFFF
    281284
    282         lex.LAngle_scope = bitutil.Advance(lex.LAngle)
    283         lex.Hyphen_scope = bitutil.Advance(lex.Hyphen)
    284         lex.QMark_scope = bitutil.Advance(lex.QMark)
     285        scope1.LAngle = bitutil.Advance(lex.LAngle)
     286        scope1.Hyphen = bitutil.Advance(lex.Hyphen)
     287        scope1.QMark = bitutil.Advance(lex.QMark)
    285288
    286289        lex.CD_end = 0
    287290        if lex.RBracket:
    288                 lex.RBracket_scope = bitutil.Advance(lex.RBracket)
    289                 lex.CD_end = bitutil.Advance(lex.RBracket_scope & lex.RBracket) & lex.RAngle
     291                scope1.RBracket = bitutil.Advance(lex.RBracket)
     292                lex.CD_end = bitutil.Advance(scope1.RBracket & lex.RBracket) & lex.RAngle
    290293
    291294        # Compute XML multilterals such as <?, </, --, ]]>.
    292295        #lex = add_multiliterals(lex)
    293         lex.PI_start = lex.LAngle_scope & lex.QMark
    294         lex.CtCD_start = lex.LAngle_scope & lex.Exclam
     296        lex.PI_start = scope1.LAngle & lex.QMark
     297        lex.CtCD_start = scope1.LAngle & lex.Exclam
    295298        lex.CtCDPI_start = lex.PI_start | lex.CtCD_start
    296         lex.EndTag_start = lex.LAngle_scope & lex.Slash
     299        lex.EndTag_start = scope1.LAngle & lex.Slash
    297300
    298301        #if lex.CtCDPI_start:
    299         lex.DoubleHyphen = lex.Hyphen_scope & lex.Hyphen
    300         lex.PI_end = lex.QMark_scope & lex.RAngle
     302        lex.DoubleHyphen = scope1.Hyphen & lex.Hyphen
     303        lex.PI_end = scope1.QMark & lex.RAngle
    301304
    302305       
     
    382385        # Start the parallel parsing by inspecting the character
    383386        # after the opening "<" of a tag.
    384         LAngleFollow = lex.LAngle_scope &~ cT_callouts.CtCDPI_mask
     387        LAngleFollow = scope1.LAngle &~ cT_callouts.CtCDPI_mask
    385388        ElemNamePositions = LAngleFollow & ~lex.Slash
    386389        EndTagSeconds = LAngleFollow & lex.Slash
     
    474477        Ref1 = lex.RefStart &~ cT_callouts.CtCDPI_mask
    475478        if Ref1:
    476                 Ref2 = bitutil.Advance(Ref1)
    477                 NumRef2 = Ref2 & lex.Hash
    478                 GenRef2 = Ref2 &~ lex.Hash
     479                scope1.RefStart = bitutil.Advance(Ref1)
     480                NumRef2 = scope1.RefStart & lex.Hash
     481                GenRef2 = scope1.RefStart &~ lex.Hash
    479482                NumRef3 = bitutil.Advance(NumRef2)
    480483                HexRef3 = NumRef3 & lex.x
Note: See TracChangeset for help on using the changeset viewer.