[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnubol: subsets
This is a response to Tim Josling post Dated: 11/21/99 12:48:51 PM EST
nad quoted below in toto.
Our ideas are similar, but as you say repass, I think we differ in that you
seem to suggest that you go back to the entire source code (atleast the
entire procedure division). Instead I would just hang references onto an
available tree. A repass then for this situation is just a walk of the tree
or sections thereof. We don't need to re-lex nor retokenize.
This approach save (compilere execution) time in two ways. Lexing is
expensize, especially if it leads back to buffers characterized by lots of
whitespace. But more important the decorations on the tree which represent
references to be resolved are a subset of the full text. Much of the full
text would likely be figured out by the initial pass in the parser, why
re-engage it, just look to the unfinished business. In this sense my
suggestions are quite similar to the expressed believe that much of the
source code can be reduced to a linked list. My only personal, and minor,
note on that is that we should delete anything we can as soon as possible. A
major rule reduction is a synch point where that could happen, say a verb
rule like MOVE, not a minor rule, like say an SIZE ERROR. Although even there
we could drop some of the accumulated.
So another way of looking at trees in the parser is that these hold what we
want to save for further work; if something is not in the tree(s) then at
some near point it will get freed. This idea leads to something different
than a next 'pass'. When we do walk trees to find things like the ambiguity
of an on qulalified reference to a multiply defined paragraph name, we
hopefully find ways for the walkers to only visit the nodes it needs.
Obviously, for the procedure division, if an early phase can emit a list of
procedures things are simplified. But even if challenges remain, resuming
analysis on a subset is quicker than a reversion to the source code.
-Best Wishes
In a message dated 11/21/99 12:48:51 PM EST, TIMJOSLING@prodigy.net writes:
<< This is possible, but more lines of code, complexity => bugs. So my plan
was to
pass the parse tree and fill in all the symbols, then repass to use them all.
Take as an example:
procedure division.
s1 section.
p1.
...
s2 section.
p2.
perform p1.
...
s3 section.
p1.
Note how p1 becomes ambiguous, although when first used it seemed OK. Another
test case ... sigh....
Certainly you can have all the data sorted out prior to the procedure
division.
Nested programs could mess that up I suspect but I haven't researched that
yet.
Tim Josling
>>
--
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.