10.02.2013 Views

Foundations of Software - LAMP - EPFL

Foundations of Software - LAMP - EPFL

Foundations of Software - LAMP - EPFL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Getting Better Output<br />

� The result <strong>of</strong> the previous JSON parser was a tree containing all<br />

input tokens (slightly chaotically).<br />

� We transform the productions using the ˆˆ combinator to get more<br />

structured output:<br />

def obj : Parser[Any] = // return a Map<br />

”{” ˜> rep(member) rep{value}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!