Programming-from-A-to-Z / A2Z-F18

ITP A2Z Course for Fall 2018

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Context Free Grammar Example with JSON has invalid grammar!

shiffman opened this issue · comments

This grammar is not valid:
https://github.com/shiffman/A2Z-F18/blob/master/week7-grammar/03_cfg_reader_json/grammars/grammar.json

It uses the same key multiple times:

{
  "S":"NP VP",
  "S":"Interj NP VP",
  "NP":"Det N",
  "NP":"Det N that VP",
  "NP":"Det Adj N",
  "VP":"Vtrans NP",
  "VP":"Vintr",
}

It should use an array for each element instead.