home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / JRCPP.ZIP / USERS.DOC < prev   
Text File  |  1990-03-27  |  70KB  |  1,444 lines

  1.                         JRCPP USERS MANUAL (3/23/90)
  2.  
  3.  
  4.     Copyright (C) 1990 James Roskind, All rights reserved. Permission 
  5.     is  granted  to copy and distribute this file as part any machine 
  6.     readable archive containing the entire, unmodified, JRCPP  PUBLIC 
  7.     DISTRIBUTION PACKAGE (henceforth call the "Package").  The set of 
  8.     files that form the Package are described in the README file that 
  9.     is  a  part  of the Package.  Permission is granted to individual 
  10.     users of the Package to copy individual portions of  the  Package 
  11.     (i.e.,  component  files) in any form (e.g.: printed, electronic, 
  12.     electro-optical, etc.) desired  for  the  purpose  of  supporting 
  13.     users   of  the  Package  (i.e.,  providing  online,  or  onshelf 
  14.     documentation access; executing the  binary  JRCPP  code,  etc.).  
  15.     Permission  is  not  granted  to  distribute copies of individual 
  16.     portions of the Package, unless a machine readable version of the 
  17.     complete  Package  is also made available with such distribution. 
  18.     Abstracting with credit is permitted.   There  is  no  charge  or 
  19.     royalty  fee  required  for  copies  made in compliance with this 
  20.     notice.  To otherwise copy  elements  of  this  package  requires 
  21.     prior permission in writing from James Roskind.
  22.  
  23.     James Roskind
  24.     516 Latania Palm Drive
  25.     Indialantic FL 32903
  26.  
  27.     End of copyright notice
  28.  
  29.  
  30. What  the  above  copyright  means  is  that  you are free to use and 
  31. distribute (or even sell) the entire set of files  in  this  Package, 
  32. but  you  can't split them up, and distribute them as separate files.  
  33. The notice also says that you  cannot  modify  the  copies  that  you 
  34. distribute, and this ESPECIALLY includes NOT REMOVING the any part of 
  35. the copyright notice in any file.  JRCPP  currently  implements  a  C 
  36. Preprocessor,  but  the  users  of  this Package do NOT surrender any 
  37. right of ownership or copyright to any source text that is  processed 
  38. by JRCPP, either before or after processing.  Similarly, there are no 
  39. royalty or fee requirements for using the post-preprocessed output of 
  40. JRCPP.  
  41.  
  42. This  Package is expected to be distributed by shareware and freeware 
  43. channels (including BBS sites), but the fees paid for  "distribution" 
  44. costs  are  strictly  exchanged  between  the  distributor,  and  the 
  45. recipient, and James Roskind makes no express or  implied  warranties 
  46. about  the  quality  or integrity of such indirectly acquired copies.  
  47. Distributors  and  users  may  obtain   the   Package   (the   Public 
  48. distribution form) directly from the author by following the ordering 
  49. procedures in the REGISTRATION file.
  50.  
  51.  
  52. DISCLAIMER:
  53.  
  54. JAMES ROSKIND PROVIDES THIS FILE "AS  IS"  WITHOUT  WARRANTY  OF  ANY 
  55. KIND,  EITHER  EXPRESS  OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE 
  56. IMPLIED WARRANTIES OF MERCHANTABILITY OR  FITNESS  FOR  A  PARTICULAR 
  57. PURPOSE.   THE  ENTIRE  RISK AS TO THE QUALITY AND PERFORMANCE OF THE 
  58. PROGRAM AND DOCUMENTATION IS WITH YOU.   Some  states  do  not  allow 
  59. disclaimer  of express or implied warranties in certain transactions, 
  60. therefore, this statement may not apply to you.
  61.  
  62.  
  63. UNIX is a registered trademark of AT&T Bell Laboratories.
  64.  
  65.  
  66. _____________________________________________________________________
  67.  
  68.                      JRCPP USERS MANUAL (3/23/90)
  69.  
  70. Contents:
  71.  
  72. INTRODUCTION
  73. USERS MANUAL- USER INTERFACE- INTRODUCTION
  74. USERS MANUAL- USER INTERFACE- COMMAND LINE ARGUMENTS AND FLAGS
  75. USERS MANUAL- USER INTERFACE- Environment variable control
  76. USERS MANUAL- USER INTERFACE- Interactive interface (bug report support)
  77. APPENDIX A PREDEFINED MACRO NAMES (compatibility guide)
  78. APPENDIX B JRCPP STATIC LIMITS
  79.  
  80.  
  81. INTRODUCTION
  82.  
  83. JRCPP is a full ANSI C  compatible  preprocessor,  with  customizable 
  84. extensions   to   assist   in  transitioning  from  less  complete  C 
  85. preprocessor standards. Among the customizations available from JRCPP 
  86. is  support  for  preprocessing  of  C++  files  (note: this does not 
  87. include "translation" of C++ source code to  C  code).   The  command 
  88. line  interface  is  designed  to be compatible with the UNIX command 
  89. line interface for cpp (the traditional UNIX C Preprocessor).
  90.  
  91. Major Features of JRCPP:
  92.  
  93.     1) Full ANSI C standard support, with highly customizable options 
  94.        to assist in porting, development, and training. Customization 
  95.        can be used easily to support  many  special  C  preprocessing 
  96.        needs (see #pragma for descriptions of options).
  97.  
  98.     2) Full ANSI C macro definition and expansion capabilities.  This 
  99.        includes support for:
  100.  
  101.        a) ANSI C defined recursive macros expansion;
  102.  
  103.        b) ANSI C "##" paste operator;
  104.  
  105.        c) ANSI C "#" stringize operator;
  106.  
  107.        d)  Special  "macro  expansion  explanation" mode.  Useful for 
  108.           debugging, or as a tutorial/learning aid;
  109.  
  110.        e) Output file has line directive  that  identifies  the  line 
  111.           from  which  a token was derived, rather than ascribing the 
  112.           results to the line containing the macro  name  invocation; 
  113.           test
  114.  
  115.  
  116.     3) Full support of predefined ANSI C macros  including  __DATE__, 
  117.        __TIME__, __LINE__, ,__FILE__, and __STDC__ (or __cplusplus in 
  118.        C++ compatibility mode).
  119.         
  120.     4) Extensive customizable diagnostic capabilities.  This includes 
  121.        170+ diagnostics which provide:
  122.                 
  123.         a) Identification of all non-ANSI C preprocessing constructs.
  124.  
  125.         b) Production of all ANSI C suggested preprocessor warnings.
  126.  
  127.         c) Typically hidden activity trace (such as where #include is 
  128.            searching for a file).
  129.  
  130.         d) Customizable diagnostic responses include:
  131.  
  132.             1) Fine grain control over severity of EVERY diagnostic.
  133.  
  134.             2) Coarse control over response to groups of diagnostics.
  135.  
  136.     5)  Full  ANSI  C  preprocessor  "if"  construct  support.   This 
  137.        includes:
  138.     
  139.         a) Support for the ANSI C "#elif" construct
  140.     
  141.         b)   Traditional   support  for  "#if",  "#ifdef",  "ifndef", 
  142.            "#else", and "#endif"
  143.     
  144.         c) Support for the "defined()" and "defined" operators.
  145.     
  146.         d) ANSI C specified "#if" and  "#elif"  expression  expansion 
  147.            and evaluation.
  148.         
  149.     6)  Removal of common static limits on macro expansion (available 
  150.        memory is the only constraint).  This includes:
  151.     
  152.         a) No limit on the number of macros defined;
  153.     
  154.         b) No limit on the  number  of  arguments  for  function-like 
  155.            macros;
  156.     
  157.         c) No limit on the size of macro definitions;
  158.     
  159.         d) No limit on the size of macro expansions;
  160.     
  161.         e) No limit on the depth of nested include files;
  162.  
  163.     6)  Support  for  very long identifier names, with all characters 
  164.        considered  significant.   Optional  support  for  identifiers 
  165.        containing '$'.
  166.  
  167.     7)  Support  for  precomputation  of header file inclusion.  This 
  168.        involves preprocessing a complex header-file-set  in  advance, 
  169.        and constructing an "equivalent" single preprocessed file (see 
  170.        #pragma descriptions).
  171.  
  172.     8) Customizable C++ source compatibility.  This includes:
  173.  
  174.         a) optional support for // style comments
  175.  
  176.         b) optional support for __cplusplus macro INSTEAD of __STDC__
  177.  
  178.         c)  optional  support  for  "missing"  macro   arguments   as 
  179.            whitespace
  180.  
  181.         d)  optional  support  for  allowing  consecutive  tokens  to 
  182.             "merge"  after   preprocessing   (part   of   Classic   C 
  183.             preprocessor model).
  184.  
  185.         e)  optional support for various #include search schemes (re: 
  186.            where to look for a  file  specified  by  a  "...."  style 
  187.            #include directive).
  188.  
  189.         f) support for C++ tokenization of "->*" and ".*".
  190.  
  191.  
  192.  
  193. USERS MANUAL- USER INTERFACE- INTRODUCTION
  194.  
  195. JRCPP  has  three  main methods of acquiring information and commands 
  196. from a user, and one secondary method.  The first and primary  method 
  197. is  via  command  line  flags  and  arguments.   The second method of 
  198. transferring information is via  environment  variables.   The  third 
  199. method   makes  use  of  the  "#pragma"  construct  to  pass  precise 
  200. customization commands to the  preprocessor.   The  final  method  is 
  201. actually a tool to assist in providing problem reports to the vendor, 
  202. and makes use  of  a  simple  interactive  interface,  instigated  by 
  203. <cntrl><break>.
  204.  
  205.  
  206. USERS MANUAL- USER INTERFACE- COMMAND LINE ARGUMENTS AND FLAGS
  207.  
  208. As  mentioned,  the  command line interface is modeled after the UNIX 
  209. cpp command line interface.  The most typical use of JRCPP would be:
  210.  
  211.     jrcpp source.c procesed.i  >source.err
  212.  
  213. where "source.c" is the user supplied input source file, "procesed.i" 
  214. is  the  file name for the post-preprocessed C text, and "source.err" 
  215. is the name of a file that will receive error messages.
  216.  
  217.  
  218. The following is a synopsis of the command line interface:
  219.  
  220.     Usage: jrcpp [option_list] [infile [outfile]]
  221.       'infile' defaults to stdin, 'outfile' to stdout
  222.  
  223.   Options are read left to right, and enacted immediately.
  224.  
  225.   -B       Support // style comments
  226.   -Dname   Define preprocessor symbol 'name' to be 1
  227.   -H       Output pathnames of included files to stderr
  228.   -help    display list of command line options
  229.   -helppragma    display list of pragmas
  230.   -Idir    Add directory to search path for "*.h" selected files
  231.   -P       Don't produce #line directives in output
  232.   -Uname   Undefine preprocessor symbol 'name'
  233.   -undef   Undefine platform specific macros and __STDC__
  234.   -undefANSI  Undefine macros: __FILE__, __LINE__, __DATE__, __TIME__
  235.   -Ydir    Add directory to search path for <*.h> selected files
  236.  
  237.  
  238. The following are detailed descriptions of the command line options:
  239.  
  240. ----------------------------------------------
  241.   -B       Support // style comments
  242.  
  243. If the -B option is selected, then // style comments, as are  defined 
  244. in  C++,  are  honored.   A // style comment begins with the sequence 
  245. "//", and continues until the end of a line.  Note that  comments  do 
  246. not  nest.   Hence, a "/*" encountered during a // style comment will 
  247. be ignored. Similarly, a "//" encountered within a "/*" style comment 
  248. will  also  be  ignored.  Finally, comments are NOT looked for within 
  249. lexical tokens such  as  string  literals,  or  character  constants.  
  250. (e.g.: the text "hello///***there" does not start a comment).
  251.  
  252.  
  253. ----------------------------------------------
  254.   -Dname Define preprocessor symbol 'name' to be 1
  255.  
  256. The  -D  command  line  option  is used to define a macro in a manner 
  257. similar to what in achieved via:
  258.  
  259.     #define name 1
  260.  
  261. Note that the macro defined my this mechanism is  always  a  manifest 
  262. macro  (i.e.:not  a  function  like  macro), and the default value of 
  263. decimal one (1) is provided.  The slightly more complex form  of  the 
  264. command line:
  265.  
  266.    -Dname=token
  267.  
  268. is also supported.  In this form, the results are equivalent to:
  269.  
  270.     #define name token
  271.  
  272. but  there  is  the  significant restriction that "token" be a single 
  273. lexical token.  For example, the following is legal:
  274.  
  275.     -Dversion=200  -Dbuffer_size=default_buffer_size
  276.  
  277. but the following is illegal because the text is NOT a single token:
  278.  
  279.     -Dbuffer_size=2*default_buffer_size
  280.  
  281. The intent of support the -D option is to provide  a  simple  way  of 
  282. controlling   the  preprocessor.   More  complex  control  should  be 
  283. provided by using #if constructs in the source  to  regulate  complex 
  284. macro definitions.
  285.  
  286.  
  287. ----------------------------------------------
  288.   -H       Output pathnames of included files to stderr
  289.  
  290. When  this  option  is provided, the full path and file name for each 
  291. included file will be displayed on the screen  (stderr).   Each  file 
  292. will be separated by a space from the next file.  This option is most 
  293. useful for watching the progress the  preprocessor,  without  slowing 
  294. down  the computation.  Note that the "#pragma display_progress" is a 
  295. more dramatic way to watch progress, and also much more detailed (and 
  296. computationally expensive).
  297.  
  298.  
  299. ----------------------------------------------
  300.   -help    display list of command line options
  301.  
  302. The  -help  option  displays a complete list of all options currently 
  303. supported.   It  is  commonly  used  to  avoid  having  to  refer  to 
  304. documentation  for  JRCPP.   In addition, this option may reveal more 
  305. up-to-date information than even the documentation.
  306.  
  307. ----------------------------------------------
  308.   -helppragma    display list of pragmas
  309.  
  310. The -helppragma option  displays  a  complete  list  of  all  pragmas 
  311. currently supported.  It is commonly used to avoid having to refer to 
  312. documentation for JRCPP.  In addition, this option  may  reveal  more 
  313. up-to-date information than even the documentation.
  314.  
  315. ----------------------------------------------
  316.   -Idir    Add directory to search path for "*.h" selected files
  317.  
  318. The  -I  directory provides a mechanism for extending the application 
  319. include path.  The application include path is used for searching for 
  320. files  designated  in  a  "...."  style  include directive.  The text 
  321. provided with this option ("dir") is assumed to  be  a  directory  in 
  322. which  some  include  files may be found.  This command adds "dir" to 
  323. the end of the current applications search path, so that it  is  used 
  324. only  if  prior  entries on the search path do not expose the desired 
  325. file (based on a #include "..." directive).  This directory can be  a 
  326. relative  path  name,  but  this  complicates  the  search  algorithm 
  327. slightly (see LANGUAGE REFERENCE MANUAL for details).
  328.  
  329. Note that the include  file  searching  algorithm  is  based  on  two 
  330. distinct  paths: the application include path; and the system include 
  331. path.  When <...> style include directives are encountered, only  the 
  332. system  include  path  is  consulted during the search procedure.  In 
  333. contrast, when a "..." style include directive is encountered, a file 
  334. is  searched  for  locally,  then  searched for using the application 
  335. include path, and finally using the system include  path.   For  more 
  336. details  on  the  exact  algorithm  used,  see the LANGUAGE REFERENCE 
  337. MANUAL.  Also note that the  "#pragma  include_search"  provides  for 
  338. customization  of  the actual search algorithm.  See also the command 
  339. line option "-Ydir" in order to augment the system include path.
  340.  
  341.  
  342. ----------------------------------------------
  343.   -P       Don't produce #line directives in output
  344.  
  345. When the -P option is selected, the output will not contain any #line 
  346. directives.   Note  that when #line directives are provided, that the 
  347. output  for  long  lines  is  broken  up  using   backslash   newline 
  348. separators,  and  additional #line directives are added to compensate 
  349. for this "beautification".  In addition, when  #line  directives  are 
  350. provided,  long  series of blank lines are replaced by a single #line 
  351. directive. In contrast, when there are no #line directives, lines are 
  352. not  wrapped  using  escaped  newlines,  and blank lines are actually 
  353. provided as such (this is very common when long  block  comments  are 
  354. translated, during preprocessing, into blank lines).
  355.  
  356.  
  357. ----------------------------------------------
  358.   -Uname   Undefine preprocessor symbol 'name'
  359.  
  360. This  option  is  equivalent  to  the  preprocessor directive "#undef 
  361. name".  It is most commonly used to remove  (selectively)  the  macro 
  362. definitions  for platform specific macros (such as _JRCPP, or MSDOS), 
  363. but it CANNOT be used to undefine the special internal  macros  (such 
  364. as  __DATE__, and __STDC__).  It can also be used to undefine a macro 
  365. that was defined earlier on the command line. If it is  necessary  to 
  366. undefine  any internal macros, the command line option -undefANSI can 
  367. be used, or the "#pragma undefine_macros ..." pragma can be invoked.
  368.  
  369.  
  370. ----------------------------------------------
  371.   -undef   Undefine platform specific macros and __STDC__
  372.  
  373. The -undef option provides a  convenient  way  to  undefine  all  the 
  374. platform  specific macros as well as __STDC__.  Note that it does not 
  375. effect the  other  internal  macros  (__DATE__,  __TIME__,  __LINE__, 
  376. __FILE__), nor does it effect any macros defined on the command line.  
  377. This feature is commonly used during a porting operation,  where  the 
  378. target  compiler  is known not to be ANSI conformant, and hence it is 
  379. desirable to remove the __STDC__  macro  definition  along  with  the 
  380. platform specification.
  381.  
  382.  
  383. ----------------------------------------------
  384.   -undefANSI  Undefine macros: __FILE__, __LINE__, __DATE__, __TIME__
  385.  
  386. The -undefANSI is only necessary when the above 4 standard ANSI macro 
  387. names are interfering with some source code that  predates  the  ANSI 
  388. standard.   Note  that  this  functionality  is  also  supported  via 
  389. "#pragma undefine_macros ...".  In addition, once these  macros  have 
  390. been undefined in this manner, they CAN be redefined by the user, but 
  391. they can never resume their special meaning. Note  that  this  action 
  392. supports  a  very  non-conforming  porting  operation,  and is RARELY 
  393. necessary.
  394.  
  395.  
  396. ----------------------------------------------
  397.   -Ydir   Add directory to search path for <*.h> selected files
  398.  
  399. The -Ydir option  provides  a  mechanism  for  extending  the  system 
  400. include  path.  The  system  include path is used to search for files 
  401. designate by  a  <...>  style  include  directive,  and  used  as  an 
  402. alternate  path for finding files designated by a "..." style include 
  403. directive.  The argument "dir" provided with this option is  expected 
  404. to  be  a  directory  in  which some include files can be found.  The 
  405. argument is appended to the system include path, and  hence  is  only 
  406. considered  for  use  (as  a  prefix  for  a  file)  if  all  earlier 
  407. directories on the include path have failed  to  reveal  the  desired 
  408. file.   Note  that the directory provided is usually an absolute path 
  409. in a file system, but a relative  path  may  be  used  (see  LANGUAGE 
  410. REFERENCE MANUAL for detailed explanation of the use of this path).
  411.  
  412. Prior  to  examining  the  command  line,  the  environment  variable 
  413. "INCLUDE" is consulted and parsed to form an  initial  system  search 
  414. path.   With  this environment variable set to identify the directory 
  415. containing the system include files, it is rarely  necessary  to  use 
  416. this  -Y  option.   This  option can be useful if various versions of 
  417. system include files are being used (as  is  common  during  a  cross 
  418. compilation).    Note   that  for  such  use  to  be  effective,  the 
  419. environment variable "INCLUDE" must either not exist, or  contain  no 
  420. entries  (Note  that  directory  entries  in the environment variable 
  421. INCLUDE are separated by  semicolons,  and  spaces  adjacent  to  the 
  422. semicolons are discarded).
  423.  
  424.  
  425. USERS MANUAL- USER INTERFACE- Environment variable control
  426.  
  427. JRCPP  consults  the  system  environment at start up to provide some 
  428. default settings.  Currently, only the environment  variable  INCLUDE 
  429. is consulted, and its contents are parsed into a list of directories.  
  430. These directories form the basis for the "system include path".   See 
  431. the  LANGUAGE  REFERENCE  MANUAL  for details of the search algorithm 
  432. used to find #include files.
  433.  
  434. The "system include path" is a list of directories that are  searched 
  435. when  a  <....> style #include directive is encountered.  The "system 
  436. include path" is also used when a "...." style #include directive  is 
  437. being  processed,  and  neither  local searching, nor searches in the 
  438. "application include path" have revealed the requested file.
  439.  
  440. The "system include path" is specified in the environment by  a  list 
  441. of  absolute  or  relative  paths,  with  semicolons  to separate the 
  442. directories.  For example,  if  the  environment  variable  "INCLUDE" 
  443. contains:
  444.  
  445.     /include ; /local/include
  446.  
  447. Then  the  initial  value  of  the "system include path" would be the 
  448. directories "/include" and "/local/include".  Additional  directories 
  449. may also be added to this list using the command line option "-Ydir".
  450.  
  451. Under  most DOS and UNIX operating systems, a value, such as was just 
  452. described, may be placed into the environment using the command:
  453.  
  454.     set INCLUDE=/include;/local/include
  455.  
  456. See your operating system reference manual for more details  of  this 
  457. functionality.
  458.  
  459. Also  note  that  relative  paths  may  be  used, but the user should 
  460. carefully understand the consequences of such path  specifiers.   For 
  461. example, if the environment variable "INCLUDE" contains:
  462.  
  463.     /include ; ..
  464.  
  465. Then  the  initial  value  of  the "system include path" would be the 
  466. directory "/include", and the relative directory "..".   The  methods 
  467. by  which  such  relative  directories are resolved (with the postfix 
  468. being  the  requested  file  name)  can  vary  depending  on  whether 
  469. ancestral  searching  is permitted, and whether the current directory 
  470. is consulted.  In addition to the LANGUAGE REFERENCE MANUAL, see also 
  471. the description of the "#pragma include_search ..." directive.
  472.  
  473.  
  474.  
  475. USERS MANUAL- USER INTERFACE- PRAGMA DIRECTIVES
  476.  
  477. This  section describes the pragmas that are available.  This section 
  478. begins with a concise listing of  the  available  pragmas,  and  then 
  479. provides detailed explanation of the meanings of each pragma, and its 
  480. potential use.
  481.  
  482.  
  483.  
  484. CONCISE LIST OF PRAGMA DIRECTIVES
  485.  
  486. Each pragma has a base name  that  identifies  the  pragma  (such  as 
  487. "space_between_tokens"), and optionally some refining arguments.  The 
  488. following is concise list of the pragmas that are currently supported 
  489. by  JRCPP.  Note  that  any  pragmas that are encountered that do not 
  490. match  a  supported  pragma  format,  are  passed  unchanged  to  the 
  491. post-preprocessed  output  file.  Also note that the tokens on a line 
  492. with a pragma are NOT  macro  expanded,  and  are  taken  exactly  as 
  493. supplied.   Similarly,  unrecognized pragmas are passed to the output 
  494. without undergoing macro expansion.
  495.  
  496. In the  following  descriptions,  square  brackets  []  are  used  to 
  497. surround  optional  arguments.  The "|" operator may be read as "or", 
  498. and is used to indicate that either of the arguments may be supplied.  
  499. Parentheses  are  used  to  group  lists  of  alternative  arguments.  
  500. DIAGNOSTIC_NUMBER is a number between 1001 and 9999  inclusive.   All 
  501. other text is exactly what is allowed as an argument.  A similar list 
  502. of supported pragmas can be obtained using the  command  line  option 
  503. "-helppragma".
  504.  
  505.  
  506. BASE NAME            REFINING ARGUMENTS
  507.  
  508. after_output_dump    [macros][profile]
  509. cplusplus_comment    [on|off]
  510. cplusplus_mode
  511. delayed_expansion    [on|off]
  512. describe_macro_expansions    [on|off]
  513. diagnostic_adjust    DIAGNOSTIC_NUMBER (fatal|error|warning|hint|silent)
  514. diagnostic_adjust    (error|warning|hint|silent)
  515.             (fatal|error|warning|hint|silent)
  516. display_progress     [on|off]
  517. include_search       [current_directory]  [only_eldest_ancestor|
  518.                 only_youngest_ancestor|all_ancestors]
  519. space_between_tokens [on|off]
  520. undefine_macros      [ANSI] [STDC] [platform] [command_line] [user]
  521.  
  522.  
  523. The sections that follow describe the detailed interpretation of each 
  524. of the pragma directives listed above.
  525.  
  526. ----------------------------------------------
  527.     #pragma after_output_dump    [macros] [profile]
  528.  
  529. This pragma directs JRCPP to  append  some  additional  text  to  the 
  530. post-preprocessed   output   file.   The  two  option  are  either  a 
  531. performance profile of JRCPP, or a list of all the macros  that  were 
  532. defined at the end of the preprocessing action.
  533.  
  534. The  performance profile is most useful to the author of JRCPP, as it 
  535. reveals details of both memory usage and of function  call  activity. 
  536. All  the  profile information is contained in a comment, and hence it 
  537. does not effect the quality of the post-processed output.  Note  that 
  538. the  production  version of JRCPP does not have the required calls to 
  539. the profiling system, and hence very little information  is  provided 
  540. when  this  option is exercised.  In contrast, JRCPPSAF, and JRCPPTIM 
  541. perform detailed tracing of all function calls.
  542.  
  543. The distinction between JRCPPTIM and JRCPPSAF is that  JRCPPTIM  does 
  544. not have assertions, but does make use of an actual clock in order to 
  545. calculate time spent in each function.  Consequently,  the  profiling 
  546. information  gathered  during a run of JRCPPTIM is very indicative of 
  547. the performance of the production version JRCPP, which also  bypasses 
  548. assertion  checking.   The detailed timing provided by JRCPPTIM comes 
  549. at the cost of a severe decrease in overall execution time, as viewed 
  550. by the user (the careful maintenance of clock interval information is 
  551. very computationally expensive). JRCPPSAF is HEAVILY asserted  (i.e., 
  552. has  massive redundant code, with extensive internal error checking).  
  553. In addition, in JRCPPSAF calls to the tracing system are made, but in 
  554. the  interest  of speed, a real time clock is not used.  As a result, 
  555. it is very useful for providing problem reports (i.e.,  bug  reports) 
  556. to  the  JRCPP author, but it is slightly less useful for identifying 
  557. execution bottlenecks in JRCPP.   Note  that  JRCPP  (the  production 
  558. version)  has  neither  assertions, nor profiling calls, and hence is 
  559. the smallest  and  fastest  version  available.  Note  that  when  an 
  560. assertion is violated in JRCPPSAF, a complete stack dump is provided, 
  561. and hence it is generally quite apparent (to  the  author  of  JRCPP) 
  562. what the problem was.
  563.  
  564. If  you wish to complain about the performance (in terms of execution 
  565. time) of JRCPP with some specific source, you should use JRCPPTIM and 
  566. the  "#pragma  after_output_dump  profile"  to  document the problem.  
  567. Note that your complaint need only include commented out profile, and 
  568. you will NOT have to submit your actual source code. Often complaints 
  569. that are documented in this way can actually be fixed! (although  the 
  570. underlying  hardware  can  sometimes be the actual source of the poor 
  571. performance).  The information provided  in  this  output  identifies 
  572. where  JRCPP is spending its time, and if your source program focuses 
  573. on an area that was not sufficiently optimized, poor performance  can 
  574. result.
  575.  
  576. When "#pragma dump_after_output macros" is present in the source file 
  577. (or included file), then a complete dump of  the  macro  database  is 
  578. appended  to  the  post-preprocessed output file.  The format of this 
  579. output is a series of actual #define and #undef directives.
  580.  
  581. This particular pragma has two significant  applications  for  users. 
  582. The  first  application is in debugging complex source files, in that 
  583. the user is able to easily see exactly what macros were defined, what 
  584. their  definitions  were,  if  they  were ever undefined.  The second 
  585. major application is  in  precalculating  what  the  inclusion  of  a 
  586. complex  set  of include files would result in. From a users point of 
  587. view, including a single file that went on  to  include  other  files 
  588. which included ..., and contained extensive macro expansion activity, 
  589. may require a significant amount of  time  to  process,  and  may  be 
  590. repeated in many distinct source files.  With this macro dump option, 
  591. the user can construct a single header file that is equivalent  to  a 
  592. complex  set  of  nested  include files.  This resultant file is much 
  593. more than the simple concatenation  of  the  files,  as  its  initial 
  594. section  contains  the  fully  macro  expanded contents of the set of 
  595. files, while the latter section provides all  the  macro  definitions 
  596. that  were  active  at  the  end  of  the  complex set.  After such a 
  597. "summarizing" header file has been created, it is possible to include 
  598. only  this one header file, but achieve an equivalent result (in much 
  599. less time) to including the root of the complex nested  include  set. 
  600. Note  that  the macro definitions at the end of the header file cause 
  601. its inclusion to be IDENTICAL to including the original  header  file 
  602. sequence.
  603.  
  604. If  the above method of precalculating resulting header file contents 
  605. is  used,  one  slight  warning  must  be  observed.   The   repeated 
  606. preprocessing of the top section of a precalculated header file (when 
  607. it is used in lieu of the massive set of headers) will  automatically 
  608. provide  for  macro  expansions  in  that  text.   The user should be 
  609. certain that no macros are defined during this section of  code,  and 
  610. that  all  macros  are  defined only when the "macro dump" section is 
  611. encountered.  In order to assist in this, the pragma:
  612.  
  613.     #pragma undefine_macros platform command_line user
  614.  
  615. can be used prior to including the precomputed  single  header  file. 
  616. See  the  description of the the undefine_macros pragma later in this 
  617. section for more details of  its  operation.   Note  that  the  macro 
  618. definitions  at the end of the precomputed header file will reinstate 
  619. the desired platform specific macro definitions :-).
  620.  
  621.  
  622. ----------------------------------------------
  623.     #pragma cplusplus_comment    [on|off]
  624.  
  625. This pragma may be used to allow or disallow the support for // style 
  626. comments.   A  //  style  comment  begins with the character sequence 
  627. "//", and continues till the end of the line.  Note that by  default, 
  628. these  comments  (introduced  in the C++ language) are not supported. 
  629. The command line option "-B" can be used to direct  the  compiler  to 
  630. respect  such  comments, as can "#pragma cplusplus_comment on".  Note 
  631. that if no argument is supplied, then "#pragma cplusplus_comment"  is 
  632. by  default  equivalent  to  "#pragma  cplusplus_comment  on".   This 
  633. support for C++ style comments is only  provided  AFTER  the  newline 
  634. that  terminates  the  text  of  the  pragma (with argument "on"), or 
  635. disallowed AFTER the terminating newline.
  636.  
  637. Neither // style comments nor /* style comments nest.   In  addition, 
  638. comment  initiators  are NOT scanned for during the tokenization of a 
  639. string literal or character constant.  Hence the following are string 
  640. literals, and do NOT initiate a comment under any circumstances:
  641.  
  642.     "comments begin with /* or // on a line"
  643.  
  644. Similarly,  //  style  initiators are not scanned for during /* style 
  645. comments, and /* style initiators are not scanned for during // style 
  646. comments.   For  example,  the  following  3 lines are all considered 
  647. IDENTICAL after preprocessing:
  648.  
  649.     i++;
  650.     /* note that // has no effect in /* style comment */  i++;
  651.     i++; // note that /* in this comment is ignored
  652.     i++; // and the initial text of this line is used */
  653.  
  654. This pragma is most useful for turning  on  acceptance  of  //  style 
  655. comments  in  a  small section of code, without having to allow it in 
  656. all of the source file,  or  similarly  disallowing  it  in  a  small 
  657. section of code.
  658.  
  659.  
  660. ----------------------------------------------
  661.     #pragma cplusplus_mode
  662.  
  663. This  pragma  has two effects.  The simplest element of its action is 
  664. to enable // style  comments,  in  a  manner  identical  to  what  is 
  665. provided   by  "#pragma  cplusplus_comment  on".   The  other  action 
  666. performed by this pragma  is  that  the  ANSI  C  macro  __STDC__  is 
  667. undefined,  and  no  longer considered "special" in any way (i.e.: it 
  668. can now be the subject of macro definitions and undef  actions).   In 
  669. addition,  the macro __cplusplus is defined as 1 (the digit one), and 
  670. it is considered a special internal macro (i.e.:  it  cannot  be  the 
  671. subject of standard #define or #undef activities).
  672.  
  673. This  pragma is most useful when preprocessing C++ native code, which 
  674. may have dependency on __STDC__ NOT being defined, and/or  the  macro 
  675. __cplusplus being defined.
  676.  
  677.  
  678. ----------------------------------------------
  679.     #pragma delayed_expansion    [on|off]
  680.  
  681. This  option  allows  for  the  presence  of  directives,  during the 
  682. scanning for arguments to  a  function  like  macro.   Under  default 
  683. operation  (which  is  "off"), if an argument list is not complete by 
  684. the time a directive  is  encountered,  the  error  "missing  ')'  in 
  685. argument  list" is provided.  Since some directives do not change the 
  686. macro  database,  the  macro  expansion  of  argument  lists   across 
  687. directives  is  possible.  Note  that this delayed expansion does NOT 
  688. allow for #define, #undef, or #pragma actions within an argument list.
  689.  
  690. For example, consider the following code segment:
  691.  
  692.     #define F(x) a x 2
  693.     F(
  694.       #if expression
  695.         +
  696.       #else
  697.         -
  698.       #endif
  699.     )
  700.  
  701. Although this  is  not  guaranteed  to  be  understood  by  all  ANSI 
  702. compatible  preprocessors,  the  above  will  be  acceptable  if  the 
  703. delayed_expansion option is set to "on".  In contrast,  none  of  the 
  704. following  invocations of the macro "F" are legal, independent of the 
  705. setting of delayed_expansion:
  706.  
  707.     #define F(x) a x 2
  708.     F(
  709.     #pragma anything
  710.     +)
  711.     F(
  712.     #define anything
  713.     *)
  714.     F(
  715.     #undef anything
  716.     -)
  717.  
  718. If no argument is provided, the default of "on" is assumed.
  719.  
  720. This pragma is most useful when porting code that used these features 
  721. on some other platform, which silently supported "delayed_expansion".
  722.  
  723. As  clearly  stated  in the in the ANSI C Standard, and echoed in the 
  724. LANGUAGE REFERENCE MANUAL: if the results of macro expansion  provide 
  725. sequences  that  COULD  HAVE  BEEN  interpreted  as directives, these 
  726. sequences are NOT processed as directives.  Hence directives must  be 
  727. located  BEFORE  the  macro  expansion  process  takes place, and the 
  728. directives cannot be usefully provided as arguments to macros.
  729.  
  730.  
  731. ----------------------------------------------
  732.     #pragma describe_macro_expansions    [on|off]
  733.  
  734. This pragma causes an extensive amount of additional  information  to 
  735. be  provided  to  the  user  when  macro  expansion takes place.  The 
  736. information is provided in the diagnostics listings (via stdout), and 
  737. is  self  explanatory.   Note that this option may be turned "on" and 
  738. "off" selectively during a source file in order  to  see  the  actual 
  739. macro expansion activity in only a small section of code.
  740.  
  741. The  information  that  is  supplied  includes  a printout of a token 
  742. sequence before  and  after  each  step  of  macro  expansion.   Also 
  743. included  is a printout of the actual #define directive that is being 
  744. used in each step.  In the case of function like  macro  invocations, 
  745. an  explanation  is  provided of which arguments are themselves macro 
  746. expanded (or stringized), and what the results of  such  intermediate 
  747. goals are.  Finally, whenever a macro is explicitly "skipped" and not 
  748. expanded (in compliance with the ANSI  Standard  specifications  that 
  749. preclude  self  recursive  macro  expansion),  a notification of this 
  750. activity is provided.
  751.  
  752. This pragma  is  most  useful  when  debugging  complex  macros,  and 
  753. understanding  the  derivation  of expanded text.  In this regard, it 
  754. may also be used as a tutorial explaining  the  underlying  algorithm 
  755. (It can also be used to document errors in the preprocessor expansion 
  756. provided by bugs in JRCPP, if need be :-) ).
  757.  
  758.  
  759. ----------------------------------------------
  760.     #pragma diagnostic_adjust    DIAGNOSTIC_NUMBER
  761.         (fatal|error|warning|hint|silent)
  762.  
  763. This pragma is  used  to  adjust  the  severity  level  of  a  single 
  764. diagnostic.   For  a  complete list of diagnostics and their meaning, 
  765. see DIAGNOSTIC MESSAGE REFERENCE MANUAL.
  766.  
  767. As an example,  if  the  user  wishes  to  ignore  the  presences  of 
  768. diagnostic  4034  (which has a default severity level of "error", and 
  769. which would in turn  preclude  the  production  of  any  preprocessed 
  770. output), the directive:
  771.  
  772.     #pragma diagnostic_adjust 4034 warning
  773.  
  774. would  counsel  JRCPP  to  emit  only a "warning" when the diagnostic 
  775. inducing construct was identified.  Moreover, since  this  diagnostic 
  776. is  only  a  "warning"  now,  preprocessed  output  would be provided 
  777. (assuming no other errors were encountered).
  778.  
  779. Note that this  pragma  has  priority  over  the  alternate  form  of 
  780. diagnostic  level  adjustment,  that  controls  an  entire  class  of 
  781. diagnostics. For example, recall that the diagnostic message 4034 has 
  782. a  default  level of "error". Assume message 4034 is adjusted via the 
  783. pragma:
  784.  
  785.     #pragma diagnostic_adjust 4034 silent
  786.  
  787. at the same time as the coarse adjustments:
  788.  
  789.     #pragma diagnostic_adjust error fatal
  790.  
  791. were made. The fine grain diagnostic adjustment for 4034  would  have 
  792. priority  over  the  coarse adjustment (which makes all other default 
  793. "error" diagnostics into "fatal" level diagnostics). Hence diagnostic 
  794. 4034 will receive an actual severity level of "silent".
  795.  
  796. This  pragma  is  a fundamental part of the customization process for 
  797. JRCPP.  Aside from the obvious concept of  "silencing"  a  bothersome 
  798. message   that  dominates  the  diagnostic  listings,  several  other 
  799. activities may be performed.  The following  lists  common  uses  for 
  800. this pragma:
  801.  
  802. 1)  As  mentioned  above,  a  specific  diagnostic that dominates the 
  803. diagnostic listing for a given source file may be  TOTALLY  silenced, 
  804. and  hence  made  to never appear in the diagnostic list.  A slightly 
  805. less drastic action is to change the level to  "hint",  whereby  ONLY 
  806. the  first  occurrence  of  the  offending construct would generate a 
  807. diagnostic.
  808.  
  809. 2) If it is desirable to prevent header files or  later  source  code 
  810. from further modifying the severity level of diagnostics, this pragma 
  811. can be used to "lock out any use of itself".  In order to prevent any 
  812. further   use  of  diagnostic_adjust,  diagnostic  5007  ("diagnostic 
  813. display  may  be  diminished")  can  be  changed  to  "fatal".  Since 
  814. diagnostic  5007  is  provided  BEFORE  each change diagnostic_adjust 
  815. activity, any attempt at further modification of severity levels will 
  816. trigger this now "fatal" diagnostic, and terminate JRCPP.
  817.  
  818. 3)  If a single diagnostic has default severity level of "error", but 
  819. the user  considers  its  presence  acceptable,  then  the  user  can 
  820. downgrade the severity level and JRCPP will then produce preprocessed 
  821. output. Note that it is common to downgrade  a  specific  message  of 
  822. this sort to a "warning" so that the user will still be made aware of 
  823. the non-portable construct.
  824.  
  825. 4) If a specific diagnostic has a default severity level of "silent", 
  826. but  the  user  WANTS  to  see  the  information associated with that 
  827. diagnostic, then the severity level  may  be  changed  to  "warning".  
  828. This  is commonly done to follow some of the details of preprocessing 
  829. that are only illuminated via silent  diagnostics  (such  as  showing 
  830. what  directories  were  searched  and  in  what  order,  during  the 
  831. processing of a #include  directive).   See  the  DIAGNOSTIC  MESSAGE 
  832. REFERENCE  MANUAL  for  complete  descriptions of the diagnostics and 
  833. their explanation.  The reference manual contains a separate list  of 
  834. all of JRCPP's "silent" default diagnostics.
  835.  
  836. ----------------------------------------------
  837.     #pragma diagnostic_adjust    (error | warning | hint | silent)
  838.             (fatal | error | warning | hint | silent)
  839.  
  840. This  pragma  is used to manipulate a whole class of diagnostics to a 
  841. new severity level.  Note that the first level indicates the  default 
  842. severity  level  delineating  a  group of diagnostics, and the second 
  843. specifies the new level.  Note that the DIAGNOSTIC MESSAGE  REFERENCE 
  844. MANUAL  contains  a  complete list of diagnostics, sorted by severity 
  845. levels.  The meaning of the severity levels are  summarized  in  that 
  846. manual as:
  847.  
  848.         Fatal  ==> stop immediately
  849.         Error  ==> stop after complete error check of source
  850.         Warning==> continue, but notify user
  851.         Hint   ==> continue, but notify the user the first time only
  852.         Silent ==> continue, and don't notify user
  853.  
  854.  
  855. For  example,  if  a  user expects to receive absolutely no warnings, 
  856. then the following would enforce that fact:
  857.  
  858.     #pragma diagnostic_adjust warning error
  859.  
  860. With this directive in place,  any  warning  level  diagnostics  (not 
  861. adjusted by the aforementioned fine grain adjustment) would induce an 
  862. "error" in the diagnostic listing, and hence no  preprocessed  output 
  863. file would be produced.
  864.  
  865. As  another  example,  a  user with an interactive edit/compile cycle 
  866. might wish to stop the preprocessing at  the  first  error  that  was 
  867. encountered.   To  accomplish  this,  the  user  would  establish the 
  868. directive:
  869.  
  870.  
  871.     #pragma diagnostic_adjust error fatal
  872.  
  873. With this adjustment in place, any  diagnostic  that  occurs  with  a 
  874. default  level  of  "error"  (and  is  not  modified  by a fine grain 
  875. adjustment) will be treated like a fatal error, and the preprocessing 
  876. will abort immediately after rendering the diagnostic message.
  877.  
  878. As a last example of the use of this pragma, some users prefer not to 
  879. get any warnings, and only desire a list actual errors.   Such  users 
  880. can direct JRCPP to support this philosophy via:
  881.  
  882.     #pragma diagnostic_adjust warning silent
  883.     #pragma diagnostic_adjust hint    silent
  884.  
  885. Notice  that the above set of pragmas will direct JRCPP to produce no 
  886. messages  when  only  a  "warning"  or  "hint"  level  construct  was 
  887. identified.  Be advised that the first use of this pragma may trigger 
  888. a "hint" that that some diagnostic message may be obscured, and there 
  889. is  no  way  to silence this message (which appears BEFORE the pragma 
  890. takes effect).
  891.  
  892. If a user is "just curious", then all the "silent" diagnostics can be 
  893. exposed via the directive:
  894.  
  895.     #pragma diagnostic_adjust silent warning
  896.  
  897. and  the  resulting  diagnostic  listings  will  tend  to  be  fairly 
  898. voluminous.
  899.  
  900.  
  901. ----------------------------------------------
  902.     #pragma display_progress     [on|off]
  903.  
  904. This pragma causes the current line and file  number  that  is  being 
  905. scanned  (lexically  analysed)  to be displayed on stderr.  Note that 
  906. use is made of ANSI Terminal escape sequences to clear the  remainder 
  907. of  the line.  If an ANSI Display driver is not installed, extraneous 
  908. characters may appear at the end of each line.
  909.  
  910. This feature  is  most  useful  for  watching  the  progress  of  the 
  911. preprocessor,  (it  is nice to know something is being processed, and 
  912. that the system has not crashed).
  913.  
  914.  
  915. ----------------------------------------------
  916.     #pragma include_search [current_directory]
  917.         [only_eldest_ancestor|only_youngest_ancestor|all_ancestors]
  918.  
  919. The above pragma can be used to customize the search  algorithm  used 
  920. to  find include files.  A detailed discussion of the search strategy 
  921. is provided in the LANGUAGE REFERENCE manual.  This pragma allows the 
  922. user  to  include  or  exclude searching in the current directory, as 
  923. well as restricting or eliminating searches in ancestral  directories 
  924. (i.e.: directories that outer nested include-files were found in).
  925.  
  926. For  example,  if  it  is  desirable that the search strategy have NO 
  927. dependence on where source files are located, and only  make  use  of 
  928. the   current   directory   and   the   directories   listed  on  the 
  929. application/system include path, the the following pragma may be used:
  930.  
  931.     #pragma include_search current_directory
  932.  
  933. In contrast, if the current directory should be disregarded, and only 
  934. the  directory  of  the file that contains that #include directive in 
  935. question should be considered, then the following could be entered:
  936.  
  937.         #pragma include_search youngest_ancestor_only
  938.  
  939. Alternatively,  if  the  current  directory,  and/or  the   directory 
  940. associated  with  the  original  source  file  (the one listed on the 
  941. command line) should be used, then the following can be entered:
  942.  
  943.     #pragma include_search eldest_ancestor_only current_directory
  944.  
  945. Note that at start up of the preprocessor, the default setting of:
  946.  
  947.     #pragma include_search all_ancestors  current_directory
  948.  
  949. is active.  In contrast, the directive:
  950.  
  951.     #pragma include_search
  952.  
  953. prevents  the  use  of  any  directories  that   are   not   on   the 
  954. application/system  include  paths.   It  also  renders  useless  any 
  955. relative path entries in either of those include paths.
  956.  
  957. This pragma takes effect immediately, and  remains  in  effect  until 
  958. until  another  such  directive  is encountered.  This pragma is very 
  959. useful in porting application from other platforms, wherein different 
  960. standards  may exist.  Usefulness of this pragma is generally limited 
  961. to projects that have source and  header  files  spread  across  many 
  962. directories.  See the LANGUAGE REFERENCE manual for more examples, as 
  963. well as comments on several other compiler standards in this area.
  964.  
  965. If a  user  is  still  confused  about  the  details  of  the  search 
  966. algorithm,  there are several "silent" diagnostics that are triggered 
  967. by each step in the search process.  Consult the  DIAGNOSTIC  MESSAGE 
  968. REFERENCE  MANUAL  listing  of  diagnostics  by  severity  level, and 
  969. identify the "silent" messages relating to  include  file  searching.  
  970. Each  significant  diagnostic  can  be  made  visible by changing its 
  971. diagnostic  level  using  the   "#pragma   diagnostic_adjust   NUMBER 
  972. warning",  where  NUMBER  is  the  diagnostic  number of interest.  A 
  973. current list includes:
  974.  
  975.     #pragma diagnostic_adjust 3027 warning
  976.     #pragma diagnostic_adjust 3028 warning
  977.     #pragma diagnostic_adjust 3029 warning
  978.     #pragma diagnostic_adjust 3030 warning
  979.     #pragma diagnostic_adjust 3041 warning
  980.     #pragma diagnostic_adjust 3042 warning
  981.  
  982. When the above list of directives have been supplied,  it  should  be 
  983. very  easy  for  a user to trace the actions of the underlying search 
  984. algorithm by simply examining the diagnostic listing.
  985.  
  986.  
  987. ----------------------------------------------
  988.     #pragma space_between_tokens [on|off]
  989.  
  990. This pragma concerns the placement  of  spaces  between  tokens  that 
  991. might  otherwise  "flow  together"  in  the post preprocessed output. 
  992. Consider the sample sequence:
  993.  
  994.     #define BASE_TYPE(x) int
  995.     long BASE_TYPE(int)name;
  996.  
  997. If spaces were not added between tokens, then the  above  code  would 
  998. expand to:
  999.  
  1000.     long intname;
  1001.  
  1002. and  be "misinterpreted" during compilation.  The default performance 
  1003. of such sequences is to provide at least one space between every pair 
  1004. of  tokens,  and  hence guarantee that this "problem" cannot surface. 
  1005. The default performance by JRCPP (and the performance associated with 
  1006. turning this option "on") would be a preprocessed output of:
  1007.  
  1008.     long int name ;
  1009.  
  1010. Since  the  preprocessed output is produced all at once at the end of 
  1011. the entire preprocessing pass, it is  not  generally  significant  to 
  1012. turn  this feature on and off at different points in the source text.  
  1013. It   does    however    have    an    impact    on    the    "#pragma 
  1014. describe_macro_expansions",  and  may  be  useful  for clarity and/or 
  1015. brevity in such listings.
  1016.  
  1017. This option is most useful when a user actually WANTS  such  adjacent 
  1018. tokens  to  "flow  together".  This performance is similar to what is 
  1019. provided in several classical C compilers, and hence can be  selected 
  1020. for  conformity.   Note  that  space  found in the source code is NOT 
  1021. removed when this option is set to "off".  Spaces are  however  added 
  1022. regularly  when this option is set to "on" (which is also the default 
  1023. for this pragma).
  1024.  
  1025. Note that setting this option to "off" does not  quite  provided  all 
  1026. the  conformance  that  might  be  desired  with  some classical (re: 
  1027. non-ANSI) preprocessors.  Specifically, even with this option set  to 
  1028. "off",  tokens  will  NOT  flow together during the preprocessor scan 
  1029. (and hence would not be recognized as a macro name for example),  but 
  1030. they might flow together during output.
  1031.  
  1032.  
  1033. ----------------------------------------------
  1034.     #pragma undefine_macros      [ANSI] [STDC] [platform]
  1035.                     [command_line] [user]
  1036.  
  1037. This  pragma  provides  a  mechanism to quickly and easily undefine a 
  1038. large group of macros, without having  to  name  them  directly.   In 
  1039. addition,  it  provides  a mechanism for undefining the ANSI standard 
  1040. macros (which are protected from #define and #undef activity).   Note 
  1041. that  the  use of this pragma provides strictly NON-ANSI performance, 
  1042. but may be very useful when porting non-ANSI code.
  1043.  
  1044. Each of the arguments  specifies  a  group  of  macros.   The  "ANSI" 
  1045. argument  indicates that the macros __DATE__, __TIME__, __LINE__, and 
  1046. __FILE__  should  be  undefined.   The  "STDC"  argument  means  that 
  1047. __STDC__  (or  __cplusplus  if  we  have  enabled C++ mode) should be 
  1048. undefined.  The  "platform"  argument  indicates  that  all  platform 
  1049. dependent  macros  (currently  _JRCPP  and  MSDOS) be undefined.  The 
  1050. "command_line" argument directs the undefining of  all  macros  given 
  1051. definition  via  the  "-D"  command line option.  Finally, the "user" 
  1052. argument forced the removal of definitions of all  macros  that  have 
  1053. been defined via #define directives from with the source files.
  1054.  
  1055. Note  that the "#pragma dump_after_output macros" pragma groups these 
  1056. macros under their related headings.  This dumping pragma  should  be 
  1057. used  if  there  is  any  question  about what the target of the bulk 
  1058. undefine pragma is.  Moreover, by examining the  dumps  after  trying 
  1059. several    distinct    bulk   undefined   activities   (re:   #pragma 
  1060. undefine_macros ....) it is trivial for a user to identify the  exact 
  1061. results of each bulk undefine.
  1062.  
  1063.  
  1064.  
  1065.  
  1066. USERS  MANUAL-  USER  INTERFACE-  Interactive  interface (bug report
  1067. support)
  1068.  
  1069. The interactive interface to JRCPP is  only  intended  as  a  support 
  1070. feature  when  there  is  a problem (possible bug) within JRCPP. With 
  1071. this thought in mind, this  section  will  start  by  discussing  the 
  1072. procedure  that  should  be  followed  prior  to  making  use  of the 
  1073. interactive interface.
  1074.  
  1075. This interface was placed in JRCPP to facilitate several  classes  of 
  1076. problem  (bug)  reports.   The  interface  is  activated  by pressing 
  1077. <cntrl><break> while JRCPP is running.  If the version of JRCPP  that 
  1078. is executing is not tracing function calls (JRCPP does not trace, but 
  1079. JRCPPSAF and JRCPPTIM do perform tracing) then it may be necessary to 
  1080. press  <cntrl><break>  a  second  time  in  order  to  interrupt  the 
  1081. preprocessing.   In  any  case,   once   the   interrupt   has   been 
  1082. acknowledged,  the  user  will  be  provided  with  a  simple menu of 
  1083. options. These options are rather self explanatory, may prove  useful 
  1084. in diagnosing a problem in JRCPP.
  1085.  
  1086. The following are list of items that should be undertaken in order to 
  1087. gather data for a bug report:
  1088.  
  1089. 1) If you suspect that you are exercising a bug in JRCPP, try running 
  1090. JRCPPSAF with the same input.  If indeed you have provided input that 
  1091. reveals a bug in  JRCPP,  there  is  a  tremendous  probability  that 
  1092. JRCPPSAF  will  diagnose  the  problem,  and  provide  a  listing  of 
  1093. information to send to the author of JRCPP.  If JRCPPSAF is  able  to 
  1094. diagnose  the  problem  (it has a tremendous amount of internal error 
  1095. checking and redundancy) then you will get a message indicating  that 
  1096. an  "ASSERT  FAILURE"  has occurred.  The output that is displayed on 
  1097. the screen should be redirected  to  a  file,  and  this  information 
  1098. should  be sent in as part of (if not the entire) bug report.  Please 
  1099. submit such listings (which do NOT usually need to include your code) 
  1100. to the author of JRCPP, and a fix will be provided.
  1101.  
  1102. Note that if ever JRCPPSAF produces an "ASSERT FAILURE" message, then 
  1103. you have indeed found a bug in JRCPP.  All  the  output  provided  by 
  1104. this  assertion  should  be  submitted as part of the problem report. 
  1105. There is a chance that the error was in the assertion, and not in the 
  1106. actual code, but certainly there is an error.
  1107.  
  1108. 2) If JRCPPSAF exhibits different performance from JRCPP (and in fact 
  1109. JRCPPSAF works!), then you have a very  interesting  bug.   Typically 
  1110. such  bugs  have  been  caused  by the development environment (read: 
  1111. compiler) used to create  JRCPP.   These  bugs  tend  to  arise  when 
  1112. "overly  optimistic",  if  not just plain "buggy", optimizers seek to 
  1113. trade speed for correctness. Fortunately, the work around is  to  use 
  1114. JRCPPSAF  (which runs slower, but at least correctly).  Please report 
  1115. this bug, and an attempt will be made to provided a JRCPP  that  does 
  1116. not exhibit erroneous performance.  Unfortunately, a complete fix for 
  1117. this sort of bug does require some source text that demonstrates that 
  1118. JRCPP and JRCPPSAF behave differently.  If you are unable to provided 
  1119. this, at least the work around mentioned above will support you until 
  1120. a new release (which hopefully will fix the problem) will arrive.
  1121.  
  1122.  
  1123. 3)  If  both JRCPP and JRCPPSAF provide the same performance, then it 
  1124. should be assumed that you have an "algorithmic" bug.  If the problem 
  1125. involves  a  point for which no subjective interpretation is involved 
  1126. (such as: "the machine hangs"), then  proceed  to  step  4.   If  the 
  1127. problem  is  subjective,  then  please  document a small example that 
  1128. shows that JRCPP acts in opposition to the ANSI Standard.  To  submit 
  1129. a  bug  report does not require that you quote chapter and verse from 
  1130. the Standard, but you must document your complaint and submit it.   A 
  1131. response  will  either  be  a  bug fix, a work around, or an argument 
  1132. explaining why the JRCPP author does not believe there is  a  bug  at 
  1133. all.
  1134.  
  1135. To  assist  in gathering evidence to support your position you should 
  1136. consider using the #pragma directives that report the  activities  of 
  1137. the preprocessor. Specifically, the "#pragma describe_macro_expansion 
  1138. on" can be useful when there is a disagreement about how a small area 
  1139. of  text is being macro expanded (note that this pragma can be turned 
  1140. on immediately in front of the  questionable  area,  and  turned  off 
  1141. immediately  after  the  area.   Turning  it on and then off around a 
  1142. small area will GREATLY reduce the amount of  diagnostic  information 
  1143. that is produced.
  1144.  
  1145. If  the question involves the #include directive, and where/how it is 
  1146. finding files, then the "silent" diagnostics that trace this activity 
  1147. should  be changed to "warnings".  With this change, you should get a 
  1148. very precise list of what JRCPP is doing as it searches for a file.
  1149.  
  1150. 4) If you have reached this step, then both JRCPP and  JRCPPSAF  have 
  1151. caused  the same erroneous performance.  The performance is so severe 
  1152. that you can not provide simple documentation (as  was  suggested  in 
  1153. step  3),  and you really wish you had something more like a symbolic 
  1154. debugger to help  you  identify  the  problem.  As  a  sanity  check, 
  1155. consider the following questions:
  1156.  
  1157.     a) Are you running on an 8088 based machine?  If you are,
  1158.         are you using a special  version that is compiled
  1159.         for an 80286 instruction set by accident?
  1160.     b) Are you using an MSDOS version 3.0 or later? Versions
  1161.         2.0 and higher MIGHT work, but there has
  1162.         been no formal testing.
  1163.     c) Do you have at least 300K of free memory? This amount
  1164.         of memory would not be enough to run much, but at least
  1165.         you would get a diagnostic informing you of the problem.
  1166.     d) Are you running any TSR (Terminate and Stay Resident)
  1167.         programs in the background that **might** in some
  1168.         way effect the running of JRCPP?
  1169.     e) Do any of your other programs run?
  1170.     f) etc.
  1171.  
  1172. Since  both  JRCPP  and JRCPPSAF have exhibited the same problem, all 
  1173. further examination should be performed using JRCPPSAF.  The JRCPPSAF 
  1174. code  supports  many  aspects  of introspection (re: identifying what 
  1175. function is active) much better than JRCPP.
  1176.  
  1177. If you cannot get JRCPPSAF to correctly process even the simplest  of 
  1178. files,  then  there  is  some  problem  that  goes  well  beyond what 
  1179. "debugging" can do.  Assuming you have answered the  list  of  sanity 
  1180. check  questions  given above, you may either contact JRCPP to obtain 
  1181. support or a refund for your registration fee.  The  paragraphs  that 
  1182. follow discuss the scenario where JRCPPSAF works at least some of the 
  1183. time (i.e., on some simple test programs).
  1184.  
  1185. The first line of defense for a hang (possibly an  infinite  loop  in 
  1186. JRCPP)  is  to add "#pragma display_progress" to the source code that 
  1187. is causing the difficulty.  Often the user can see with  this  option 
  1188. that  progress  is  actually being made.  Note that a user can easily 
  1189. cause an infinite loop by having a  file  include  itself,  but  this 
  1190. would  be  very visible once the user has activated the above pragma.  
  1191. Assuming that the progress does stop at some point (the display stops 
  1192. changing),  then  there  is some more reason to believe that JRCPP is 
  1193. acting incorrectly. Note that the  line  numbers  may  stop  changing 
  1194. momentarily as JRCPP expands a large block of lines that preceded the 
  1195. scan point.
  1196.  
  1197. Assuming you are having a problem like "the machine hangs", the first 
  1198. question is: what is being processed when the hang occurs?  Hopefully 
  1199. you will have the answer to this question based  on  turning  on  the 
  1200. #pragma  display_progress.  Note that it is possible to provide a set 
  1201. of macros that cause exponentially much time (read: a LONG...TIME) to 
  1202. be  needed  to  complete  their  expansion.   One way to monitor this 
  1203. activity is  to  activate  "#pragma  describe_macro_expansion".   The 
  1204. information  provided by this option may be very massive, but it will 
  1205. show progress  at  a  granularity  that  cannot  be  seen  simply  by 
  1206. observing the line number (re: display_progress).
  1207.  
  1208. Assuming  you  have  seen  the display_progress stop, and you believe 
  1209. that an infinite loop is present, you should  attempt  the  following 
  1210. items.   First  you should turn "#pragma describe_macro_expansion" on 
  1211. near the point at which JRCPP seems to hang.  Note that if you  place 
  1212. this  call  too  late  in the source, then you will NOT get ANY extra 
  1213. output. When it is placed prior to the offending code, then at  least 
  1214. some  output will be produced. If output from both pragmas stop being 
  1215. produced (and there is no use of the "off" options of these pragmas), 
  1216. then you have indeed found an infinite loop in JRCPP.
  1217.  
  1218. Assuming  you  have  isolated  an  infinite  loop by the method given 
  1219. above, the following steps can be used to obtain  information  for  a 
  1220. bug  report.  The  goal here is to isolate the functions within JRCPP 
  1221. that are were called to instigate this infinite loop.  To start  this 
  1222. process,  press  <cntrl><break>.   Pressing  this once should cause a 
  1223. prompt to appear.  If you press this once, and the  prompt  does  not 
  1224. appear within a second or so, then there is probably an infinite loop 
  1225. in some single function, but pressing <cntrl><break>  a  second  time 
  1226. should  get the prompt.  If you still don't get the prompt, then your 
  1227. system has probably crashed beyond hope, and you will have to contact 
  1228. customer  service  for  support, or at least run the same source code 
  1229. through  JRCPPSAF  under  OS2  (which  theoretically  is  more  crash 
  1230. resistant that DOS).
  1231.  
  1232. Assuming   now   that   you  have  gained  control  of  JRCPPSAF  via 
  1233. <cntrl><break>, select first the option that displays the ancestry of 
  1234. include  files.   A  user  should  confirm  that  the  ancestry is as 
  1235. expected (e.g.: not a list demonstrating an error in the user's  code 
  1236. by  way  of  unlimited  recursive  inclusion).   Next the user should 
  1237. select the option to "output execution profile to stdout".  This will 
  1238. provide a list of the functions that are currently active, as well as 
  1239. a list of all the functions that were called up to  this  point  (the 
  1240. user should be collecting all the output in a file for a bug report).  
  1241. If possible, the option to "continue  running  main  program"  should 
  1242. next  be entered (if you had to press <cntrl><break> twice, then this 
  1243. option will not be provided).  If you were able  to  "continue",  you 
  1244. should  again press <cntrl><break>, and obtain another listing of the 
  1245. execution profile (this will very concisely verify that  no  progress 
  1246. has  been made). Finally, you should select the option to "terminate, 
  1247. and return to operating system".  The  output  gathered  during  this 
  1248. brief  encounter with the interactive interface should be supplied to 
  1249. the authors of JRCPP as part of a bug report.  It may be possible  to 
  1250. diagnose  the bug without seeing the source code that induced it, but 
  1251. it is commonly helpful for this sort of bug to  see  the  problematic 
  1252. source.   Please  send  as  much  information as possible (in machine 
  1253. readable form) in as part of your bug report.
  1254.  
  1255.  
  1256.  
  1257. APPENDIX A  PREDEFINED MACRO NAMES
  1258.  
  1259. Users should note that many compilers surreptitiously define  several 
  1260. preprocessor macro names, and then rely on these definitions to cause 
  1261. the related header files to act correctly.  When a user is trying  to 
  1262. switch  over  to using JRCPP from an existing systems C preprocessor, 
  1263. the user should first attempt to locate a list of exactly which macro 
  1264. names   need   to   be   defined.   Experience  has  shown  that  the 
  1265. documentation provided by many vendors is often  incomplete  in  this 
  1266. area.   In  order  to  overcome  such a lack of documentation, a user 
  1267. should attempt to preprocess with the system  supplied  preprocessor, 
  1268. and  then  compare  the  postpreprocessed text to what is produced by 
  1269. JRCPP.  Typically this comparisons identifies places  in  the  header 
  1270. files  where such dependencies exist, and the appropriate definitions 
  1271. can be added the command line for JRCPP.  As a second  approach,  the 
  1272. system  header  files can be searched for text (via utilities such as 
  1273. "grep", or "ts") for the  words  "ifdef",  "ifndef",  and  "defined".  
  1274. These  searches  tend  to  uncover  most macro dependencies in system 
  1275. header files.
  1276.  
  1277. When JRCPP is processing  a  file,  aside  from  the  ANSI  specified 
  1278. internal  macro  definitions,  definitions  are  given to "MSDOS" and 
  1279. "_JRCPP".  Is is rather  straightforward  (within  JRCPP)  to  verify 
  1280. exactly  what  macros  are defined, as the "#pragma after_output_dump 
  1281. macros" supplies exactly such a listing.  During  a  transition  from 
  1282. some other preprocessor to JRCPP, it may prove desirable (in order to 
  1283. cause the system header files to function  correctly)  to  have  some 
  1284. specific  macro  names  defined.   The  user has the option of simply 
  1285. defining such identifiers on the command line (via the "-D"  option), 
  1286. or  defining them within actual source files.  The following lines of 
  1287. code  demonstrate  how  (for  example)  "foo"  and   "goo"   can   be 
  1288. economically  defined  by  adding  just  a few lines to a centralized 
  1289. header file:
  1290.  
  1291.         #ifdef JRCPP
  1292.            #define foo 1
  1293.            #define goo 1
  1294.        #endif
  1295.  
  1296. The following are sections provide lists of macros that have appeared 
  1297. on several platforms.  In each case the actual macro name is enclosed 
  1298. in double quotes, in order to clearly isolate the name that is  being 
  1299. discussed.   For example, the fact that "MSDOS" is often defined on a 
  1300. certain  platform  is  equivalent  to  indicating   that   there   is 
  1301. effectively a definition of the form:
  1302.  
  1303.     #define MSDOS 1
  1304.  
  1305. As individual vendors and/or users provided information in this area, 
  1306. this document will grow to accommodate such inclusions.
  1307.  
  1308.  
  1309. MICROSOFT C COMPATIBILITY
  1310.  
  1311. When compiling with  Microsoft  C  products  for  DOS  and  OS2,  the 
  1312. following are some common macro definitions:
  1313.  
  1314. "MSDOS"  is always defined (by default this is also provided by JRCPP 
  1315.         when running on a DOS platform).
  1316.  
  1317. Depending on what memory model is  used  during  compilation  (Small, 
  1318. Medium, Compact, Large, or Huge), one of the following will typically 
  1319. be defined:
  1320.  
  1321. "M_I86SM" "M_I86MM" "M_I86CM" "M_I86LM" "M_I86HM"
  1322.  
  1323. One or more of the  following  may  be  defined  based  on  what  the 
  1324. restrictions  are  for  code generation (i.e., 8088 compatibility vs. 
  1325. use of full 80286 instruction set):
  1326.  
  1327. "M_I86", "M_I8086", "M_I286"
  1328.  
  1329. "NO_EXT_KEYS" is defined when the Microsoft extensions are disabled.
  1330.  
  1331. Depending on the default for a plain  "char"  (it  may  be  "unsigned 
  1332. char" or "signed char"), the following may be defined:
  1333.  
  1334. "_CHAR_UNSIGNED"
  1335.  
  1336.  
  1337.  
  1338. SUN WORKSTATION COMPATIBILITY (RUNNING DEFAULT UNIX COMPILER)
  1339.  
  1340. When  the  compilation  is for Sun computer, and the compiler used is 
  1341. the default UNIX system compiler, the following may be defined:
  1342.  
  1343. "unix", "m68k", "sun", "mc68000"
  1344.  
  1345. On a Sun 2-nnn system, the following may be defined to  indicate  the 
  1346. underlying processor:
  1347.  
  1348. "M68010", "mc68010"
  1349.  
  1350. On  a  Sun  3-nnn system, the following may be defined to specify the 
  1351. underlying processor:
  1352.  
  1353. "M68020" and "mc68020"
  1354.  
  1355.  
  1356.  
  1357. GENERIC MACRO DEFINITIONS
  1358.  
  1359. On most systems, one of the following operating system specifiers  is 
  1360. predefined:
  1361.  
  1362. "ibm", "gcos", "os", "tss", "unix", "MSDOS"
  1363.  
  1364. One  or  more  of the following hardware specifier macros may also be 
  1365. defined:
  1366.  
  1367. "interdata",
  1368. "pdp11", "vax",
  1369. "u370",
  1370. "u3b", "u3b2", "u3b5", "u3b15", "u3b20d",
  1371. "m68k", "mc68000", "mc68010", "mc68020", "M68010", "M68020",
  1372. "ns32000",
  1373. "iAPX286", "i386", "M_I86", "M_I8086", "M_I286",
  1374. "RES",
  1375. "RT",
  1376. "sparc", "sun"
  1377.  
  1378.  
  1379. "Lint like" error checking is  enhanced  on  some  systems  when  the 
  1380. following is defined:
  1381.  
  1382. "lint"
  1383.  
  1384.  
  1385.  
  1386. APPENDIX B JRCPP STATIC LIMITS
  1387.  
  1388. The  following  are  the  current  static  limits  for JRCPP.  Future 
  1389. versions of JRCPP will use  dynamic  reallocation,  and  hence  these 
  1390. limits will vanish (subject to available memory in the system).
  1391.  
  1392. 1)  The  level  of  nesting  parenthesis  within  #if/elif expression 
  1393.    (approximately  50  levels).   This  limitation  is  based  on   a 
  1394.    restriction  provided  by the parsing engine implemented via YACC.  
  1395.    This restriction will  vanish  in  future  versions  when  dynamic 
  1396.    reallocation is installed into this engine.
  1397.  
  1398. 2)  The  nesting of #if...#endif directive groups.  (approximately 35 
  1399.    levels) This limitation is based on a restriction provided by  the 
  1400.    parsing  engine  implementation  via  YACC.  This restriction will 
  1401.    vanish in future versions when dynamic reallocation  is  installed 
  1402.    into this engine.
  1403.  
  1404. 3)  The  length  of  a  single token (e.g.: a long identifier, a long 
  1405.    string literal, a long section of a comment  on  a  single  line).  
  1406.    Note  that  a  comment is broken into pieces as it crosses newline 
  1407.    boundaries (non-escaped newline boundaries), and hence the  length 
  1408.    of  each  "piece"  must  stay below this limit, whereas the entire 
  1409.    comment may be  MUCH  longer.   This  limitation  is  based  on  a 
  1410.    restriction  provided  by  the  lexical  analyser FLEX, and should 
  1411.    vanish in future versions as dynamic reallocation is supported  in 
  1412.    the lexing engine.
  1413.  
  1414. 4) The level of nested argument expansion in macros is bounded by the 
  1415.    size of the program stack.  This should VERY rarely be a  problem.  
  1416.    This  will  only  appear  of a function like macro has an argument 
  1417.    that must be expanded, and it in turn  contains  a  function  like 
  1418.    macro  that  has  an  argument  that  must  be expanded, ....  For 
  1419.    example, the macro definition: #define F(x) x with  an  invocation 
  1420.    construct  of the form: F( F( F( F( F( F( F( F( F( F( F( F( F(...( 
  1421.    F( F(2)))...))))))))))))))) may exceed the stack limitation.   The 
  1422.    stack  size  in  a  non-bound version of JRCPP (MSDOS only) can be 
  1423.    adjusted upwards to increase this limit on stack size.   The  OS/2 
  1424.    only  version is compiled with the largest possible stack size, so 
  1425.    it can not be adjusted, but it is rarely  a  problem.   The  bound 
  1426.    version  is  a slight compromise, in that it cannot be adjust, and 
  1427.    it is not excessively large.
  1428.  
  1429. 5) The levels of nested include files when one of the source files is 
  1430.    actually  stdin.   This  limitation  is only notable when JRCPP is 
  1431.    using stdin to provided the original source file.   The  mechanism 
  1432.    used to generally avoid ANY limit on nested include files requires 
  1433.    the  ability  to  locate  the  current  position  within  a  file, 
  1434.    temporarily  close  the  file,  and  later  reopen the file at the 
  1435.    correct position. Unfortunately, stdin  does  not  fit  into  this 
  1436.    general  scheme,  and  the  limit  on  the  number of file handles 
  1437.    provided  by  the  system  will  restrict  the  level  of   nested 
  1438.    inclusion.   On  a  typical  MSDOS/OS2  system,  this limit should 
  1439.    typically be about 17 (a total of 20, minus one for each of  stdin 
  1440.    stdout,  and  stderr).   IF  registered  users complain about this 
  1441.    slight limitation, then it will be removed.  Note that there is NO 
  1442.    LIMIT on the depth of nested include files when stdin is not being 
  1443.    used.
  1444.