Generate grammar at runtime based on block values