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