grammar definition bug fixed, failed  on aaabbccc test
experimental AnalysisState handling