I mentioned that sometimes a little modification is needed, in the following function I had to add begin, end to the case statements
function GetOperator(OpChar: Char): TOperator;
begin
Result.Op := OpChar;
case OpChar of
'+', '-': Result.Prec := 2; Result.Assoc := 'L';
'*', '/': Result.Prec := 3; Result.Assoc := 'L';
else raise Exception.Create('Invalid operator');
end;
end;
'+', '-': begin Result.Prec := 2; Result.Assoc := 'L'; end;
'*', '/': begin Result.Prec := 3; Result.Assoc := 'L'; end;