Return to Video

04-50 Parsing Tags Solution

  • 0:00 - 0:02
    Well, let's go through it together--our parse tree
  • 0:02 - 0:05
    is just going to be a list of elements, and here there are three:
  • 0:05 - 0:08
    hello, the tag element, and yaga.
  • 0:08 - 0:10
    And hello is just a simple Word_element
  • 0:10 - 0:12
    so it fills in our first blank.
  • 0:12 - 0:14
    Then we've got this tag_element and the
  • 0:14 - 0:16
    trick to getting this question right is looking
  • 0:16 - 0:19
    at the order in which we store them up here--
  • 0:19 - 0:21
    more or less in order of appearance.
  • 0:21 - 0:23
    So since this is a tag,
  • 0:23 - 0:25
    when this next part here is a (b),
  • 0:25 - 0:28
    this empty list means there were no particular arguments to our tag.
  • 0:28 - 0:30
    Here, I'm seeing arguments: color = "red".
  • 0:30 - 0:32
    There's nothing like that down here.
  • 0:32 - 0:36
    And then inside, we've got the Word_element, baba--and then we're done.
  • 0:36 - 0:40
    Baba Yaga was a crone or a witch in Slavic folklore
  • 0:40 - 0:42
    who was known for--among other things--
  • 0:42 -
    riding around in a house supported on chickens' legs--fun stuff!
Title:
04-50 Parsing Tags Solution
Description:

dummy description

more » « less
Video Language:
English
Team:
Udacity
Project:
CS262 - Programming Languages
Duration:
0:47
Amara Bot added a translation

English subtitles

Revisions