Category:Polyglot:PL/I and PL/M: Difference between revisions

Content added Content deleted
m (→‎Include Files: Fix tags)
(lang -> syntaxhighlight)
Line 64: Line 64:
A suitable file for PL/I definitions could be:
A suitable file for PL/I definitions could be:
<br>
<br>
<lang pli>/* pg.inc: PL/I definitions for "polyglot PL/I and PL/M programs" compiled with PL/I */
<syntaxhighlight lang=pli>/* pg.inc: PL/I definitions for "polyglot PL/I and PL/M programs" compiled with PL/I */


%replace true by '1'b, false by '0'b;
%replace true by '1'b, false by '0'b;
Line 143: Line 143:




/* end pg.inc */</lang>
/* end pg.inc */</syntaxhighlight>


For PL/M, the following definitions would be used, with the appropiate subset cut-and-pasted into the programL
For PL/M, the following definitions would be used, with the appropiate subset cut-and-pasted into the programL
<lang pli>
<syntaxhighlight lang=pli>
DECLARE BINARY LITERALLY 'ADDRESS', CHARACTER LITERALLY 'BYTE';
DECLARE BINARY LITERALLY 'ADDRESS', CHARACTER LITERALLY 'BYTE';
DECLARE FIXED LITERALLY ' ', BIT LITERALLY 'BYTE';
DECLARE FIXED LITERALLY ' ', BIT LITERALLY 'BYTE';
Line 200: Line 200:
DECLARE ( A, B ) ADDRESS;
DECLARE ( A, B ) ADDRESS;
IF A > B THEN RETURN( A ); ELSE RETURN( B );
IF A > B THEN RETURN( A ); ELSE RETURN( B );
END MAX;</lang>
END MAX;</syntaxhighlight>


Note the lack of comments in the PL/M "include" file - this is because the definitions will be commented out for PL/I compilers by having a "/*" starting in column 81 preceeding the definitions and /* */ follow them.
Note the lack of comments in the PL/M "include" file - this is because the definitions will be commented out for PL/I compilers by having a "/*" starting in column 81 preceeding the definitions and /* */ follow them.