MOHO-15: Refactor the constructor method of Grammar
MOHO-15: Add a sample implementation to demonstrate the CPA feature
MOHO-15: Modify the way to set CPA parameters
MOHO-15: Fix the 'isTerminating' flag is translated conversely