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

Re: gnubol: Re: ref touch points



In a message dated 12/4/99 12:22:49 PM EST, 

Michael McKernan, mck@tivoli.mv.com writes:

<< 
       01 A.            01 B.
          02 B.            02 B.
        03 C.             03 C.
           04 D.                 04 D.
              05 X.             05 Y.
             06 Z PIC 9.           06 Z PIC X.
 
 The programmer may legitimately reference Z of Y and it is a unique
 reference.  Since the name at the top of the tree need not be among
 the qualifiers, it becomes very inefficient to do the lookup
 top-down.  What we do instead, is form chains while we're building
 the symbol table of all the symbol table entries that have the same
 name, then use those chains to accomplish the lookup bottom-up.  We
 are now searching only the trees that contain the data-name instead of
 searching every tree in the program.
 
 Best regards,
 
 Mike
  >>


My idea is that top-down and bottom up alternatives relate to the matter in 
the source code,
so that 
Z OF Y OF name-0n-intermediate OF name-0n-high-level
can be checked validly from the top of_the_qualified_expression. Just as it 
can be checked from the bottom of_the_qualified_expression validly.

I am not saying check 
   Z OF Y 
from the top down. 

Instead I am saying that we can in a 
top-down fashion check
  name-0n-intermediate OF name-0n-high-level
   Y OF name-0n-intermediate
   Z OF Y

or in a bottom-up fashion we can check

   Z OF Y
   Y OF name-0n-intermediate
  name-0n-intermediate OF name-0n-high-level

Both approaches are valid. From a radical point of view you may wish to check 
each OFIN clause to stick to the plan of as much diagnosis as possible on 
each compile (It is my sense that here we might make a compromise though). 

My understanding of the requirement is that at any given level, a number of 
alternatives could become and stay valid for several segments in a row. (I am 
refereing to segments of the OFIN sequence in the source code). That is very 
much like the concurrent scopes of syntax checking itself, but the COBOL OFIN 
syntax does not require explication of intermediates (as you pointed out 
earlier, in contrast to the C family).

I am not in favor of t-d or b-u. I am just saying actually you can do this 
either way, and something happens to us on this (IMHO somewhat small 
criteria) when we choose LL vs. LR.

Although we are agreeing that there is some opportunity to exploit the syntax 
recurse for this SYMT walk, we disagree about whether it has to be done one 
way or the other. It think it is still open.

We do agree that for each segment, the validation algorithm (re-)enters the 
SYMT via an access link that enumerates alias/duplicates names for the 
segment of interest.
In this sense the first function of each iteration has the sense of neither 
top or bottom but mid-point. 

But to be honest with you it is interesting to consider just how complex the 
algorithm will have to be to handle even modest depth OFIN sequences, 
considering the fact that we will need some kind of data structure to hold 
intermediate concurrently valid interpretations. With analysis we probably 
can get each ongoing check to resolve into a link/pointer. But in programs 
with lots of look alikes in the data division the number of incompletely 
resolved alternatives may be kind of open ended. For what we get out of OFIN 
this vaidation algorithm may be rather complex, which is agravating.

The other aspect of this that may help us prefer one direction or the other 
is that once we find a broken segment where a thing is not OFIN its qulifier, 
the rest of the sequence actually has no context. I do not know if the 
standard helps make a choice here; if it does not than we may be able to 
simply reason it out.  Rather than choosing t-d or b-u by preference, we 
might choose which point of view is more valid;
   after an OFIN break the top portion (on the right) has no semantics
or
   after an OFIN break the bottom portion (on the left) has no semantics
(again my intended sens of top/bottom is the source code reference itself: 
left is bottom, right is top).

In the absence of restrictions in the standard, our concensus on this view 
point might lead us to avoid 'senseless' syntax checking. If we make a 
decision that way, we should keep a miniature brute force enumeration of 
rules as an option; so that whatever we might do t-d/b-u we can tell the user 
that we will always validate the first n levels (say 5 or  10?) and after 
that iteration gets short circuited on the first break.

Bob Rayhawk









--
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.