solution/cw5/fun_tokens.sc
changeset 869 81ee93b87258
parent 868 8fb3b6d3be70
equal deleted inserted replaced
868:8fb3b6d3be70 869:81ee93b87258
   193 val SYM = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | 
   193 val SYM = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | 
   194           "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | 
   194           "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | 
   195           "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" |"E" | "F" | "G" |
   195           "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" |"E" | "F" | "G" |
   196           "H" | "I" | "J" | "K" |"L" | "M" | "N" |
   196           "H" | "I" | "J" | "K" |"L" | "M" | "N" |
   197           "O" | "P" | "Q" | "R" |"S" | "T" | "U" |
   197           "O" | "P" | "Q" | "R" |"S" | "T" | "U" |
   198           "V" | "W" | "X" | "Y" | "Z" | "_"
   198           "V" | "W" | "X" | "Y" | "Z" | "_" | ":"
   199 val DIGIT = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
   199 val DIGIT = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
   200 val ID = SYM ~ (SYM | DIGIT).% 
   200 val ID = SYM ~ (SYM | DIGIT).% 
   201 val NUM = PLUS(DIGIT)
   201 val NUM = PLUS(DIGIT)
   202 val FNUM = OPT("-") ~ NUM ~ "." ~ NUM 
   202 val FNUM = OPT("-") ~ NUM ~ "." ~ NUM 
   203 val KEYWORD : Rexp = "if" | "then" | "else" | "def" | "val"
   203 val KEYWORD : Rexp = "if" | "then" | "else" | "def" | "val"