equal
deleted
inserted
replaced
143 case c::Nil => CHAR(c) |
143 case c::Nil => CHAR(c) |
144 case c::s => ALT(CHAR(c), Range(s)) |
144 case c::s => ALT(CHAR(c), Range(s)) |
145 } |
145 } |
146 def RANGE(s: String) = Range(s.toList) |
146 def RANGE(s: String) = Range(s.toList) |
147 |
147 |
148 val SYM = RANGE("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz_") |
148 val SYM = RANGE("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_") |
149 val DIGIT = RANGE("0123456789") |
149 val DIGIT = RANGE("0123456789") |
150 val ID = SYM ~ (SYM | DIGIT).% |
150 val ID = SYM ~ (SYM | DIGIT).% |
151 val NUM = PLUS(DIGIT) |
151 val NUM = PLUS(DIGIT) |
152 val KEYWORD : Rexp = "skip" | "while" | "do" | "if" | "then" | "else" | "read" | "write" |
152 val KEYWORD : Rexp = "skip" | "while" | "do" | "if" | "then" | "else" | "read" | "write" |
153 val SEMI: Rexp = ";" |
153 val SEMI: Rexp = ";" |