Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

PL1-L - Fehler im PL/1-Makroprozessor im Zusammenhang mit ANSWER

Subject:

Internal preprocessor error

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

PL1 (language) discussions <PL1-L@LISTSERV.DARTMOUTH.EDU>

Date:

2014.02.11 20:57:12


Hello all,

I have some difficulties with a PL/1 macro (preprocessor function) I wrote. The
macro tries to activate another macro by producing an output string containing
the call of the other macro using ANSWER statements.

When I do it like this, all works well:

 %XTRACEB: PROC ();

          DCL R CHAR;

          R =      'ZAKQTRCP IF_PRINT_TRACE_LEVEL ';
          R = R !! '   (TRACE_LEVEL_DIAGNOSTIC) ';
          R = R !! '   L(''['' !! PGMNAME !! ''] ';
          R = R !! '** START UPRO '' !! ';
          R = R !! 'PROCNAME () !! '' **'') ';
          R = R !! 'ENDIF_TRACE;';
          ANSWER (R) SKIP;

          %END;

I get the coding that the ZAKQTRCP macro provides.

When I do it like this

 %XTRACEE: PROC ();

          DCL R CHAR;

          R = 'ZAKQTRCP IF_PRINT_TRACE_LEVEL ';
          ANSWER (R) SKIP;
          R = '   (TRACE_LEVEL_DIAGNOSTIC) ';
          ANSWER (R) SKIP;
          R = '   L(''['' !! PGMNAME !! ''] ';
          ANSWER (R) SKIP;
          R = '** ENDE UPRO '' !! ';
          ANSWER (R) SKIP;
          R = 'PROCNAME () !! '' **'') ';
          ANSWER (R) SKIP;
          R = 'ENDIF_TRACE;';
          ANSWER (R) SKIP;

          %END;

I get the following messages:


MACRO (Built:20100917) Messages
Message       Line.File Message Description
IBM3983I S    2802.0    Premature end-of-source in scan.
IBM3961I S    2802.0    End-of-source has been encountered after an
                        unmatched quote.
IBM3961I S    2802.0    End-of-source has been encountered after an
                        unmatched quote.
IBM3997I S    2802.0    Internal preprocessor error: no WHEN clause
                        satisfied within EXP_GET_STR_LEN
No Compiler Messages


and the Compiler ends without producing anything.

The line 2802 refers to the source line of the first macro call XTRACEE.
Compilation stops after processing this line. I have no idea what
EXP_GET_STR_LEN is; maybe an internal procedure name of the preprocessor.
It is in any case no name of my program.

The difference IMO is (apart from minor differences between the two macros) that
in the first case the whole text is built in variable R and there is only one
ANSWER statement; in the second case, there are many ANSWER statements - which
should be possible - in other situations, it worked without problem.

Of course, the solution was to code both macros like the first one. But anyway:
what do you think of this? Is this an error in the preprocessor that should be
resolved? Or: do I use some sort of strange feature that is not supported?

The compiler is EP V3.9, AFAIK - didn't copy the release information,
but: see the build date in 2010, above.

Thank you, kind regards

Bernd

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie