[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnubol: Problem 10



In a message dated 12/27/99 0:36:38 AM EST, tej@melbpc.org.au writes:

<< 
 They must have an algorithm something like:
 
 if I find an end-perform, and it doesn't belong to any perform
 that should have it or it could belong to one and he already has
 an end-perform, then try and pair it to a perform that should not
 have an end-perform! Or is there a simpler way?
  >>

Well this Turing Machine sure is fun, because in your humorous expression you 
have read my mind.  I don't know what their algorithm is, but the post seemed 
to suggest END-PERFORM on the PERFORM procedure_name as rather routine, as 
opposed to the exception patch work you suggest. But manual management of 
scope termination would be an algorithm very much like you sketch in your 
jocular manner. 

I would do that kind of thing with stacks; there would be one for each class 
of verbs. The class is really determined by the conditional clause form.  
PERFORM is a special case, it has no conditional clauses, or one depending 
upon how you look at it, but it has no conditional clause phrasing, which 
makes it into a unique class.

The Arithmetic verbs have a common pair of clauses ON SIZE ERROR and NOT ON 
SIZE ERROR. Managing the scope binding of these requires only one stack. In a 
transposing world we might trace back some ways to find the candidate bind 
point.  Interestingly enough an  END-arith-verb would use that same common 
stack to trace back to the bind point, implicitly terminating anything that 
does not match, consuming until it finds its maker, which it explicitly 
terminates.  Trinkets let us know how much of recent portions of other stacks 
to implicitly terminate as well. (A trinket is just a number.  If an implicit 
scope terminator telescoped back to scope 1234, then all scope stacks need to 
be implictly terminated step-by-step back to scopes no greater than scope 
1234. That would not require cross linkage, just disciplined enumeration of 
scopes).

But anyway, it can be done. However, if you get your parser to transpose to 
various depths successfully you will be eliminating the need for this kind of 
stuff.

Best Wishes
Bob Rayhawk
RKRayhawk@aol.com


--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.