Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PL/I
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Preprocessor==== {{Further|PL/I preprocessor}} The first IBM ''Compile time [[preprocessor]]'' was built by the IBM Boston Advanced Programming Center located in Cambridge, Mass, and shipped with the PL/I F compiler. The <code>%INCLUDE</code> statement was in the Standard, but the rest of the features were not. The DEC and Kednos<ref name="kednos" /> PL/I compilers implemented much the same set of features as IBM, with some additions of their own. IBM has continued to add preprocessor features to its compilers. The preprocessor treats the written source program as a sequence of tokens, copying them to an output source file or acting on them. When a % token is encountered the following compile time statement is executed: when an identifier token is encountered and the identifier has been {{tt|DECLARE}}d, {{tt|ACTIVATE}}d, and assigned a compile time value, the identifier is replaced by this value. Tokens are added to the output stream if they do not require action (e.g., <code>+</code>), as are the values of ACTIVATEd compile time expressions. Thus a compile time variable {{tt|PI}} could be declared, activated, and assigned using <code>%PI='3.14159265'</code>. Subsequent occurrences of {{tt|PI}} would be replaced by <code>3.14159265</code>. The data type supported are <code>FIXED DECIMAL</code> integers and {{tt|CHARACTER}} strings of varying length with no maximum length. The structure statements are: * {{code|%[label_list:]DO iteration: statements; %[label_list:]END;|rexx}} * <code>%procedure_name: PROCEDURE (parameter list) RETURNS (type); statements...; %[label_list:]END;</code> * {{code|%[label_list:]IF...%THEN...%ELSE..|rexx}} and the simple statements, which also may have a {{code|[label_list:]}} * {{code|%ACTIVATE(identifier_list)}} and {{code|%DEACTIVATE}} * ''assignment'' statement * <code>%DECLARE identifier_attribute_list</code> * <code>%GO TO label</code> * <code>%INCLUDE</code> * ''null'' statement The feature allowed programmers to use identifiers for constants{{snd}} e.g., product part numbers or mathematical constants{{snd}} and was superseded in the standard by named constants for computational data. Conditional compiling and iterative generation of source code, possible with compile-time facilities, was not supported by the standard. Several manufacturers implemented these facilities.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)