I'm trying to write a tokenizer, but I'm getting a parse error:
%*************************** parse error ************************
%**
%** syntax error, unexpected T_DEFAULT, expecting T_then
%**
%** in file "/Users/xxx/Programmering/Oz/Oving1/Oz_oving1_task8.oz", line 15, column 36
%** ------------------ rejected (1 error)
Here's the code, I have marked line 15 and column 36 with %=ERROR=%
declare
fun {Tokenize L}
Keys Ops Token
in
Keys = ["local", "in", "if", "then", "else", "end"]
Ops = ["+", "-", "*", "/"]
case Tokenize of Head|Tail then
if {Member Head Keys} then
Token = key(Head)
elseif {Member Head Ops} then
Token = op(Head)
else
case Head of Forste|_ then
if Forste >= &a andthen Forste <= &z then % THIS IS LINE 15, COLUMN 36 = ..andthen [here]Forste..
Token = atom(Forste)
elseif
Forste >= &A andthen Forste <= &Z then
Token = id(Forste)
end
end
Token | {Tokenize Tail}
end
else
nil
end
end
Any idea what I'm doing wrong?