code: def app():
      """
      Create a recursive descent parser demo, using a simple grammar and
      text.
      """
      from nltk.grammar import CFG
  
      grammar = CFG.fromstring(
          """
      # Grammatical productions.
          S -> NP VP
          NP -> Det N PP | Det N
          VP -> V NP PP | V NP | V
          PP -> P NP
      # Lexical productions.
          NP -> 'I'
          Det -> 'the' | 'a'
          N -> 'man' | 'park' | 'dog' | 'telescope'
          V -> 'ate' | 'saw'
          P -> 'in' | 'under' | 'with'
      """
      )
  
      sent = "the dog saw a man in the park".split()
  
      RecursiveDescentApp(grammar, sent).mainloop()
  
imports: from tkinter import Button, Frame, IntVar, Label, Listbox, Menu, Scrollbar, Tk
  from tkinter.font import Font
  from nltk.draw import CFGEditor, TreeSegmentWidget, tree_to_treesegment
  from nltk.draw.util import CanvasFrame, EntryDialog, ShowText, TextWidget
  from nltk.parse import SteppingRecursiveDescentParser
  from nltk.tree import Tree
  from nltk.util import in_idle
label_desc: Use image node_id 1 for calling a global function with example usage: app() without return types