Implemented the parser with happy.