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 >
Wrap
Text File
|
2009-11-06
|
2KB
|
48 lines
Interpretation rules:
Text is, by default, interpreted. The following chart shows what sections
of preprocessor directives are not interpreted (i.e. no macro interpretation,
no preprocessor line interpretation). Note, however that the lexical analyzer
is still used -- this prevents the recognition of floating point numbers as
an instance of a formal parameter named, for example, "e4".
(\n is an unescaped newline -- escaped newlines are recognized)
# line n ..............\n
# line n filename .....\n
(the filename is treated as garbage)
# line n "filename"....\n
(the filename is not interp'ed 'cause it's tween "")
(#line lines are no-ops)
# include "file".......\n
(again, "file" is in quotes & is not interpreted)
# include <file>.......\n
-----
# define macro replacement-text\n
------------------------- (if 'macro' is one to interpret)
------ (if 'macro' is not one to interpret --
also, the line is a no-op in this case)
# define macro( f1 , f2 , f3 ...) replacement-text with formals\n
---------------------------------------------------------
------------------------- (if 'macro' is not one to be interpreted)
(the above case is strange in that the formal parameters in the replacement
text must be protected against interpretation)
[remember to allow comments in the formals]
# undef macro .........\n (a no-op if 'macro' is not to be interpreted)
------
# ifdef macro .........\n (also a no-op if 'macro is not -M'ed, except that
------ there must be a matching #endif or #else)
# ifndef macro ........\n (same note as above)
------
# else.................\n
# endif................\n
# if expression\n (if the truth of the expression is known, this is
interpreted. Otherwise it is not)
#\n
Special case: text is not interpreted (but preprocessor lines are interpreted)
during the scan for the actual parameters of a macro with parameters.