Return to Video

Challenge Problem - Design of Computer Programs

  • Niezsynchronizowane
    Now we showed how useful it is to have an API
  • Niezsynchronizowane
    for regular expressions that we can say
  • Niezsynchronizowane
    for example plus an option, alternative of literal A, literal B
  • Niezsynchronizowane
    and these function calls are convenient to manipulate
  • Niezsynchronizowane
    but that’s an awful lot to type,
  • Niezsynchronizowane
    especially when the string notation for
  • Niezsynchronizowane
    regular expressions is so much simpler,
  • Niezsynchronizowane
    we can represent this as this simple string,
  • Niezsynchronizowane
    and so what I want you to do in this homework
  • Niezsynchronizowane
    is to write a grammar and a parser that maps
  • Niezsynchronizowane
    from the string to this expression.
  • Niezsynchronizowane
    So you should first define regular expression grammar
  • Niezsynchronizowane
    using the tools that we’ve provided,
  • Niezsynchronizowane
    fill the parser for that, that’s going to give you a tree,
  • Niezsynchronizowane
    so when we parse let’s say, RE is our main symbol,
  • Niezsynchronizowane
    then some text with this grammar
  • Niezsynchronizowane
    then that’s going to give you some sort of tree,
  • Niezsynchronizowane
    but it’s not quite this API form,
  • Niezsynchronizowane
    so then I want you to write another function to convert
  • Niezsynchronizowane
    from the tree to the API,
  • Niezsynchronizowane
    and so here’s what it looks like.
  • Niezsynchronizowane
    You are going to define your grammar,
  • Niezsynchronizowane
    RE is going to be the main left-hand side symbol
  • Niezsynchronizowane
    to parse the regular expression that’s given for you,
  • Niezsynchronizowane
    you parse it and convert it
  • Niezsynchronizowane
    and then you have to convert this
  • Niezsynchronizowane
    to make that cause into the API.
Tytuł:
Challenge Problem - Design of Computer Programs
Opis:

dummy description

more » « less
Video Language:
English
Team:
Udacity
Projekt:
CS212 - Design of Computer Programs
Duration:
01:22

English subtitles

Revisions Compare revisions