tools for context-free grammars