Implementation of CKY Parser