Slide 14
Slide 14 text
14
def process_input(input):
try:
val = parse(input)
res = process(val)
return res
except SyntaxError:
return Error
14
{
'' : [['']],
'' : [[''],
[''],
[''],
[''],
['true'], ['false'], ['null']],
'' : [['{', '','}'],
['{}']],
'' : [[',',','],
['']],
'' : [['',':', '']],
'' : [['[', '', ']'],
['[]']],
'' : [[',',','],
['']],
'' : [['"', '', '"'],
['""']],
'' : [['',''],
['']],
'' : [['']],
'' : [['',''],
['']],
'' : [[c] for c in string.characters]
'' : [[c] for c in string.digits]
}
Fix: Input Grammar