generic and class-based grammars
approach for generic grammars