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. Ζ MesaParserImpl.mesa Copyright Σ 1991 by Xerox Corporation. All rights reserved. Michael Plass, September 6, 1991 0:09 am PDT Note: Locking is done by the Initialize and Finalize routines. ΚR–(cedarcode) style•NewlineDelimiter ™codešœ™Kšœ Οeœ1™™>K™—šŸœžœžœžœ žœžœžœžœ žœžœ ˜ˆKšœ žœžœ˜Kšœ˜šžœžœžœ˜,Kšœžœ˜;Kš œžœ žœ žœžœžœ˜EKšžœ˜—Kšœ˜Kšœ˜K˜——Kšžœ˜—…—*