implement drawing syntax tree function