added some experimental kind of grammar support, probably not accurate and seem inefficent