completes top-down recursive parsing of language, adds test code