Added main parser function.

Still a lot of work be be done so that the parser can recognize
different rule formats.