You can base your code on this parser.

Hope it helps.