full parser implementation