working parser to parse case statement