[M3devel] Modula-2 parsing

Jay K jay.krell at cornell.edu
Tue Aug 4 09:36:21 CEST 2015


Procedure.m3:
Do we need this?I know it isn't much, but remove it?

    ELSIF (cur.token = TK.tSEMI) THEN      t.body := NEW (Body, self := t);      ProcBody.Push (t.body);      (* try accepting the Modula-2 syntax *)      Error.ID (id, "expecting \'=\' before procedure body");      GetToken (); (* ; *)      t.syms  := Scope.PushNew (TRUE, id);      t.block := BlockStmt.Parse (FALSE);      t.fails := BlockStmt.ExtractFails (t.block);      t.end_origin := Scanner.offset;      final_id := MatchID ();      IF (final_id # id) THEN        Error.ID (id, "Initial name doesn\'t match final name");      END;      Scope.PopNew ();      ProcBody.Pop ();    ELSE

It always errors?
But I guess it errors and checks nicer than it might otherwise?
Why am I looking here?
Tangential:
I'm looking for where/how to model counting TRYs per "procedure"and doing the alloca at the start of a "procedure".

"procedure"'s definition for my context is being worked on. It appears to be three things:   1) Things called "PROCEDURE".   2) FINALLY blocks, sometimes   3) "Module main"   
 I was looking for what they have in common already, and it looks like maybe "ProcBody.Push".
  So I was looking all of them.
  - Jay

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150804/ffe93827/attachment-0001.html>


More information about the M3devel mailing list