Ignore:
Timestamp:
Jun 4, 2014, 2:32:22 PM (5 years ago)
Author:
cameron
Message:

Generalize Advance(x) to Advance(x, n)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/RE/Haskell/RunPablo.hs

    r3826 r3855  
    99
    1010data PabloE = All(Int) | Var(String) | And(PabloE, PabloE) | Or(PabloE, PabloE) | Not(PabloE)
    11               | CharClass(SparseCharClass) | Advance(PabloE) | MatchStar(PabloE, PabloE)
     11              | CharClass(SparseCharClass) | Advance(PabloE, Int) | MatchStar(PabloE, PabloE)
    1212   deriving Show
    1313
     
    5050
    5151evalPabloE (Not(e), m, t) = applyUnary(pabloNot, evalPabloE(e, m, t))
    52 evalPabloE (Advance(e), m, t) = applyUnary(pabloAdvance, evalPabloE(e, m, t))
     52evalPabloE (Advance(e, n), m, t) = applyUnary(pabloAdvancer(n), evalPabloE(e, m, t))
    5353
    5454evalPabloE (CharClass(c), m, t) = computeCharClass(c, t)
     
    7878pabloNot(a) = complement(a)
    7979
    80 pabloAdvance :: Integer -> Integer
    81 pabloAdvance(a) = a + a
     80pabloAdvancer :: Int -> Integer -> Integer
     81pabloAdvancer n a = shiftL a n
    8282
    8383computeCharClass(cc, t) = Bitstream (computeCC_helper(cc, t, 1))
Note: See TracChangeset for help on using the changeset viewer.