class_docstr: A dialog window for creating and editing context free grammars.
  ``CFGEditor`` imposes the following restrictions:
  
  - All nonterminals must be strings consisting of word
    characters.
  - All terminals must be strings consisting of word characters
    and space characters.
class_docstr_tok: ["A","dialog","window","for","creating","and","editing","context","free","grammars",".","``","CFGEditor","``","imposes","the","following","restrictions",":","-","All","nonterminals","must","be","strings","consisting","of","word","characters",".","-","All","terminals","must","be","strings","consisting","of","word","characters","and","space","characters","."]
code: def _apply(self, *e):
      productions = self._parse_productions()
      start = Nonterminal(self._start.get())
      cfg = CFG(start, productions)
      if self._set_cfg_callback is not None:
          self._set_cfg_callback(cfg)
  
imports: import re
  from tkinter import Button, Canvas, Entry, Frame, IntVar, Label, Scrollbar, Text, Tk, Toplevel
  from nltk.draw.tree import TreeSegmentWidget, tree_to_treesegment
  from nltk.draw.util import CanvasFrame, ColorizedList, ShowText, SymbolWidget, TextWidget
  from nltk.grammar import CFG, Nonterminal, _read_cfg_production, nonterminals
  from nltk.tree import Tree
label_desc: Use image node_id 17 for calling the CFGEditor obj's underlying member method code with example usage: obj._apply() without return types