Active Grammar-based Modeling