Compiler/Simple file inclusion pre processor: Difference between revisions

→‎{{header|ALGOL 68}}: Added some usage notes.
m (→‎{{header|AWK}}: Slight simplkfication and reduce unnecessary whitespace)
(→‎{{header|ALGOL 68}}: Added some usage notes.)
Line 56:
=={{header|ALGOL 68}}==
Should work with any Algol 68 implementation that uses upper-stropping.
<br><br>Implements file inclusion via pragmatic comments as in ALGOL 68G.
<br><br>A pragmatic comment such as <code>PR read "somefile.incl.a68" PR</code> or <code>PR include "somefile.incl.a68" PR</code> can appear anywhere in the source and will cause the text of somefile.incl.a68 to be included at that point (Note, ALGOL 68G does not support "include" as an alternative to "read").
<br>The PR...PR will not be recognised inside comments or string literals and cannot appear inside a symbol, i.e. 1PR...PR2 is 1 followed by a pragmatic comment followed by 2.
<br>
Line 64:
In ALGOL 68G, <code>PR read ...</code> only includes the file if it has not already been included, this is handled by this implementation but at most 200 different files can be included.
<br>
Includes can be nested to a depth of 10.
<br><br>
When run, the pre-processor will read source from standard input and write the resultant source to standard output. If standard output is re-directed to a temporary source file, it can then be compiled/interpreted with the actual Algol 68 compiler.
<lang algol68># Algol 68 pre-processor #
# Processes read/include pragmas in an Algol 68 upper stropping source #
3,028

edits