98
Section 2: Compiler
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
2.16.5. Macro
Examples
The following example illustrates the rules for redefinition, tokenization, macro
replacement, and replacement list reexamination:
#define x
3
#define q
x
#define f(i)
f(q + (i->m))
#define b
b + c
#undef x
#define x
5
#define z(a)
a
#define g
f
#define j
)
#define d
+
#define e
+
#define r(a, b)
(a)(b)
#define s(a, b)
a(b)
#define y
g(y)
r(f, g)
s(f, q)
g(36j
#undef q
#define q
d
f(b + c)
f(y)
35d+12
35e+12
/* Results After Preprocessing */
(f)(5)
f(5 + (4->m))
f(36)
f(+ + (b + c + c->m))
f(+ + (f(y)->m))
35++12
35e+12