Recursive-descent parser from Wikipedia