Generalize parser a bit

Signed-off-by: Ricky Elrod <ricky@elrod.me>