| Rick Smith 2007-08-29, 6:55 pm |
|
"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:5jla0pF4srfU1@mid.individual.net...
[snip]
> If your argument is that COPY using the constant might occur in source
> before the constant has been defined, thus requiring a forward reference,
> yes, I agree, it needs a forward reference. But that isn't the end of the
> world. Forward references can be dealt with easily by established
techniques
> in a multipass compiler.
Forward reference is a misnomer. It is an indirect reference;
to a literal (constant-entry), or to a data-description-entry
or record-description (typedef and object of SAME AS
clause). Many common languages use indirect backward
references; but I am not aware of any that permit indirect
forward references. The latter being the case, whence do
these "established techniques" come?
Furthermore, some uses of the SAME AS and TYPE
clauses and constant-entries will result in chains of indirect
references. Resolving these chains is analogous to creating
an indented list of parts from a product structure file (or table).
Relatively easy to do when the components and assemblies
are known (indirect backward references); but not so easy
when they are not yet known (indirect forward reference).
In other words, it is possible to accommodate indirect
forward references; but doing so adds an unprecedented
level of complexity to COBOL compiler development
with, in my opinion, no significant benefit.
|