equal
deleted
inserted
replaced
197 case c::Nil => CHAR(c) |
197 case c::Nil => CHAR(c) |
198 case c::s => ALT(CHAR(c), Range(s)) |
198 case c::s => ALT(CHAR(c), Range(s)) |
199 } |
199 } |
200 def RANGE(s: String) = Range(s.toList) |
200 def RANGE(s: String) = Range(s.toList) |
201 |
201 |
202 val SYM = RANGE("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz_") |
202 val SYM = RANGE("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_") |
203 val DIGIT = RANGE("0123456789") |
203 val DIGIT = RANGE("0123456789") |
204 val ID = SYM ~ (SYM | DIGIT).% |
204 val ID = SYM ~ (SYM | DIGIT).% |
205 val NUM = PLUS(DIGIT) |
205 val NUM = PLUS(DIGIT) |
206 val KEYWORD : Rexp = "skip" | "while" | "do" | "if" | "then" | "else" | "read" | "write" |
206 val KEYWORD : Rexp = "skip" | "while" | "do" | "if" | "then" | "else" | "read" | "write" |
207 val SEMI: Rexp = ";" |
207 val SEMI: Rexp = ";" |