home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / TOP / USR / SRC / scpp.t.Z / scpp.t / INTERP < prev    next >
Text File  |  2009-11-06  |  2KB  |  48 lines

  1. Interpretation rules:
  2. Text is, by default, interpreted.  The following chart shows what sections
  3. of preprocessor directives are not interpreted (i.e. no macro interpretation,
  4. no preprocessor line interpretation).  Note, however that the lexical analyzer
  5. is still used -- this prevents the recognition of floating point numbers as
  6. an instance of a formal parameter named, for example, "e4".
  7.  
  8. (\n is an unescaped newline -- escaped newlines are recognized)
  9.  
  10. # line n ..............\n
  11.  
  12. # line n filename .....\n
  13.               (the filename is treated as garbage)
  14. # line n "filename"....\n
  15.               (the filename is not interp'ed 'cause it's tween "")
  16.               (#line lines are no-ops)
  17. # include "file".......\n
  18.                       (again, "file" is in quotes & is not interpreted)
  19. # include <file>.......\n
  20.        -----
  21. # define macro replacement-text\n
  22.     ------------------------- (if 'macro' is one to interpret)
  23.         ------              (if 'macro' is not one to interpret --
  24.                    also, the line is a no-op in this case)
  25. # define macro( f1 , f2 , f3 ...) replacement-text with formals\n
  26.     ---------------------------------------------------------
  27.     ------------------------- (if 'macro' is not one to be interpreted)
  28.   (the above case is strange in that the formal parameters in the replacement
  29.    text must be protected against interpretation)
  30.    [remember to allow comments in the formals]
  31. # undef macro .........\n  (a no-op if 'macro' is not to be interpreted)
  32.        ------
  33. # ifdef macro .........\n  (also a no-op if 'macro is not -M'ed, except that
  34.        ------            there must be a matching #endif or #else)
  35. # ifndef macro ........\n  (same note as above)
  36.         ------
  37. # else.................\n
  38.  
  39. # endif................\n
  40.  
  41. # if expression\n  (if the truth of the expression is known, this is
  42.                     interpreted.  Otherwise it is not)
  43. #\n
  44.  
  45.  
  46. Special case: text is not interpreted (but preprocessor lines are interpreted)
  47.  during the scan for the actual parameters of a macro with parameters.
  48.