<<>> <> <> <> DIRECTORY MesaParser, MPTreeOps, MPP1, Rope, IO; MesaParserImpl: CEDAR PROGRAM IMPORTS MPTreeOps, MPP1 EXPORTS MesaParser ~ BEGIN <> <<>> Parse: PUBLIC PROC [program: Rope.ROPE, errout: IO.STREAM] RETURNS [root: MesaParser.Tree ¬ NIL, nTokens: NAT ¬ 0, nErrors: NAT ¬ 0] = { complete: BOOL ¬ FALSE; MPTreeOps.Initialize[]; BEGIN ENABLE UNWIND => MPTreeOps.Finalize[]; [complete, nTokens, nErrors] ¬ MPP1.Parse[program, errout]; root ¬ IF complete AND nErrors = 0 THEN MPTreeOps.PopTree[] ELSE NIL; END; MPTreeOps.Finalize[]; }; END.