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

Re: gnubol: Non-recursive parsing



In a message dated 12/13/99 1:48:33 AM EST, wmklein@ix.netcom.com writes:

some snips ...
<< ... I did, however, see a sentence that SEEMED
 (in my ignorance) to imply that you thought that only ONE verb could appear
 on a line of source code.  This is not a valid assumption.  Although MOST
 "real" programmers do tend to do this, there is nothing in the Standard to
 require it and some "code generators" do create multiple statements on the
 same line.
 
 Bill Klein
   wmklein <at> ix.netcom.com
  >>

Thankyou for your vigilance. And I did not mean to imply that there is a one 
to one relationship between line numbers and verbs. Instead my orientation to 
line numbers in that post was that we need to talk to the compiler user with 
line numbers.

So down inside the compiler there perhaps is an error diagnostics engine that 
receives from preprocessing, syntax or semantics an error number designating 
the problem that has been isolated and some indication of where the problem 
occured. Generally, we describe where with a line number. 

In the situations where we just want to say that something is unexpectedly 
present or unexpectedly missing, we generally just have one line number to 
express. In some cases, however, we have two line numbers that are of 
interest. For example we may wish to warn or reject an implied scope 
termination on line S+n, for a scope that began back on line S. ((S+n is just 
a symbolic way of saying the second line number is potentially some distance 
away, not a suggestion that math is involved)).

In some situations multiple scopes would terminate at a given place, and 
again to warn or reject, we may need to say something about S1 and S1+n, and 
S2 and S2+m; where by the coincident collapse of scope S1+n and S2+m are the 
same line number ((again S1+n and S2+m are not meant to indicate math)). If 
S1 and S2 are the same line number, that is fine.

But the actions and the error processor do not need to know or sense that 
verbs and or clauses are all starting on the same line number.

All my original post says to do about line numbers is record line numbers as 
you manage scope stacks. This will support diagnostics using exacting line 
nubers.

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.