xref: /titanic_51/usr/src/lib/libpp/common/pp.tab (revision da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968)
1*da2e3ebdSchin#
2*da2e3ebdSchin# Glenn Fowler
3*da2e3ebdSchin# AT&T Research
4*da2e3ebdSchin#
5*da2e3ebdSchin# @(#)pp.tab (AT&T Labs Research) 2006-05-09
6*da2e3ebdSchin#
7*da2e3ebdSchin# C preprocessor tables and states
8*da2e3ebdSchin#
9*da2e3ebdSchin# + marks extensions to the standard
10*da2e3ebdSchin#
11*da2e3ebdSchin
12*da2e3ebdSchin%keywords "static struct ppkeyword directives"
13*da2e3ebdSchin
14*da2e3ebdSchin	define
15*da2e3ebdSchin	elif
16*da2e3ebdSchin	else
17*da2e3ebdSchin	endif
18*da2e3ebdSchin	+endmac
19*da2e3ebdSchin	error
20*da2e3ebdSchin	if
21*da2e3ebdSchin	ifdef
22*da2e3ebdSchin	ifndef
23*da2e3ebdSchin	include
24*da2e3ebdSchin	+let
25*da2e3ebdSchin	line
26*da2e3ebdSchin	+macdef
27*da2e3ebdSchin	pragma
28*da2e3ebdSchin	+rename
29*da2e3ebdSchin	undef
30*da2e3ebdSchin	+warning
31*da2e3ebdSchin
32*da2e3ebdSchin%keywords "static struct ppkeyword options" prefix=X_ index=optindex last=last_option
33*da2e3ebdSchin
34*da2e3ebdSchin	allmultiple
35*da2e3ebdSchin	allpossible
36*da2e3ebdSchin	builtin
37*da2e3ebdSchin	catliteral
38*da2e3ebdSchin	cdir
39*da2e3ebdSchin	checkpoint
40*da2e3ebdSchin	chop
41*da2e3ebdSchin	compatibility
42*da2e3ebdSchin	debug
43*da2e3ebdSchin	elseif
44*da2e3ebdSchin	externalize
45*da2e3ebdSchin	final
46*da2e3ebdSchin	hide
47*da2e3ebdSchin	headerexpand
48*da2e3ebdSchin	headerexpandall
49*da2e3ebdSchin	hosted
50*da2e3ebdSchin	hostedtransition
51*da2e3ebdSchin	hostdir
52*da2e3ebdSchin	id
53*da2e3ebdSchin	ignore
54*da2e3ebdSchin	include
55*da2e3ebdSchin	initial
56*da2e3ebdSchin	keyargs
57*da2e3ebdSchin	line
58*da2e3ebdSchin	linebase
59*da2e3ebdSchin	linefile
60*da2e3ebdSchin	lineid
61*da2e3ebdSchin	linetype
62*da2e3ebdSchin	macref
63*da2e3ebdSchin	map
64*da2e3ebdSchin	mapinclude
65*da2e3ebdSchin	modern
66*da2e3ebdSchin	multiple
67*da2e3ebdSchin	native
68*da2e3ebdSchin	note
69*da2e3ebdSchin	opspace
70*da2e3ebdSchin	passthrough
71*da2e3ebdSchin	pedantic
72*da2e3ebdSchin	pluscomment
73*da2e3ebdSchin	plusplus
74*da2e3ebdSchin	plussplice
75*da2e3ebdSchin	pragmaflags
76*da2e3ebdSchin	pragmaexpand
77*da2e3ebdSchin	predefined
78*da2e3ebdSchin	prefix
79*da2e3ebdSchin	preserve
80*da2e3ebdSchin	proto
81*da2e3ebdSchin	prototyped
82*da2e3ebdSchin	quote
83*da2e3ebdSchin	readonly
84*da2e3ebdSchin	reguard
85*da2e3ebdSchin	reserved
86*da2e3ebdSchin	spaceout
87*da2e3ebdSchin	splicecat
88*da2e3ebdSchin	splicespace
89*da2e3ebdSchin	standard
90*da2e3ebdSchin	statement
91*da2e3ebdSchin	strict
92*da2e3ebdSchin	stringspan
93*da2e3ebdSchin	stringsplit
94*da2e3ebdSchin	system_header
95*da2e3ebdSchin	test
96*da2e3ebdSchin	text
97*da2e3ebdSchin	transition
98*da2e3ebdSchin	truncate
99*da2e3ebdSchin	vendor
100*da2e3ebdSchin	version
101*da2e3ebdSchin	warn
102*da2e3ebdSchin	zeof
103*da2e3ebdSchin
104*da2e3ebdSchin%keywords "static struct ppkeyword predicates" prefix=X_ index=optindex
105*da2e3ebdSchin
106*da2e3ebdSchin	defined
107*da2e3ebdSchin	+exists
108*da2e3ebdSchin	+included
109*da2e3ebdSchin	+match
110*da2e3ebdSchin	+noticed
111*da2e3ebdSchin	+option
112*da2e3ebdSchin	sizeof
113*da2e3ebdSchin	+strcmp
114*da2e3ebdSchin
115*da2e3ebdSchin%keywords "static struct ppkeyword readonlys" prefix=R_
116*da2e3ebdSchin
117*da2e3ebdSchin	defined
118*da2e3ebdSchin
119*da2e3ebdSchin%flags	# state : coupled, high frequency
120*da2e3ebdSchin
121*da2e3ebdSchin	ADD			# add pp.addbuf into output buffer
122*da2e3ebdSchin	COLLECTING		# collecting macro call arguments
123*da2e3ebdSchin	COMPATIBILITY		# compatibility (Reiser) dialect
124*da2e3ebdSchin	COMPILE			# tokenize for compiler
125*da2e3ebdSchin	CONDITIONAL		# processing #[el]if directive
126*da2e3ebdSchin	DEFINITION		# processing macro definition
127*da2e3ebdSchin	DIRECTIVE		# processing directive
128*da2e3ebdSchin	DISABLE			# disable macro evaluation
129*da2e3ebdSchin	EOF2NL			# pass eof as newline token
130*da2e3ebdSchin	ESCAPE			# \ -> \\ in QUOTE|SQUOTE
131*da2e3ebdSchin	FILEPOP			# 0 on IN_FILE pop - no popin
132*da2e3ebdSchin	HEADER			# processing include statement
133*da2e3ebdSchin	HIDDEN			# hidden lines encountered
134*da2e3ebdSchin	JOINING			# joining adjacent strings
135*da2e3ebdSchin	NEWLINE			# last non-space was newline
136*da2e3ebdSchin	NOEXPAND		# no macro expansions or disables
137*da2e3ebdSchin	NOSPACE			# don't pass space+ as token
138*da2e3ebdSchin	NOTEXT			# don't output text
139*da2e3ebdSchin	NOVERTICAL		# vertical space invalid
140*da2e3ebdSchin	PASSEOF			# pass EOF as 0 without pop
141*da2e3ebdSchin	PASSTHROUGH		# ppcpp expands # lines only
142*da2e3ebdSchin	QUOTE			# processing "..." token
143*da2e3ebdSchin	SKIPCONTROL		# skip until # control or EOF
144*da2e3ebdSchin	SKIPMACRO		# disable next macro
145*da2e3ebdSchin	SPACEOUT		# output spaces in STANDALONE
146*da2e3ebdSchin	SQUOTE			# processing '...' token
147*da2e3ebdSchin	STANDALONE		# output tokens on stdout
148*da2e3ebdSchin	STRICT			# strict implementation
149*da2e3ebdSchin	STRIP			# strip quotes from T_STRING and T_CHARCONST
150*da2e3ebdSchin	SYNCLINE		# output line sync soon
151*da2e3ebdSchin	TRANSITION		# on the COMPATIBILITY boundary
152*da2e3ebdSchin	WARN			# note obnoxious incompatibilities
153*da2e3ebdSchin
154*da2e3ebdSchin%flags	# mode : coupled, low frequency
155*da2e3ebdSchin
156*da2e3ebdSchin	ALLMULTIPLE		# all files can be included more than once
157*da2e3ebdSchin	BUILTIN			# mark macro definitions builtin
158*da2e3ebdSchin	CATLITERAL		# concatenate adjacent "..."
159*da2e3ebdSchin	DUMP			# do a checkpoint dump
160*da2e3ebdSchin	EXPOSE			# expose hidden macros
161*da2e3ebdSchin	EXTERNALIZE		# set PROTO_EXTERNALIZE
162*da2e3ebdSchin	FILEDEPS		# output file dependencies
163*da2e3ebdSchin	GENDEPS			# missings FILEDEPS are generated
164*da2e3ebdSchin	HEADERDEPS		# <...> too for FILEDEPS
165*da2e3ebdSchin	HOSTED			# hosted include file
166*da2e3ebdSchin	HOSTEDTRANSITION	# hosted include files get __STDC__=0
167*da2e3ebdSchin	INACTIVE		# inactive conditional branch
168*da2e3ebdSchin	INIT			# initialization phase
169*da2e3ebdSchin	LOADING			# loading a checkpoint file
170*da2e3ebdSchin	MARKC			# last ppsearch() file was in C language
171*da2e3ebdSchin	MARKHOSTED		# last ppsearch() file was hosted
172*da2e3ebdSchin	MARKMACRO		# mark macro to disable later
173*da2e3ebdSchin	PEDANTIC		# pedantic non-hosted non-standard warnings
174*da2e3ebdSchin	READONLY		# mark macro definitions readonly
175*da2e3ebdSchin	RELAX			# relax complaints for this directive
176*da2e3ebdSchin
177*da2e3ebdSchin%flags # options : uncoupled, low frequency
178*da2e3ebdSchin
179*da2e3ebdSchin	ALLPOSSIBLE		# ignore top level conditionals
180*da2e3ebdSchin	DEFINITIONS		# output macro definitions
181*da2e3ebdSchin	ELSEIF			# #else if|ifdef|ifndef ok
182*da2e3ebdSchin	FINAL			# final hosted macro value
183*da2e3ebdSchin	HEADEREXPAND		# HEADEREXPANDALL but macro args not expanded
184*da2e3ebdSchin	HEADEREXPANDALL		# expanded < does not quote #include macros
185*da2e3ebdSchin	IGNORELINE		# ignore #line until first file arg
186*da2e3ebdSchin	INITIAL			# initial hosted macro value
187*da2e3ebdSchin	KEEPNOTEXT		# keep NOTEXT setting
188*da2e3ebdSchin	KEYARGS			# name=value macro arguments
189*da2e3ebdSchin	MODERN			# generate modern output (\a instead of \007)
190*da2e3ebdSchin	NATIVE			# report native paths
191*da2e3ebdSchin	NOHASH			# don't hash PP_COMPILE T_ID's
192*da2e3ebdSchin	NOISE			# convert T_X_* to T_NOISES
193*da2e3ebdSchin	NOISEFILTER		# filter (ignore) NOISE
194*da2e3ebdSchin	NOPROTO			# disable ppproto()
195*da2e3ebdSchin	PLUSCOMMENT		# enable C++ comments
196*da2e3ebdSchin	PLUSPLUS		# preprocess for C++
197*da2e3ebdSchin	PLUSSPLICE		# C++ // \<newline> does not splice
198*da2e3ebdSchin	PRAGMAEXPAND		# expand #pragma args
199*da2e3ebdSchin	PREDEFINED		# mark macro definitions predefined
200*da2e3ebdSchin	PREDEFINITIONS		# output predefined macro definitions
201*da2e3ebdSchin	PREFIX			# prefix include for compatibility
202*da2e3ebdSchin	PRESERVE		# preserve input layout
203*da2e3ebdSchin	PROTOTYPED		# force all input to be prototyped
204*da2e3ebdSchin	REGUARD			# emit header guard define at file pop
205*da2e3ebdSchin	SPLICECAT		# \<newline> ok for COMPATIBILITY catenation
206*da2e3ebdSchin	SPLICESPACE		# \<space>+<newline> == \<newline> for jcl
207*da2e3ebdSchin	STRINGSPAN		# <newline> in string ok
208*da2e3ebdSchin	STRINGSPLIT		# "...\\n..." => "..."\n"..."
209*da2e3ebdSchin	TRUNCATE		# truncate identifiers
210*da2e3ebdSchin	ZEOF			# ^Z anywhere in file => EOF
211*da2e3ebdSchin
212*da2e3ebdSchin%keywords "static struct ppkeyword variables" prefix=V_ index=optindex
213*da2e3ebdSchin
214*da2e3ebdSchin	_Pragma
215*da2e3ebdSchin	+ARGC
216*da2e3ebdSchin	+BASE
217*da2e3ebdSchin	DATE
218*da2e3ebdSchin	FILE
219*da2e3ebdSchin	+FUNCTION
220*da2e3ebdSchin	LINE
221*da2e3ebdSchin	+PATH
222*da2e3ebdSchin	+SOURCE
223*da2e3ebdSchin	-STDC
224*da2e3ebdSchin	TIME
225*da2e3ebdSchin	+VERSION
226*da2e3ebdSchin	-default
227*da2e3ebdSchin	-directive
228*da2e3ebdSchin	-empty
229*da2e3ebdSchin	-getenv
230*da2e3ebdSchin	-getmac
231*da2e3ebdSchin	-getopt
232*da2e3ebdSchin	-getprd
233*da2e3ebdSchin	-iterate
234