Changeset 3855 for proto


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

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

Location:
proto/RE/Haskell
Files:
2 edited

Legend:

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

    r3826 r3855  
    7777   where
    7878     (newenv, newsym) = gensym(env, "marker")
    79      new_stmt = Assign (newsym, Advance(And(Var(last_marker), CharClass(c))))
     79     new_stmt = Assign (newsym, Advance(And(Var(last_marker), CharClass(c)), 1))
    8080
    8181-- To match "^" we must be at the start of line, i.e., one past
     
    8787   where
    8888     (newenv, newsym) = gensym(env, "start_of_line_marker")
    89      new_stmt = Assign (newsym, And(Var(last_marker), Not(Advance(Not(eol_CC)))))
     89     new_stmt = Assign (newsym, And(Var(last_marker), Not(Advance(Not(eol_CC), 1))))
    9090
    9191-- To match "$" we must have reached end of line.
  • 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.