Module 3: Parsing and Unparsing: Assembly Language and Virtual Object Code

elmiinated unparse1 from interface. Explain the plan! Note that LOADFUNC needs a terminator in the concrete syntax. EOF , end , $ , anything that won’t ever be mistaken for an instruction.

start with optional , not many (at this stage, the recursion is too much)

other combinator: bracketed?

outcome 4, “use your unparser as evidence” not strong enough. We need to ask for line numbers.

(This module is also available in PDF, in two-column and one-column formats.)

This week you’ll design your assembly language and implement an unparser for it. And you’ll start learning about parsing combinators and about the Universal Forward Translator. The parsing stuff is a lot to swallow, but you’ll have two weeks to assimilate it; your full parser isn’t due until module 4.

The theme for the week is designing concrete syntax that promotes readability.