For Programmers: Free Programming Magazines  


Home > Archive > Cobol > August 2007 > Re: CONSTANT ENTRY (was "forward" references (was: COBOL subscript range c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: CONSTANT ENTRY (was "forward" references (was: COBOL subscript range c
Karl Kiesel

2007-08-28, 7:56 am

"William M. Klein" <wmklein@nospam.netcom.com> schrieb im Newsbeitrag
news:e4EAi.169153$Bo7.88986@fe07.news.easynews.com...
> Karl,
> For what is is worth, Page 29 of the '02 Standard explicitly states that
> the
> manipulation" and not the later "comiilation stage". Therefore (to me) I
> would expect only one CONSTANT ENTRY to be "known" by the time you get to
> the compilation stage (when this information would be needed).
>
> My original comment about "searching ahead" was assuming (possibly
> erroneously) that the entire text manipulation stage had been completed
> before this all need to be handled.
>

Bill,
that is just the problem I see here! The STD2002 defines a sequence of
separate stages of compilation (see chapter 7) but the earlier stage (text
manipulation) may need information that can only be obtained from the later
stage (compilation): expressions within >>IF and >>EVALUATE directives may
be formed using literals (for example see STD2002 7.2.7.1 syntax rule 1) and
i did not find any rule, that forbids using a constant in place of a literal
in these expressions. Therefore, to complete the text manipulation stage, a
compiler must be able to evaluate constant conditional expressions in
directives, but this is impossible, if a constant is involved, beause
processing (ie recognition and especially determining the value) of such a
constant entry is definitely part of the later stage - but this stage can
not be entered unless the previous stage has been completed! In this sense,
using constants within directives is a form of 'forward reference'; If the
concept of stages within the STD2002 is to be kept - and I would not like to
give it up! - constant entries are a problem that make implementaion rather
hard, if not impossible.

Karl Kiesel
Fujitsu Siemens Computers



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com