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","."]
docstr: Mark the location of an error in a line.
docstr_tok: ["Mark","the","location","of","an","error","in","a","line","."]
code: def _mark_error(self, linenum, line):
      """
      Mark the location of an error in a line.
      """
      arrowmatch = CFGEditor._ARROW_RE.search(line)
      if not arrowmatch:
          # If there's no arrow at all, highlight the whole line.
          start = "%d.0" % linenum
          end = "%d.end" % linenum
      elif not CFGEditor._LHS_RE.match(line):
          # Otherwise, if the LHS is bad, highlight it.
          start = "%d.0" % linenum
          end = "%d.%d" % (linenum, arrowmatch.start())
      else:
          # Otherwise, highlight the RHS.
          start = "%d.%d" % (linenum, arrowmatch.end())
          end = "%d.end" % linenum
  
      # If we're highlighting 0 chars, highlight the whole line.
      if self._textwidget.compare(start, "==", end):
          start = "%d.0" % linenum
          end = "%d.end" % linenum
      self._textwidget.tag_add("error", start, end)
  
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 12 for calling the CFGEditor obj's underlying member method code with example usage: obj._mark_error(linenum, line) without return types