source: proto/SymbolTable/wcd.py @ 4368

Last change on this file since 4368 was 1688, checked in by vla24, 8 years ago

SymbolTable?: renaming dictionary prefixed files into wcd

File size: 1.2 KB
Line 
1# -*- coding: utf-8 -*-
2#
3# parabix2_compilable.py
4#
5# Parallel XML Parsing with Bitstream Addition
6#
7# - Complete prototype for all bitstream computations in Parabix2
8# - Optimized for compilation
9# - Separate compilation
10
11# Robert D. Cameron
12# July 29, 2010
13#
14
15#import bitutil
16
17class Basis_bits():
18    bit_0 = 0
19    bit_1 = 0
20    bit_2 = 0
21    bit_3 = 0
22    bit_4 = 0
23    bit_5 = 0
24    bit_6 = 0
25    bit_7 = 0
26
27class Dictionary ():
28    Words = 0
29    Word_starts = 0
30    Word_ends = 0
31
32def Classify_bytes(basis_bits, dictionary):
33    temp1 = (basis_bits.bit_6 & basis_bits.bit_7)
34    temp2 = (basis_bits.bit_5 | temp1)
35    temp3 = (basis_bits.bit_4 & temp2)
36    temp4 = (~temp3)
37    temp5 = (basis_bits.bit_4 | basis_bits.bit_5)
38    temp6 = (basis_bits.bit_6 | basis_bits.bit_7)
39    temp7 = (temp5 | temp6)
40    temp8 = ((basis_bits.bit_3 & temp4)|(~(basis_bits.bit_3) & temp7))
41    temp9 = (basis_bits.bit_1 &~ basis_bits.bit_0)
42    dictionary.Words = (temp8 & temp9)
43
44    temp = pablo.Advance(dictionary.Words) ^ dictionary.Words
45    dictionary.Word_starts = temp & dictionary.Words
46    dictionary.Word_ends = temp & ~dictionary.Words
47
48def Main(basis_bits,dictionary):
49    Classify_bytes(basis_bits, dictionary)
50               
Note: See TracBrowser for help on using the repository browser.