equal
deleted
inserted
replaced
127 def lexing(r: Rexp, s: String) : Val = lex(r, s.toList) |
127 def lexing(r: Rexp, s: String) : Val = lex(r, s.toList) |
128 |
128 |
129 |
129 |
130 lexing(("ab" | "a") ~ ("b" | ONE), "ab") |
130 lexing(("ab" | "a") ~ ("b" | ONE), "ab") |
131 |
131 |
132 |
|
133 |
|
134 // some "rectification" functions for simplification |
132 // some "rectification" functions for simplification |
135 def F_ID(v: Val): Val = v |
133 def F_ID(v: Val): Val = v |
136 def F_RIGHT(f: Val => Val) = (v:Val) => Right(f(v)) |
134 def F_RIGHT(f: Val => Val) = (v:Val) => Right(f(v)) |
137 def F_LEFT(f: Val => Val) = (v:Val) => Left(f(v)) |
135 def F_LEFT(f: Val => Val) = (v:Val) => Left(f(v)) |
138 def F_ALT(f1: Val => Val, f2: Val => Val) = (v:Val) => v match { |
136 def F_ALT(f1: Val => Val, f2: Val => Val) = (v:Val) => v match { |