xref: /titanic_41/usr/src/lib/libpp/i386/pptab.h (revision da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968)
1*da2e3ebdSchin /*
2*da2e3ebdSchin  *
3*da2e3ebdSchin  * Glenn Fowler
4*da2e3ebdSchin  * AT&T Research
5*da2e3ebdSchin  *
6*da2e3ebdSchin  * @(#)pp.tab (AT&T Labs Research) 2006-05-09
7*da2e3ebdSchin  *
8*da2e3ebdSchin  * C preprocessor tables and states
9*da2e3ebdSchin  *
10*da2e3ebdSchin  * + marks extensions to the standard
11*da2e3ebdSchin  *
12*da2e3ebdSchin  */
13*da2e3ebdSchin 
14*da2e3ebdSchin static struct ppkeyword directives[] =
15*da2e3ebdSchin {
16*da2e3ebdSchin 	"define",	DEFINE,
17*da2e3ebdSchin 	"elif",	ELIF,
18*da2e3ebdSchin 	"else",	ELSE,
19*da2e3ebdSchin 	"endif",	ENDIF,
20*da2e3ebdSchin 	"+endmac",	ENDMAC,
21*da2e3ebdSchin 	"error",	ERROR,
22*da2e3ebdSchin 	"if",	IF,
23*da2e3ebdSchin 	"ifdef",	IFDEF,
24*da2e3ebdSchin 	"ifndef",	IFNDEF,
25*da2e3ebdSchin 	"include",	INCLUDE,
26*da2e3ebdSchin 	"+let",	LET,
27*da2e3ebdSchin 	"line",	LINE,
28*da2e3ebdSchin 	"+macdef",	MACDEF,
29*da2e3ebdSchin 	"pragma",	PRAGMA,
30*da2e3ebdSchin 	"+rename",	RENAME,
31*da2e3ebdSchin 	"undef",	UNDEF,
32*da2e3ebdSchin 	"+warning",	WARNING,
33*da2e3ebdSchin 	0,	0
34*da2e3ebdSchin };
35*da2e3ebdSchin 
36*da2e3ebdSchin static struct ppkeyword options[] =
37*da2e3ebdSchin {
38*da2e3ebdSchin 	"allmultiple",	X_ALLMULTIPLE,
39*da2e3ebdSchin 	"allpossible",	X_ALLPOSSIBLE,
40*da2e3ebdSchin 	"builtin",	X_BUILTIN,
41*da2e3ebdSchin 	"catliteral",	X_CATLITERAL,
42*da2e3ebdSchin 	"cdir",	X_CDIR,
43*da2e3ebdSchin 	"checkpoint",	X_CHECKPOINT,
44*da2e3ebdSchin 	"chop",	X_CHOP,
45*da2e3ebdSchin 	"compatibility",	X_COMPATIBILITY,
46*da2e3ebdSchin 	"debug",	X_DEBUG,
47*da2e3ebdSchin 	"elseif",	X_ELSEIF,
48*da2e3ebdSchin 	"externalize",	X_EXTERNALIZE,
49*da2e3ebdSchin 	"final",	X_FINAL,
50*da2e3ebdSchin 	"hide",	X_HIDE,
51*da2e3ebdSchin 	"headerexpand",	X_HEADEREXPAND,
52*da2e3ebdSchin 	"headerexpandall",	X_HEADEREXPANDALL,
53*da2e3ebdSchin 	"hosted",	X_HOSTED,
54*da2e3ebdSchin 	"hostedtransition",	X_HOSTEDTRANSITION,
55*da2e3ebdSchin 	"hostdir",	X_HOSTDIR,
56*da2e3ebdSchin 	"id",	X_ID,
57*da2e3ebdSchin 	"ignore",	X_IGNORE,
58*da2e3ebdSchin 	"include",	X_INCLUDE,
59*da2e3ebdSchin 	"initial",	X_INITIAL,
60*da2e3ebdSchin 	"keyargs",	X_KEYARGS,
61*da2e3ebdSchin 	"line",	X_LINE,
62*da2e3ebdSchin 	"linebase",	X_LINEBASE,
63*da2e3ebdSchin 	"linefile",	X_LINEFILE,
64*da2e3ebdSchin 	"lineid",	X_LINEID,
65*da2e3ebdSchin 	"linetype",	X_LINETYPE,
66*da2e3ebdSchin 	"macref",	X_MACREF,
67*da2e3ebdSchin 	"map",	X_MAP,
68*da2e3ebdSchin 	"mapinclude",	X_MAPINCLUDE,
69*da2e3ebdSchin 	"modern",	X_MODERN,
70*da2e3ebdSchin 	"multiple",	X_MULTIPLE,
71*da2e3ebdSchin 	"native",	X_NATIVE,
72*da2e3ebdSchin 	"note",	X_NOTE,
73*da2e3ebdSchin 	"opspace",	X_OPSPACE,
74*da2e3ebdSchin 	"passthrough",	X_PASSTHROUGH,
75*da2e3ebdSchin 	"pedantic",	X_PEDANTIC,
76*da2e3ebdSchin 	"pluscomment",	X_PLUSCOMMENT,
77*da2e3ebdSchin 	"plusplus",	X_PLUSPLUS,
78*da2e3ebdSchin 	"plussplice",	X_PLUSSPLICE,
79*da2e3ebdSchin 	"pragmaflags",	X_PRAGMAFLAGS,
80*da2e3ebdSchin 	"pragmaexpand",	X_PRAGMAEXPAND,
81*da2e3ebdSchin 	"predefined",	X_PREDEFINED,
82*da2e3ebdSchin 	"prefix",	X_PREFIX,
83*da2e3ebdSchin 	"preserve",	X_PRESERVE,
84*da2e3ebdSchin 	"proto",	X_PROTO,
85*da2e3ebdSchin 	"prototyped",	X_PROTOTYPED,
86*da2e3ebdSchin 	"quote",	X_QUOTE,
87*da2e3ebdSchin 	"readonly",	X_READONLY,
88*da2e3ebdSchin 	"reguard",	X_REGUARD,
89*da2e3ebdSchin 	"reserved",	X_RESERVED,
90*da2e3ebdSchin 	"spaceout",	X_SPACEOUT,
91*da2e3ebdSchin 	"splicecat",	X_SPLICECAT,
92*da2e3ebdSchin 	"splicespace",	X_SPLICESPACE,
93*da2e3ebdSchin 	"standard",	X_STANDARD,
94*da2e3ebdSchin 	"statement",	X_STATEMENT,
95*da2e3ebdSchin 	"strict",	X_STRICT,
96*da2e3ebdSchin 	"stringspan",	X_STRINGSPAN,
97*da2e3ebdSchin 	"stringsplit",	X_STRINGSPLIT,
98*da2e3ebdSchin 	"system_header",	X_SYSTEM_HEADER,
99*da2e3ebdSchin 	"test",	X_TEST,
100*da2e3ebdSchin 	"text",	X_TEXT,
101*da2e3ebdSchin 	"transition",	X_TRANSITION,
102*da2e3ebdSchin 	"truncate",	X_TRUNCATE,
103*da2e3ebdSchin 	"vendor",	X_VENDOR,
104*da2e3ebdSchin 	"version",	X_VERSION,
105*da2e3ebdSchin 	"warn",	X_WARN,
106*da2e3ebdSchin 	"zeof",	X_ZEOF,
107*da2e3ebdSchin 	0,	0
108*da2e3ebdSchin };
109*da2e3ebdSchin 
110*da2e3ebdSchin static struct ppkeyword predicates[] =
111*da2e3ebdSchin {
112*da2e3ebdSchin 	"defined",	X_DEFINED,
113*da2e3ebdSchin 	"+exists",	X_EXISTS,
114*da2e3ebdSchin 	"+included",	X_INCLUDED,
115*da2e3ebdSchin 	"+match",	X_MATCH,
116*da2e3ebdSchin 	"+noticed",	X_NOTICED,
117*da2e3ebdSchin 	"+option",	X_OPTION,
118*da2e3ebdSchin 	"sizeof",	X_SIZEOF,
119*da2e3ebdSchin 	"+strcmp",	X_STRCMP,
120*da2e3ebdSchin 	0,	0
121*da2e3ebdSchin };
122*da2e3ebdSchin 
123*da2e3ebdSchin static struct ppkeyword readonlys[] =
124*da2e3ebdSchin {
125*da2e3ebdSchin 	"defined",	R_DEFINED,
126*da2e3ebdSchin 	0,	0
127*da2e3ebdSchin };
128*da2e3ebdSchin 
129*da2e3ebdSchin static struct ppkeyword variables[] =
130*da2e3ebdSchin {
131*da2e3ebdSchin 	"_Pragma",	V__PRAGMA,
132*da2e3ebdSchin 	"+ARGC",	V_ARGC,
133*da2e3ebdSchin 	"+BASE",	V_BASE,
134*da2e3ebdSchin 	"DATE",	V_DATE,
135*da2e3ebdSchin 	"FILE",	V_FILE,
136*da2e3ebdSchin 	"+FUNCTION",	V_FUNCTION,
137*da2e3ebdSchin 	"LINE",	V_LINE,
138*da2e3ebdSchin 	"+PATH",	V_PATH,
139*da2e3ebdSchin 	"+SOURCE",	V_SOURCE,
140*da2e3ebdSchin 	"-STDC",	V_STDC,
141*da2e3ebdSchin 	"TIME",	V_TIME,
142*da2e3ebdSchin 	"+VERSION",	V_VERSION,
143*da2e3ebdSchin 	"-default",	V_DEFAULT,
144*da2e3ebdSchin 	"-directive",	V_DIRECTIVE,
145*da2e3ebdSchin 	"-empty",	V_EMPTY,
146*da2e3ebdSchin 	"-getenv",	V_GETENV,
147*da2e3ebdSchin 	"-getmac",	V_GETMAC,
148*da2e3ebdSchin 	"-getopt",	V_GETOPT,
149*da2e3ebdSchin 	"-getprd",	V_GETPRD,
150*da2e3ebdSchin 	"-iterate",	V_ITERATE,
151*da2e3ebdSchin 	0,	0
152*da2e3ebdSchin };
153