Section 2: Compiler
The following example illustrates the rules for concatenating tokens:
The following example illustrates the rules for creating string literals:
After string concatenation, the above result appears as follows:
Space around the ' # ' and ' ## ' operators is optional.
2.16.6.
Line and Name Control
A preprocessing directive of the following form causes the compiler to behave as
if the line number of the next source line is the number specified by the decimal
constant in the directive:
A preprocessing directive of the following form sets the line number as specified
above and changes the presumed name of the source file to be the filename
shown in the string literal:
Macro names among the preprocessor tokens following the #line directive are
processed the same as any other macro names in the file. The directive that
results after macro substitution must match one of the two previous forms and is
processed accordingly.
TI-89 / TI-92 Plus Sierra C Assembler Reference Manual
#define paste(a,b)
#define opnd_info(n)
#define HITHERE
paste(HI,THERE)
opnd_info(2)
/* Results After Preprocessing */
hello, world!
op2_info(size2(),type2())
#define stringize(s)
#define expand(s)
#define max(a,b)
#define show_macro(m)
show_macro(max(a,b))
/* Results After Preprocessing */
printf("max(a,b)" " becomes " "((a) > (b) ? (a) : (b))""\n")
printf("max(a,b) becomes ((a) > (b) ? (a) : (b))\n")
#line decimal_constant
#line decimal_constant "file_name"
a ## b
op##n##_info(size##n(),type##n())
hello, world!
# s
stringize(s)
((a) > (b) ? (a) : (b))
printf(#m " becomes " expand(m)"\n")
Not for Distribution
99
Beta Version February 2, 2001