Implementation of Cocke–Younger–Kasami parsing algorithm in JavaScript