Ignore:
Timestamp:
Mar 29, 2012, 5:43:12 PM (7 years ago)
Author:
lindanl
Message:

Add DTD parsing into parabix.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/pablo.py

    r1959 r1987  
    3939        mask = 128
    4040        index = 0
     41        global data
    4142        while index < 8:
    4243                current = 0
     
    6566                elif index == 8:
    6667                        b.bit_7 = current
    67         data = s
     68        data  = s
    6869        return cursor-1  # basis streams and EOF mask
     70
     71def match(s,marker):
     72        pos = count_leading_zeroes(marker)
     73        i = 0
     74        for byte in s:
     75                if byte != data[pos+i]:
     76                        return 0
     77                i +=1
     78        return marker
    6979
    7080def inFile(lex_error):
     
    8797        return zeroes
    8898       
    89 def NoteError(s, lex_error):
    90         pos = count_leading_zeroes(lex_error)
    91         print s + " at position " + str(pos)
    9299#
    93100#  ScanThru is the core operation for parallel scanning.
     
    108115def Advance(stream):
    109116        return stream + stream
     117       
     118def AdvancebyPos(stream, pos):
     119        return stream << pos
    110120
    111121
Note: See TracChangeset for help on using the changeset viewer.