parse.c 122 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537
  1. /* Driver template for the LEMON parser generator.
  2. ** The author disclaims copyright to this source code.
  3. */
  4. /* First off, code is include which follows the "include" declaration
  5. ** in the input file. */
  6. #include <stdio.h>
  7. #line 56 "parse.y"
  8. #include "sqliteInt.h"
  9. /*
  10. ** An instance of this structure holds information about the
  11. ** LIMIT clause of a SELECT statement.
  12. */
  13. struct LimitVal {
  14. Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
  15. Expr *pOffset; /* The OFFSET expression. NULL if there is none */
  16. };
  17. /*
  18. ** An instance of this structure is used to store the LIKE,
  19. ** GLOB, NOT LIKE, and NOT GLOB operators.
  20. */
  21. struct LikeOp {
  22. Token eOperator; /* "like" or "glob" or "regexp" */
  23. int not; /* True if the NOT keyword is present */
  24. };
  25. /*
  26. ** An instance of the following structure describes the event of a
  27. ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
  28. ** TK_DELETE, or TK_INSTEAD. If the event is of the form
  29. **
  30. ** UPDATE ON (a,b,c)
  31. **
  32. ** Then the "b" IdList records the list "a,b,c".
  33. */
  34. struct TrigEvent { int a; IdList * b; };
  35. /*
  36. ** An instance of this structure holds the ATTACH key and the key type.
  37. */
  38. struct AttachKey { int type; Token key; };
  39. #line 47 "parse.c"
  40. /* Next is all token values, in a form suitable for use by makeheaders.
  41. ** This section will be null unless lemon is run with the -m switch.
  42. */
  43. /*
  44. ** These constants (all generated automatically by the parser generator)
  45. ** specify the various kinds of tokens (terminals) that the parser
  46. ** understands.
  47. **
  48. ** Each symbol here is a terminal symbol in the grammar.
  49. */
  50. /* Make sure the INTERFACE macro is defined.
  51. */
  52. #ifndef INTERFACE
  53. # define INTERFACE 1
  54. #endif
  55. /* The next thing included is series of defines which control
  56. ** various aspects of the generated parser.
  57. ** YYCODETYPE is the data type used for storing terminal
  58. ** and nonterminal numbers. "unsigned char" is
  59. ** used if there are fewer than 250 terminals
  60. ** and nonterminals. "int" is used otherwise.
  61. ** YYNOCODE is a number of type YYCODETYPE which corresponds
  62. ** to no legal terminal or nonterminal number. This
  63. ** number is used to fill in empty slots of the hash
  64. ** table.
  65. ** YYFALLBACK If defined, this indicates that one or more tokens
  66. ** have fall-back values which should be used if the
  67. ** original value of the token will not parse.
  68. ** YYACTIONTYPE is the data type used for storing terminal
  69. ** and nonterminal numbers. "unsigned char" is
  70. ** used if there are fewer than 250 rules and
  71. ** states combined. "int" is used otherwise.
  72. ** sqlite3ParserTOKENTYPE is the data type used for minor tokens given
  73. ** directly to the parser from the tokenizer.
  74. ** YYMINORTYPE is the data type used for all minor tokens.
  75. ** This is typically a union of many types, one of
  76. ** which is sqlite3ParserTOKENTYPE. The entry in the union
  77. ** for base tokens is called "yy0".
  78. ** YYSTACKDEPTH is the maximum depth of the parser's stack. If
  79. ** zero the stack is dynamically sized using realloc()
  80. ** sqlite3ParserARG_SDECL A static variable declaration for the %extra_argument
  81. ** sqlite3ParserARG_PDECL A parameter declaration for the %extra_argument
  82. ** sqlite3ParserARG_STORE Code to store %extra_argument into yypParser
  83. ** sqlite3ParserARG_FETCH Code to extract %extra_argument from yypParser
  84. ** YYNSTATE the combined number of states.
  85. ** YYNRULE the number of rules in the grammar
  86. ** YYERRORSYMBOL is the code number of the error symbol. If not
  87. ** defined, then do no error processing.
  88. */
  89. #define YYCODETYPE unsigned char
  90. #define YYNOCODE 248
  91. #define YYACTIONTYPE unsigned short int
  92. #define YYWILDCARD 59
  93. #define sqlite3ParserTOKENTYPE Token
  94. typedef union {
  95. sqlite3ParserTOKENTYPE yy0;
  96. int yy46;
  97. struct LikeOp yy72;
  98. Expr* yy172;
  99. ExprList* yy174;
  100. Select* yy219;
  101. struct LimitVal yy234;
  102. TriggerStep* yy243;
  103. struct TrigEvent yy370;
  104. SrcList* yy373;
  105. Expr * yy386;
  106. struct {int value; int mask;} yy405;
  107. Token yy410;
  108. IdList* yy432;
  109. int yy495;
  110. } YYMINORTYPE;
  111. #ifndef YYSTACKDEPTH
  112. #define YYSTACKDEPTH 100
  113. #endif
  114. #define sqlite3ParserARG_SDECL Parse *pParse;
  115. #define sqlite3ParserARG_PDECL ,Parse *pParse
  116. #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
  117. #define sqlite3ParserARG_STORE yypParser->pParse = pParse
  118. #define YYNSTATE 588
  119. #define YYNRULE 312
  120. #define YYERRORSYMBOL 138
  121. #define YYERRSYMDT yy495
  122. #define YYFALLBACK 1
  123. #define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
  124. #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
  125. #define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
  126. /* Next are that tables used to determine what action to take based on the
  127. ** current state and lookahead token. These tables are used to implement
  128. ** functions that take a state number and lookahead value and return an
  129. ** action integer.
  130. **
  131. ** Suppose the action integer is N. Then the action is determined as
  132. ** follows
  133. **
  134. ** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
  135. ** token onto the stack and goto state N.
  136. **
  137. ** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
  138. **
  139. ** N == YYNSTATE+YYNRULE A syntax error has occurred.
  140. **
  141. ** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
  142. **
  143. ** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
  144. ** slots in the yy_action[] table.
  145. **
  146. ** The action table is constructed as a single large table named yy_action[].
  147. ** Given state S and lookahead X, the action is computed as
  148. **
  149. ** yy_action[ yy_shift_ofst[S] + X ]
  150. **
  151. ** If the index value yy_shift_ofst[S]+X is out of range or if the value
  152. ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
  153. ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
  154. ** and that yy_default[S] should be used instead.
  155. **
  156. ** The formula above is for computing the action when the lookahead is
  157. ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
  158. ** a reduce action) then the yy_reduce_ofst[] array is used in place of
  159. ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
  160. ** YY_SHIFT_USE_DFLT.
  161. **
  162. ** The following are the tables generated in this section:
  163. **
  164. ** yy_action[] A single table containing all actions.
  165. ** yy_lookahead[] A table containing the lookahead for each entry in
  166. ** yy_action. Used to detect hash collisions.
  167. ** yy_shift_ofst[] For each state, the offset into yy_action for
  168. ** shifting terminals.
  169. ** yy_reduce_ofst[] For each state, the offset into yy_action for
  170. ** shifting non-terminals after a reduce.
  171. ** yy_default[] Default action for each state.
  172. */
  173. static const YYACTIONTYPE yy_action[] = {
  174. /* 0 */ 299, 901, 124, 587, 416, 174, 2, 425, 61, 61,
  175. /* 10 */ 61, 61, 297, 63, 63, 63, 63, 64, 64, 65,
  176. /* 20 */ 65, 65, 66, 212, 454, 214, 432, 438, 68, 63,
  177. /* 30 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 212,
  178. /* 40 */ 398, 395, 403, 458, 60, 59, 304, 442, 443, 439,
  179. /* 50 */ 439, 62, 62, 61, 61, 61, 61, 265, 63, 63,
  180. /* 60 */ 63, 63, 64, 64, 65, 65, 65, 66, 212, 299,
  181. /* 70 */ 500, 501, 425, 496, 210, 82, 67, 427, 69, 156,
  182. /* 80 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
  183. /* 90 */ 212, 67, 469, 69, 156, 432, 438, 573, 266, 58,
  184. /* 100 */ 64, 64, 65, 65, 65, 66, 212, 404, 405, 429,
  185. /* 110 */ 429, 429, 299, 60, 59, 304, 442, 443, 439, 439,
  186. /* 120 */ 62, 62, 61, 61, 61, 61, 324, 63, 63, 63,
  187. /* 130 */ 63, 64, 64, 65, 65, 65, 66, 212, 432, 438,
  188. /* 140 */ 94, 65, 65, 65, 66, 212, 403, 212, 421, 34,
  189. /* 150 */ 56, 305, 449, 450, 417, 481, 60, 59, 304, 442,
  190. /* 160 */ 443, 439, 439, 62, 62, 61, 61, 61, 61, 495,
  191. /* 170 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
  192. /* 180 */ 212, 299, 259, 524, 203, 571, 113, 415, 522, 458,
  193. /* 190 */ 338, 324, 414, 20, 241, 347, 297, 403, 471, 531,
  194. /* 200 */ 292, 454, 214, 570, 569, 472, 530, 432, 438, 151,
  195. /* 210 */ 152, 404, 405, 421, 41, 213, 153, 533, 422, 496,
  196. /* 220 */ 263, 568, 261, 427, 299, 60, 59, 304, 442, 443,
  197. /* 230 */ 439, 439, 62, 62, 61, 61, 61, 61, 324, 63,
  198. /* 240 */ 63, 63, 63, 64, 64, 65, 65, 65, 66, 212,
  199. /* 250 */ 432, 438, 454, 340, 217, 429, 429, 429, 219, 550,
  200. /* 260 */ 421, 41, 404, 405, 490, 567, 213, 299, 60, 59,
  201. /* 270 */ 304, 442, 443, 439, 439, 62, 62, 61, 61, 61,
  202. /* 280 */ 61, 652, 63, 63, 63, 63, 64, 64, 65, 65,
  203. /* 290 */ 65, 66, 212, 432, 438, 103, 652, 549, 524, 519,
  204. /* 300 */ 652, 216, 652, 67, 231, 69, 156, 534, 20, 66,
  205. /* 310 */ 212, 60, 59, 304, 442, 443, 439, 439, 62, 62,
  206. /* 320 */ 61, 61, 61, 61, 265, 63, 63, 63, 63, 64,
  207. /* 330 */ 64, 65, 65, 65, 66, 212, 654, 324, 288, 77,
  208. /* 340 */ 299, 456, 523, 170, 491, 155, 232, 380, 271, 270,
  209. /* 350 */ 327, 654, 445, 445, 485, 654, 485, 654, 210, 421,
  210. /* 360 */ 27, 456, 330, 170, 652, 391, 432, 438, 497, 425,
  211. /* 370 */ 652, 652, 652, 652, 652, 652, 652, 252, 654, 422,
  212. /* 380 */ 581, 291, 80, 652, 60, 59, 304, 442, 443, 439,
  213. /* 390 */ 439, 62, 62, 61, 61, 61, 61, 210, 63, 63,
  214. /* 400 */ 63, 63, 64, 64, 65, 65, 65, 66, 212, 299,
  215. /* 410 */ 379, 585, 892, 494, 892, 306, 393, 368, 324, 654,
  216. /* 420 */ 21, 324, 307, 324, 425, 654, 654, 654, 654, 654,
  217. /* 430 */ 654, 654, 571, 654, 425, 432, 438, 532, 654, 654,
  218. /* 440 */ 421, 49, 485, 421, 35, 421, 49, 329, 449, 450,
  219. /* 450 */ 570, 582, 348, 60, 59, 304, 442, 443, 439, 439,
  220. /* 460 */ 62, 62, 61, 61, 61, 61, 655, 63, 63, 63,
  221. /* 470 */ 63, 64, 64, 65, 65, 65, 66, 212, 299, 420,
  222. /* 480 */ 198, 655, 509, 419, 324, 655, 315, 655, 653, 425,
  223. /* 490 */ 223, 316, 653, 525, 653, 238, 166, 118, 245, 350,
  224. /* 500 */ 250, 351, 178, 314, 432, 438, 421, 34, 655, 254,
  225. /* 510 */ 239, 213, 389, 213, 422, 653, 588, 398, 395, 406,
  226. /* 520 */ 407, 408, 60, 59, 304, 442, 443, 439, 439, 62,
  227. /* 530 */ 62, 61, 61, 61, 61, 335, 63, 63, 63, 63,
  228. /* 540 */ 64, 64, 65, 65, 65, 66, 212, 299, 342, 655,
  229. /* 550 */ 307, 257, 463, 547, 501, 655, 655, 655, 655, 655,
  230. /* 560 */ 655, 655, 653, 655, 464, 653, 653, 653, 655, 655,
  231. /* 570 */ 653, 161, 498, 432, 438, 653, 653, 465, 1, 502,
  232. /* 580 */ 544, 418, 403, 585, 891, 176, 891, 343, 174, 503,
  233. /* 590 */ 425, 60, 59, 304, 442, 443, 439, 439, 62, 62,
  234. /* 600 */ 61, 61, 61, 61, 240, 63, 63, 63, 63, 64,
  235. /* 610 */ 64, 65, 65, 65, 66, 212, 299, 381, 223, 422,
  236. /* 620 */ 9, 93, 377, 582, 403, 118, 245, 350, 250, 351,
  237. /* 630 */ 178, 177, 162, 325, 403, 183, 345, 254, 352, 355,
  238. /* 640 */ 356, 227, 432, 438, 446, 320, 399, 404, 405, 357,
  239. /* 650 */ 459, 209, 540, 367, 540, 425, 546, 302, 202, 299,
  240. /* 660 */ 60, 59, 304, 442, 443, 439, 439, 62, 62, 61,
  241. /* 670 */ 61, 61, 61, 402, 63, 63, 63, 63, 64, 64,
  242. /* 680 */ 65, 65, 65, 66, 212, 432, 438, 225, 524, 404,
  243. /* 690 */ 405, 489, 422, 397, 18, 824, 2, 578, 20, 404,
  244. /* 700 */ 405, 194, 299, 60, 59, 304, 442, 443, 439, 439,
  245. /* 710 */ 62, 62, 61, 61, 61, 61, 386, 63, 63, 63,
  246. /* 720 */ 63, 64, 64, 65, 65, 65, 66, 212, 432, 438,
  247. /* 730 */ 327, 370, 445, 445, 481, 422, 327, 373, 445, 445,
  248. /* 740 */ 275, 519, 519, 8, 394, 299, 60, 70, 304, 442,
  249. /* 750 */ 443, 439, 439, 62, 62, 61, 61, 61, 61, 378,
  250. /* 760 */ 63, 63, 63, 63, 64, 64, 65, 65, 65, 66,
  251. /* 770 */ 212, 432, 438, 243, 211, 167, 310, 224, 278, 196,
  252. /* 780 */ 276, 55, 374, 519, 180, 181, 182, 519, 299, 119,
  253. /* 790 */ 59, 304, 442, 443, 439, 439, 62, 62, 61, 61,
  254. /* 800 */ 61, 61, 646, 63, 63, 63, 63, 64, 64, 65,
  255. /* 810 */ 65, 65, 66, 212, 432, 438, 403, 646, 311, 253,
  256. /* 820 */ 253, 646, 312, 646, 327, 5, 445, 445, 481, 542,
  257. /* 830 */ 154, 519, 474, 541, 304, 442, 443, 439, 439, 62,
  258. /* 840 */ 62, 61, 61, 61, 61, 369, 63, 63, 63, 63,
  259. /* 850 */ 64, 64, 65, 65, 65, 66, 212, 72, 331, 277,
  260. /* 860 */ 4, 253, 377, 428, 303, 253, 313, 487, 622, 173,
  261. /* 870 */ 162, 455, 328, 72, 331, 265, 4, 265, 84, 158,
  262. /* 880 */ 303, 404, 405, 265, 67, 646, 69, 156, 328, 333,
  263. /* 890 */ 360, 646, 646, 646, 646, 646, 646, 646, 183, 458,
  264. /* 900 */ 185, 352, 355, 356, 646, 333, 388, 477, 188, 253,
  265. /* 910 */ 433, 434, 357, 422, 463, 458, 557, 179, 559, 75,
  266. /* 920 */ 74, 336, 403, 147, 560, 210, 464, 226, 73, 322,
  267. /* 930 */ 323, 436, 437, 427, 422, 75, 74, 488, 387, 465,
  268. /* 940 */ 475, 334, 422, 512, 73, 322, 323, 72, 331, 427,
  269. /* 950 */ 4, 210, 467, 324, 303, 318, 123, 19, 480, 144,
  270. /* 960 */ 435, 157, 328, 513, 484, 429, 429, 429, 430, 431,
  271. /* 970 */ 11, 346, 301, 452, 452, 421, 34, 254, 324, 333,
  272. /* 980 */ 251, 429, 429, 429, 430, 431, 11, 404, 405, 458,
  273. /* 990 */ 265, 164, 293, 421, 3, 422, 228, 229, 230, 104,
  274. /* 1000 */ 421, 28, 324, 403, 294, 324, 265, 265, 265, 75,
  275. /* 1010 */ 74, 656, 207, 478, 283, 309, 179, 338, 73, 322,
  276. /* 1020 */ 323, 284, 337, 427, 421, 23, 656, 421, 32, 324,
  277. /* 1030 */ 656, 561, 656, 205, 420, 549, 326, 526, 419, 204,
  278. /* 1040 */ 324, 128, 206, 324, 476, 511, 510, 279, 385, 281,
  279. /* 1050 */ 514, 421, 53, 656, 515, 429, 429, 429, 430, 431,
  280. /* 1060 */ 11, 649, 421, 52, 258, 421, 98, 324, 404, 405,
  281. /* 1070 */ 183, 301, 260, 352, 355, 356, 649, 76, 650, 78,
  282. /* 1080 */ 649, 246, 649, 262, 357, 384, 280, 270, 264, 421,
  283. /* 1090 */ 96, 300, 247, 650, 656, 324, 210, 650, 191, 650,
  284. /* 1100 */ 656, 656, 656, 656, 656, 656, 656, 653, 656, 324,
  285. /* 1110 */ 364, 160, 440, 656, 656, 324, 295, 421, 101, 324,
  286. /* 1120 */ 390, 583, 653, 324, 269, 324, 653, 447, 653, 22,
  287. /* 1130 */ 372, 421, 102, 412, 375, 324, 476, 421, 112, 376,
  288. /* 1140 */ 272, 421, 114, 324, 649, 421, 16, 421, 99, 653,
  289. /* 1150 */ 649, 649, 649, 649, 649, 649, 649, 421, 33, 324,
  290. /* 1160 */ 584, 650, 324, 649, 273, 421, 97, 650, 650, 650,
  291. /* 1170 */ 650, 650, 650, 650, 483, 274, 175, 506, 507, 556,
  292. /* 1180 */ 650, 421, 24, 324, 421, 54, 566, 516, 324, 128,
  293. /* 1190 */ 653, 324, 256, 359, 128, 128, 653, 653, 653, 653,
  294. /* 1200 */ 653, 653, 653, 324, 653, 421, 115, 146, 324, 653,
  295. /* 1210 */ 421, 116, 282, 421, 117, 324, 545, 324, 128, 285,
  296. /* 1220 */ 553, 324, 175, 324, 233, 421, 25, 554, 324, 91,
  297. /* 1230 */ 421, 36, 324, 286, 324, 577, 426, 421, 37, 421,
  298. /* 1240 */ 26, 324, 451, 421, 38, 421, 39, 324, 332, 324,
  299. /* 1250 */ 421, 40, 324, 453, 421, 42, 421, 43, 564, 292,
  300. /* 1260 */ 91, 324, 470, 421, 44, 324, 580, 324, 290, 421,
  301. /* 1270 */ 29, 421, 30, 324, 421, 45, 324, 518, 298, 324,
  302. /* 1280 */ 473, 248, 517, 421, 46, 324, 354, 421, 47, 421,
  303. /* 1290 */ 48, 520, 552, 563, 165, 421, 31, 401, 421, 10,
  304. /* 1300 */ 7, 421, 50, 409, 410, 411, 321, 421, 51, 84,
  305. /* 1310 */ 423, 341, 237, 83, 339, 57, 234, 79, 235, 215,
  306. /* 1320 */ 236, 172, 85, 424, 349, 344, 468, 125, 505, 308,
  307. /* 1330 */ 295, 242, 499, 482, 244, 504, 486, 249, 508, 296,
  308. /* 1340 */ 105, 221, 521, 149, 361, 150, 365, 527, 528, 529,
  309. /* 1350 */ 186, 88, 121, 535, 187, 132, 363, 189, 142, 220,
  310. /* 1360 */ 222, 383, 141, 190, 537, 192, 548, 371, 195, 267,
  311. /* 1370 */ 382, 538, 133, 555, 562, 317, 134, 135, 136, 92,
  312. /* 1380 */ 574, 138, 95, 575, 576, 579, 111, 100, 400, 319,
  313. /* 1390 */ 122, 17, 413, 623, 624, 168, 169, 441, 444, 71,
  314. /* 1400 */ 460, 448, 457, 143, 159, 171, 461, 6, 462, 479,
  315. /* 1410 */ 466, 13, 126, 81, 12, 127, 163, 492, 493, 218,
  316. /* 1420 */ 86, 353, 106, 358, 255, 107, 120, 87, 108, 184,
  317. /* 1430 */ 247, 362, 145, 536, 175, 129, 366, 193, 109, 268,
  318. /* 1440 */ 289, 551, 131, 14, 130, 197, 89, 539, 199, 201,
  319. /* 1450 */ 543, 200, 139, 558, 137, 565, 110, 15, 287, 572,
  320. /* 1460 */ 140, 208, 148, 396, 392, 586, 902, 902, 902, 902,
  321. /* 1470 */ 90,
  322. };
  323. static const YYCODETYPE yy_lookahead[] = {
  324. /* 0 */ 16, 139, 140, 141, 168, 21, 144, 23, 69, 70,
  325. /* 10 */ 71, 72, 176, 74, 75, 76, 77, 78, 79, 80,
  326. /* 20 */ 81, 82, 83, 84, 78, 79, 42, 43, 73, 74,
  327. /* 30 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
  328. /* 40 */ 1, 2, 23, 58, 60, 61, 62, 63, 64, 65,
  329. /* 50 */ 66, 67, 68, 69, 70, 71, 72, 147, 74, 75,
  330. /* 60 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
  331. /* 70 */ 185, 186, 88, 88, 110, 22, 217, 92, 219, 220,
  332. /* 80 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
  333. /* 90 */ 84, 217, 218, 219, 220, 42, 43, 238, 188, 46,
  334. /* 100 */ 78, 79, 80, 81, 82, 83, 84, 88, 89, 124,
  335. /* 110 */ 125, 126, 16, 60, 61, 62, 63, 64, 65, 66,
  336. /* 120 */ 67, 68, 69, 70, 71, 72, 147, 74, 75, 76,
  337. /* 130 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
  338. /* 140 */ 44, 80, 81, 82, 83, 84, 23, 84, 169, 170,
  339. /* 150 */ 19, 164, 165, 166, 23, 161, 60, 61, 62, 63,
  340. /* 160 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 169,
  341. /* 170 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
  342. /* 180 */ 84, 16, 14, 147, 155, 147, 21, 167, 168, 58,
  343. /* 190 */ 211, 147, 156, 157, 200, 216, 176, 23, 27, 176,
  344. /* 200 */ 177, 78, 79, 165, 166, 34, 183, 42, 43, 78,
  345. /* 210 */ 79, 88, 89, 169, 170, 228, 180, 181, 189, 88,
  346. /* 220 */ 52, 98, 54, 92, 16, 60, 61, 62, 63, 64,
  347. /* 230 */ 65, 66, 67, 68, 69, 70, 71, 72, 147, 74,
  348. /* 240 */ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
  349. /* 250 */ 42, 43, 78, 209, 210, 124, 125, 126, 175, 11,
  350. /* 260 */ 169, 170, 88, 89, 20, 227, 228, 16, 60, 61,
  351. /* 270 */ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
  352. /* 280 */ 72, 1, 74, 75, 76, 77, 78, 79, 80, 81,
  353. /* 290 */ 82, 83, 84, 42, 43, 175, 16, 49, 147, 147,
  354. /* 300 */ 20, 210, 22, 217, 153, 219, 220, 156, 157, 83,
  355. /* 310 */ 84, 60, 61, 62, 63, 64, 65, 66, 67, 68,
  356. /* 320 */ 69, 70, 71, 72, 147, 74, 75, 76, 77, 78,
  357. /* 330 */ 79, 80, 81, 82, 83, 84, 1, 147, 158, 131,
  358. /* 340 */ 16, 161, 162, 163, 20, 155, 190, 99, 100, 101,
  359. /* 350 */ 106, 16, 108, 109, 147, 20, 147, 22, 110, 169,
  360. /* 360 */ 170, 161, 162, 163, 84, 188, 42, 43, 169, 23,
  361. /* 370 */ 90, 91, 92, 93, 94, 95, 96, 225, 43, 189,
  362. /* 380 */ 244, 245, 131, 103, 60, 61, 62, 63, 64, 65,
  363. /* 390 */ 66, 67, 68, 69, 70, 71, 72, 110, 74, 75,
  364. /* 400 */ 76, 77, 78, 79, 80, 81, 82, 83, 84, 16,
  365. /* 410 */ 123, 19, 20, 20, 22, 208, 239, 208, 147, 84,
  366. /* 420 */ 19, 147, 16, 147, 23, 90, 91, 92, 93, 94,
  367. /* 430 */ 95, 96, 147, 98, 88, 42, 43, 181, 103, 104,
  368. /* 440 */ 169, 170, 147, 169, 170, 169, 170, 164, 165, 166,
  369. /* 450 */ 165, 59, 80, 60, 61, 62, 63, 64, 65, 66,
  370. /* 460 */ 67, 68, 69, 70, 71, 72, 1, 74, 75, 76,
  371. /* 470 */ 77, 78, 79, 80, 81, 82, 83, 84, 16, 107,
  372. /* 480 */ 155, 16, 20, 111, 147, 20, 215, 22, 16, 88,
  373. /* 490 */ 84, 215, 20, 181, 22, 221, 90, 91, 92, 93,
  374. /* 500 */ 94, 95, 96, 208, 42, 43, 169, 170, 43, 103,
  375. /* 510 */ 147, 228, 227, 228, 189, 43, 0, 1, 2, 7,
  376. /* 520 */ 8, 9, 60, 61, 62, 63, 64, 65, 66, 67,
  377. /* 530 */ 68, 69, 70, 71, 72, 186, 74, 75, 76, 77,
  378. /* 540 */ 78, 79, 80, 81, 82, 83, 84, 16, 211, 84,
  379. /* 550 */ 16, 20, 12, 185, 186, 90, 91, 92, 93, 94,
  380. /* 560 */ 95, 96, 90, 98, 24, 93, 94, 95, 103, 104,
  381. /* 570 */ 98, 147, 160, 42, 43, 103, 104, 37, 19, 39,
  382. /* 580 */ 18, 169, 23, 19, 20, 155, 22, 147, 21, 49,
  383. /* 590 */ 23, 60, 61, 62, 63, 64, 65, 66, 67, 68,
  384. /* 600 */ 69, 70, 71, 72, 147, 74, 75, 76, 77, 78,
  385. /* 610 */ 79, 80, 81, 82, 83, 84, 16, 55, 84, 189,
  386. /* 620 */ 19, 21, 147, 59, 23, 91, 92, 93, 94, 95,
  387. /* 630 */ 96, 201, 202, 147, 23, 90, 206, 103, 93, 94,
  388. /* 640 */ 95, 145, 42, 43, 20, 142, 143, 88, 89, 104,
  389. /* 650 */ 20, 148, 99, 100, 101, 88, 94, 150, 155, 16,
  390. /* 660 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
  391. /* 670 */ 70, 71, 72, 147, 74, 75, 76, 77, 78, 79,
  392. /* 680 */ 80, 81, 82, 83, 84, 42, 43, 212, 147, 88,
  393. /* 690 */ 89, 80, 189, 141, 19, 133, 144, 156, 157, 88,
  394. /* 700 */ 89, 155, 16, 60, 61, 62, 63, 64, 65, 66,
  395. /* 710 */ 67, 68, 69, 70, 71, 72, 213, 74, 75, 76,
  396. /* 720 */ 77, 78, 79, 80, 81, 82, 83, 84, 42, 43,
  397. /* 730 */ 106, 224, 108, 109, 161, 189, 106, 230, 108, 109,
  398. /* 740 */ 14, 147, 147, 68, 241, 16, 60, 61, 62, 63,
  399. /* 750 */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 213,
  400. /* 760 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
  401. /* 770 */ 84, 42, 43, 200, 192, 19, 182, 182, 52, 22,
  402. /* 780 */ 54, 199, 236, 147, 99, 100, 101, 147, 16, 147,
  403. /* 790 */ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
  404. /* 800 */ 71, 72, 1, 74, 75, 76, 77, 78, 79, 80,
  405. /* 810 */ 81, 82, 83, 84, 42, 43, 23, 16, 182, 225,
  406. /* 820 */ 225, 20, 182, 22, 106, 191, 108, 109, 161, 25,
  407. /* 830 */ 22, 147, 22, 29, 62, 63, 64, 65, 66, 67,
  408. /* 840 */ 68, 69, 70, 71, 72, 41, 74, 75, 76, 77,
  409. /* 850 */ 78, 79, 80, 81, 82, 83, 84, 16, 17, 133,
  410. /* 860 */ 19, 225, 147, 147, 23, 225, 182, 200, 112, 201,
  411. /* 870 */ 202, 161, 31, 16, 17, 147, 19, 147, 121, 155,
  412. /* 880 */ 23, 88, 89, 147, 217, 84, 219, 220, 31, 48,
  413. /* 890 */ 16, 90, 91, 92, 93, 94, 95, 96, 90, 58,
  414. /* 900 */ 155, 93, 94, 95, 103, 48, 91, 114, 155, 225,
  415. /* 910 */ 42, 43, 104, 189, 12, 58, 188, 43, 188, 78,
  416. /* 920 */ 79, 147, 23, 113, 188, 110, 24, 212, 87, 88,
  417. /* 930 */ 89, 63, 64, 92, 189, 78, 79, 80, 123, 37,
  418. /* 940 */ 203, 39, 189, 30, 87, 88, 89, 16, 17, 92,
  419. /* 950 */ 19, 110, 147, 147, 23, 242, 243, 19, 147, 21,
  420. /* 960 */ 92, 155, 31, 50, 147, 124, 125, 126, 127, 128,
  421. /* 970 */ 129, 147, 98, 124, 125, 169, 170, 103, 147, 48,
  422. /* 980 */ 147, 124, 125, 126, 127, 128, 129, 88, 89, 58,
  423. /* 990 */ 147, 5, 147, 169, 170, 189, 10, 11, 12, 13,
  424. /* 1000 */ 169, 170, 147, 23, 178, 147, 147, 147, 147, 78,
  425. /* 1010 */ 79, 1, 26, 114, 28, 102, 43, 211, 87, 88,
  426. /* 1020 */ 89, 35, 216, 92, 169, 170, 16, 169, 170, 147,
  427. /* 1030 */ 20, 188, 22, 47, 107, 49, 16, 147, 111, 53,
  428. /* 1040 */ 147, 22, 56, 147, 22, 91, 92, 188, 188, 188,
  429. /* 1050 */ 178, 169, 170, 43, 178, 124, 125, 126, 127, 128,
  430. /* 1060 */ 129, 1, 169, 170, 147, 169, 170, 147, 88, 89,
  431. /* 1070 */ 90, 98, 147, 93, 94, 95, 16, 130, 1, 132,
  432. /* 1080 */ 20, 92, 22, 147, 104, 99, 100, 101, 147, 169,
  433. /* 1090 */ 170, 105, 103, 16, 84, 147, 110, 20, 232, 22,
  434. /* 1100 */ 90, 91, 92, 93, 94, 95, 96, 1, 98, 147,
  435. /* 1110 */ 233, 89, 92, 103, 104, 147, 97, 169, 170, 147,
  436. /* 1120 */ 134, 20, 16, 147, 147, 147, 20, 20, 22, 22,
  437. /* 1130 */ 147, 169, 170, 149, 147, 147, 114, 169, 170, 147,
  438. /* 1140 */ 147, 169, 170, 147, 84, 169, 170, 169, 170, 43,
  439. /* 1150 */ 90, 91, 92, 93, 94, 95, 96, 169, 170, 147,
  440. /* 1160 */ 59, 84, 147, 103, 147, 169, 170, 90, 91, 92,
  441. /* 1170 */ 93, 94, 95, 96, 20, 147, 22, 7, 8, 147,
  442. /* 1180 */ 103, 169, 170, 147, 169, 170, 147, 20, 147, 22,
  443. /* 1190 */ 84, 147, 20, 20, 22, 22, 90, 91, 92, 93,
  444. /* 1200 */ 94, 95, 96, 147, 98, 169, 170, 191, 147, 103,
  445. /* 1210 */ 169, 170, 147, 169, 170, 147, 20, 147, 22, 147,
  446. /* 1220 */ 20, 147, 22, 147, 193, 169, 170, 20, 147, 22,
  447. /* 1230 */ 169, 170, 147, 147, 147, 147, 161, 169, 170, 169,
  448. /* 1240 */ 170, 147, 229, 169, 170, 169, 170, 147, 223, 147,
  449. /* 1250 */ 169, 170, 147, 229, 169, 170, 169, 170, 20, 177,
  450. /* 1260 */ 22, 147, 172, 169, 170, 147, 20, 147, 22, 169,
  451. /* 1270 */ 170, 169, 170, 147, 169, 170, 147, 161, 161, 147,
  452. /* 1280 */ 172, 172, 172, 169, 170, 147, 173, 169, 170, 169,
  453. /* 1290 */ 170, 172, 194, 194, 6, 169, 170, 146, 169, 170,
  454. /* 1300 */ 22, 169, 170, 146, 146, 146, 154, 169, 170, 121,
  455. /* 1310 */ 189, 118, 197, 119, 116, 120, 194, 130, 195, 222,
  456. /* 1320 */ 196, 112, 98, 198, 98, 115, 152, 152, 179, 40,
  457. /* 1330 */ 97, 204, 171, 205, 204, 171, 205, 171, 173, 171,
  458. /* 1340 */ 19, 84, 179, 174, 15, 174, 38, 171, 171, 171,
  459. /* 1350 */ 151, 130, 60, 152, 151, 19, 152, 151, 214, 226,
  460. /* 1360 */ 226, 15, 214, 152, 152, 151, 184, 152, 184, 234,
  461. /* 1370 */ 152, 235, 187, 194, 194, 152, 187, 187, 187, 237,
  462. /* 1380 */ 33, 184, 237, 152, 152, 137, 240, 159, 1, 246,
  463. /* 1390 */ 243, 231, 20, 112, 112, 112, 112, 92, 107, 19,
  464. /* 1400 */ 11, 20, 20, 19, 19, 22, 20, 117, 20, 114,
  465. /* 1410 */ 20, 117, 19, 22, 22, 20, 112, 20, 20, 44,
  466. /* 1420 */ 19, 44, 19, 44, 20, 19, 32, 19, 19, 96,
  467. /* 1430 */ 103, 16, 21, 17, 22, 98, 36, 98, 19, 133,
  468. /* 1440 */ 5, 1, 102, 19, 45, 122, 68, 51, 113, 115,
  469. /* 1450 */ 45, 14, 102, 17, 113, 123, 14, 19, 136, 20,
  470. /* 1460 */ 122, 135, 19, 3, 57, 4, 247, 247, 247, 247,
  471. /* 1470 */ 68,
  472. };
  473. #define YY_SHIFT_USE_DFLT (-62)
  474. #define YY_SHIFT_MAX 396
  475. static const short yy_shift_ofst[] = {
  476. /* 0 */ 39, 841, 986, -16, 841, 931, 931, 980, 123, -36,
  477. /* 10 */ 96, 931, 931, 931, 931, 931, -45, 248, 174, 19,
  478. /* 20 */ 346, -54, -54, 53, 165, 208, 251, 324, 393, 462,
  479. /* 30 */ 531, 600, 643, 686, 643, 643, 643, 643, 643, 643,
  480. /* 40 */ 643, 643, 643, 643, 643, 643, 643, 643, 643, 643,
  481. /* 50 */ 643, 643, 729, 772, 772, 857, 931, 931, 931, 931,
  482. /* 60 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
  483. /* 70 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
  484. /* 80 */ 931, 931, 931, 931, 931, 931, 931, 931, 931, 931,
  485. /* 90 */ 931, 931, 931, 931, 931, 931, -61, -61, 6, 6,
  486. /* 100 */ 406, 22, 61, 874, 562, 19, 19, 19, 19, 19,
  487. /* 110 */ 19, 19, 226, 346, 63, -62, -62, -62, 131, 534,
  488. /* 120 */ 540, 540, 392, 564, 516, 567, 19, 567, 19, 19,
  489. /* 130 */ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
  490. /* 140 */ 19, 815, 287, -36, -36, -36, -62, -62, -62, 1106,
  491. /* 150 */ 472, -15, -15, 808, 545, 244, 559, 624, 630, 902,
  492. /* 160 */ 793, 899, 601, 611, 512, 19, 19, 372, 19, 19,
  493. /* 170 */ 401, 19, 19, 1022, 19, 19, 718, 1022, 19, 19,
  494. /* 180 */ 913, 913, 913, 19, 19, 718, 19, 19, 718, 19,
  495. /* 190 */ 804, 553, 19, 19, 718, 19, 19, 19, 718, 19,
  496. /* 200 */ 19, 19, 718, 718, 19, 19, 19, 19, 19, 938,
  497. /* 210 */ 927, 810, 346, 849, 849, 947, 171, 171, 171, 973,
  498. /* 220 */ 171, 346, 171, 346, 1019, 757, 757, 1288, 1288, 1288,
  499. /* 230 */ 1288, 1278, -36, 1188, 1193, 1194, 1198, 1195, 1187, 1209,
  500. /* 240 */ 1209, 1224, 1210, 1224, 1210, 1226, 1226, 1289, 1226, 1233,
  501. /* 250 */ 1226, 1321, 1257, 1257, 1289, 1226, 1226, 1226, 1321, 1329,
  502. /* 260 */ 1209, 1329, 1209, 1329, 1209, 1209, 1308, 1221, 1329, 1209,
  503. /* 270 */ 1292, 1292, 1336, 1188, 1209, 1346, 1346, 1346, 1346, 1188,
  504. /* 280 */ 1292, 1336, 1209, 1347, 1347, 1209, 1209, 1248, -62, -62,
  505. /* 290 */ -62, -62, 335, 465, 1010, 280, 801, 1060, 1077, 868,
  506. /* 300 */ 726, 685, 168, 756, 1020, 1107, 1154, 989, 1170, 954,
  507. /* 310 */ 1167, 1172, 1173, 1196, 1200, 1207, 1238, 675, 1246, 1101,
  508. /* 320 */ 1387, 1372, 1281, 1282, 1283, 1284, 1305, 1291, 1380, 1381,
  509. /* 330 */ 1382, 1384, 1389, 1385, 1386, 1383, 1388, 1390, 1391, 1290,
  510. /* 340 */ 1392, 1294, 1391, 1295, 1393, 1395, 1304, 1397, 1398, 1394,
  511. /* 350 */ 1375, 1401, 1377, 1403, 1404, 1406, 1408, 1379, 1409, 1333,
  512. /* 360 */ 1327, 1415, 1416, 1411, 1337, 1400, 1396, 1399, 1412, 1405,
  513. /* 370 */ 1306, 1339, 1419, 1435, 1440, 1340, 1378, 1402, 1323, 1424,
  514. /* 380 */ 1335, 1437, 1334, 1436, 1341, 1350, 1338, 1438, 1332, 1439,
  515. /* 390 */ 1442, 1407, 1326, 1322, 1443, 1460, 1461,
  516. };
  517. #define YY_REDUCE_USE_DFLT (-165)
  518. #define YY_REDUCE_MAX 291
  519. static const short yy_reduce_ofst[] = {
  520. /* 0 */ -138, 806, 503, 667, 190, -21, 44, 36, 38, 430,
  521. /* 10 */ -141, 274, 91, 337, 271, 276, -126, 546, 285, 151,
  522. /* 20 */ 180, -13, 283, 86, 86, 86, 86, 86, 86, 86,
  523. /* 30 */ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
  524. /* 40 */ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
  525. /* 50 */ 86, 86, 86, 86, 86, 824, 831, 855, 858, 882,
  526. /* 60 */ 893, 896, 920, 948, 962, 968, 972, 976, 978, 988,
  527. /* 70 */ 996, 1012, 1015, 1036, 1041, 1044, 1056, 1061, 1068, 1070,
  528. /* 80 */ 1074, 1076, 1081, 1085, 1087, 1094, 1100, 1102, 1105, 1114,
  529. /* 90 */ 1118, 1120, 1126, 1129, 1132, 1138, 86, 86, 86, 86,
  530. /* 100 */ 20, 86, 86, 23, 507, 594, 595, 636, 640, 684,
  531. /* 110 */ 177, 541, 86, 200, 86, 86, 86, 86, 412, -164,
  532. /* 120 */ -115, 368, 136, 136, 552, -6, 207, 573, 152, -90,
  533. /* 130 */ 209, 475, 295, 728, 730, 736, 843, 859, 860, 715,
  534. /* 140 */ 861, 29, 325, 724, 745, 753, 582, 668, 713, 83,
  535. /* 150 */ 120, 0, 199, 256, 312, 156, 363, 156, 156, 349,
  536. /* 160 */ 424, 440, 457, 486, 496, 526, 642, 634, 486, 716,
  537. /* 170 */ 710, 774, 805, 737, 811, 817, 156, 737, 833, 845,
  538. /* 180 */ 826, 872, 876, 890, 917, 156, 925, 936, 156, 941,
  539. /* 190 */ 866, 877, 977, 983, 156, 987, 992, 993, 156, 1017,
  540. /* 200 */ 1028, 1032, 156, 156, 1039, 1065, 1072, 1086, 1088, 984,
  541. /* 210 */ 1016, 1031, 1075, 1013, 1024, 1025, 1090, 1108, 1109, 1082,
  542. /* 220 */ 1110, 1116, 1119, 1117, 1113, 1098, 1099, 1151, 1157, 1158,
  543. /* 230 */ 1159, 1152, 1121, 1122, 1123, 1124, 1115, 1125, 1097, 1174,
  544. /* 240 */ 1175, 1127, 1128, 1130, 1131, 1161, 1164, 1149, 1166, 1165,
  545. /* 250 */ 1168, 1169, 1133, 1134, 1163, 1176, 1177, 1178, 1171, 1199,
  546. /* 260 */ 1201, 1203, 1204, 1206, 1211, 1212, 1135, 1136, 1214, 1215,
  547. /* 270 */ 1182, 1184, 1144, 1179, 1218, 1185, 1189, 1190, 1191, 1180,
  548. /* 280 */ 1197, 1148, 1223, 1142, 1145, 1231, 1232, 1146, 1228, 1160,
  549. /* 290 */ 1147, 1143,
  550. };
  551. static const YYACTIONTYPE yy_default[] = {
  552. /* 0 */ 594, 819, 900, 709, 900, 819, 900, 900, 846, 713,
  553. /* 10 */ 875, 817, 900, 900, 900, 900, 791, 900, 846, 900,
  554. /* 20 */ 625, 846, 846, 742, 900, 900, 900, 900, 900, 900,
  555. /* 30 */ 900, 900, 743, 900, 821, 816, 812, 814, 813, 820,
  556. /* 40 */ 744, 733, 740, 747, 725, 859, 749, 750, 756, 757,
  557. /* 50 */ 876, 874, 779, 778, 797, 900, 900, 900, 900, 900,
  558. /* 60 */ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
  559. /* 70 */ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
  560. /* 80 */ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
  561. /* 90 */ 900, 900, 900, 900, 900, 900, 781, 803, 780, 790,
  562. /* 100 */ 618, 782, 783, 678, 613, 900, 900, 900, 900, 900,
  563. /* 110 */ 900, 900, 784, 900, 785, 798, 799, 800, 900, 900,
  564. /* 120 */ 900, 900, 900, 900, 594, 709, 900, 709, 900, 900,
  565. /* 130 */ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
  566. /* 140 */ 900, 900, 900, 900, 900, 900, 703, 713, 893, 900,
  567. /* 150 */ 900, 900, 900, 669, 900, 900, 900, 900, 900, 900,
  568. /* 160 */ 900, 900, 900, 900, 601, 599, 900, 701, 900, 900,
  569. /* 170 */ 627, 900, 900, 711, 900, 900, 716, 717, 900, 900,
  570. /* 180 */ 900, 900, 900, 900, 900, 615, 900, 900, 690, 900,
  571. /* 190 */ 852, 900, 900, 900, 866, 900, 900, 900, 864, 900,
  572. /* 200 */ 900, 900, 692, 752, 833, 900, 879, 881, 900, 900,
  573. /* 210 */ 701, 710, 900, 900, 900, 815, 736, 736, 736, 648,
  574. /* 220 */ 736, 900, 736, 900, 651, 746, 746, 598, 598, 598,
  575. /* 230 */ 598, 668, 900, 746, 737, 739, 729, 741, 900, 718,
  576. /* 240 */ 718, 726, 728, 726, 728, 680, 680, 665, 680, 651,
  577. /* 250 */ 680, 825, 830, 830, 665, 680, 680, 680, 825, 610,
  578. /* 260 */ 718, 610, 718, 610, 718, 718, 856, 858, 610, 718,
  579. /* 270 */ 682, 682, 758, 746, 718, 689, 689, 689, 689, 746,
  580. /* 280 */ 682, 758, 718, 878, 878, 718, 718, 886, 635, 861,
  581. /* 290 */ 893, 898, 900, 900, 900, 900, 900, 900, 900, 900,
  582. /* 300 */ 900, 900, 900, 765, 900, 900, 900, 900, 900, 900,
  583. /* 310 */ 900, 900, 900, 900, 900, 900, 900, 839, 900, 900,
  584. /* 320 */ 900, 900, 770, 766, 900, 767, 900, 695, 900, 900,
  585. /* 330 */ 900, 900, 900, 900, 900, 900, 900, 900, 818, 900,
  586. /* 340 */ 730, 900, 738, 900, 900, 900, 900, 900, 900, 900,
  587. /* 350 */ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
  588. /* 360 */ 900, 900, 900, 900, 900, 900, 900, 854, 855, 900,
  589. /* 370 */ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
  590. /* 380 */ 900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
  591. /* 390 */ 900, 885, 900, 900, 888, 595, 900, 589, 592, 591,
  592. /* 400 */ 593, 597, 600, 622, 623, 624, 602, 603, 604, 605,
  593. /* 410 */ 606, 607, 608, 614, 616, 634, 636, 620, 638, 699,
  594. /* 420 */ 700, 762, 693, 694, 698, 621, 773, 764, 768, 769,
  595. /* 430 */ 771, 772, 786, 787, 789, 795, 802, 805, 788, 793,
  596. /* 440 */ 794, 796, 801, 804, 696, 697, 808, 628, 629, 632,
  597. /* 450 */ 633, 842, 844, 843, 845, 631, 630, 774, 777, 810,
  598. /* 460 */ 811, 867, 868, 869, 870, 871, 806, 719, 809, 792,
  599. /* 470 */ 731, 734, 735, 732, 702, 712, 721, 722, 723, 724,
  600. /* 480 */ 707, 708, 714, 727, 760, 761, 715, 704, 705, 706,
  601. /* 490 */ 807, 763, 775, 776, 639, 640, 770, 641, 642, 643,
  602. /* 500 */ 681, 684, 685, 686, 644, 663, 666, 667, 645, 647,
  603. /* 510 */ 659, 660, 661, 662, 657, 658, 826, 827, 831, 829,
  604. /* 520 */ 828, 664, 637, 626, 619, 670, 673, 674, 675, 676,
  605. /* 530 */ 677, 679, 671, 672, 617, 609, 611, 720, 848, 857,
  606. /* 540 */ 853, 849, 850, 851, 612, 822, 823, 683, 754, 755,
  607. /* 550 */ 847, 860, 862, 759, 863, 865, 890, 687, 688, 691,
  608. /* 560 */ 832, 872, 745, 748, 751, 753, 834, 835, 836, 837,
  609. /* 570 */ 840, 841, 838, 873, 877, 880, 882, 883, 884, 887,
  610. /* 580 */ 889, 894, 895, 896, 899, 897, 596, 590,
  611. };
  612. #define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))
  613. /* The next table maps tokens into fallback tokens. If a construct
  614. ** like the following:
  615. **
  616. ** %fallback ID X Y Z.
  617. **
  618. ** appears in the grammer, then ID becomes a fallback token for X, Y,
  619. ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
  620. ** but it does not parse, the type of the token is changed to ID and
  621. ** the parse is retried before an error is thrown.
  622. */
  623. #ifdef YYFALLBACK
  624. static const YYCODETYPE yyFallback[] = {
  625. 0, /* $ => nothing */
  626. 0, /* SEMI => nothing */
  627. 23, /* EXPLAIN => ID */
  628. 23, /* QUERY => ID */
  629. 23, /* PLAN => ID */
  630. 23, /* BEGIN => ID */
  631. 0, /* TRANSACTION => nothing */
  632. 23, /* DEFERRED => ID */
  633. 23, /* IMMEDIATE => ID */
  634. 23, /* EXCLUSIVE => ID */
  635. 0, /* COMMIT => nothing */
  636. 23, /* END => ID */
  637. 0, /* ROLLBACK => nothing */
  638. 0, /* CREATE => nothing */
  639. 0, /* TABLE => nothing */
  640. 23, /* IF => ID */
  641. 0, /* NOT => nothing */
  642. 0, /* EXISTS => nothing */
  643. 23, /* TEMP => ID */
  644. 0, /* LP => nothing */
  645. 0, /* RP => nothing */
  646. 0, /* AS => nothing */
  647. 0, /* COMMA => nothing */
  648. 0, /* ID => nothing */
  649. 23, /* ABORT => ID */
  650. 23, /* AFTER => ID */
  651. 23, /* ANALYZE => ID */
  652. 23, /* ASC => ID */
  653. 23, /* ATTACH => ID */
  654. 23, /* BEFORE => ID */
  655. 23, /* CASCADE => ID */
  656. 23, /* CAST => ID */
  657. 23, /* CONFLICT => ID */
  658. 23, /* DATABASE => ID */
  659. 23, /* DESC => ID */
  660. 23, /* DETACH => ID */
  661. 23, /* EACH => ID */
  662. 23, /* FAIL => ID */
  663. 23, /* FOR => ID */
  664. 23, /* IGNORE => ID */
  665. 23, /* INITIALLY => ID */
  666. 23, /* INSTEAD => ID */
  667. 23, /* LIKE_KW => ID */
  668. 23, /* MATCH => ID */
  669. 23, /* KEY => ID */
  670. 23, /* OF => ID */
  671. 23, /* OFFSET => ID */
  672. 23, /* PRAGMA => ID */
  673. 23, /* RAISE => ID */
  674. 23, /* REPLACE => ID */
  675. 23, /* RESTRICT => ID */
  676. 23, /* ROW => ID */
  677. 23, /* TRIGGER => ID */
  678. 23, /* VACUUM => ID */
  679. 23, /* VIEW => ID */
  680. 23, /* VIRTUAL => ID */
  681. 23, /* REINDEX => ID */
  682. 23, /* RENAME => ID */
  683. 23, /* CTIME_KW => ID */
  684. 0, /* ANY => nothing */
  685. 0, /* OR => nothing */
  686. 0, /* AND => nothing */
  687. 0, /* IS => nothing */
  688. 0, /* BETWEEN => nothing */
  689. 0, /* IN => nothing */
  690. 0, /* ISNULL => nothing */
  691. 0, /* NOTNULL => nothing */
  692. 0, /* NE => nothing */
  693. 0, /* EQ => nothing */
  694. 0, /* GT => nothing */
  695. 0, /* LE => nothing */
  696. 0, /* LT => nothing */
  697. 0, /* GE => nothing */
  698. 0, /* ESCAPE => nothing */
  699. 0, /* BITAND => nothing */
  700. 0, /* BITOR => nothing */
  701. 0, /* LSHIFT => nothing */
  702. 0, /* RSHIFT => nothing */
  703. 0, /* PLUS => nothing */
  704. 0, /* MINUS => nothing */
  705. 0, /* STAR => nothing */
  706. 0, /* SLASH => nothing */
  707. 0, /* REM => nothing */
  708. 0, /* CONCAT => nothing */
  709. 0, /* COLLATE => nothing */
  710. 0, /* UMINUS => nothing */
  711. 0, /* UPLUS => nothing */
  712. 0, /* BITNOT => nothing */
  713. 0, /* STRING => nothing */
  714. 0, /* JOIN_KW => nothing */
  715. 0, /* CONSTRAINT => nothing */
  716. 0, /* DEFAULT => nothing */
  717. 0, /* NULL => nothing */
  718. 0, /* PRIMARY => nothing */
  719. 0, /* UNIQUE => nothing */
  720. 0, /* CHECK => nothing */
  721. 0, /* REFERENCES => nothing */
  722. 0, /* AUTOINCR => nothing */
  723. 0, /* ON => nothing */
  724. 0, /* DELETE => nothing */
  725. 0, /* UPDATE => nothing */
  726. 0, /* INSERT => nothing */
  727. 0, /* SET => nothing */
  728. 0, /* DEFERRABLE => nothing */
  729. 0, /* FOREIGN => nothing */
  730. 0, /* DROP => nothing */
  731. 0, /* UNION => nothing */
  732. 0, /* ALL => nothing */
  733. 0, /* EXCEPT => nothing */
  734. 0, /* INTERSECT => nothing */
  735. 0, /* SELECT => nothing */
  736. 0, /* DISTINCT => nothing */
  737. 0, /* DOT => nothing */
  738. 0, /* FROM => nothing */
  739. 0, /* JOIN => nothing */
  740. 0, /* USING => nothing */
  741. 0, /* ORDER => nothing */
  742. 0, /* BY => nothing */
  743. 0, /* GROUP => nothing */
  744. 0, /* HAVING => nothing */
  745. 0, /* LIMIT => nothing */
  746. 0, /* WHERE => nothing */
  747. 0, /* INTO => nothing */
  748. 0, /* VALUES => nothing */
  749. 0, /* INTEGER => nothing */
  750. 0, /* FLOAT => nothing */
  751. 0, /* BLOB => nothing */
  752. 0, /* REGISTER => nothing */
  753. 0, /* VARIABLE => nothing */
  754. 0, /* CASE => nothing */
  755. 0, /* WHEN => nothing */
  756. 0, /* THEN => nothing */
  757. 0, /* ELSE => nothing */
  758. 0, /* INDEX => nothing */
  759. 0, /* ALTER => nothing */
  760. 0, /* TO => nothing */
  761. 0, /* ADD => nothing */
  762. 0, /* COLUMNKW => nothing */
  763. };
  764. #endif /* YYFALLBACK */
  765. /* The following structure represents a single element of the
  766. ** parser's stack. Information stored includes:
  767. **
  768. ** + The state number for the parser at this level of the stack.
  769. **
  770. ** + The value of the token stored at this level of the stack.
  771. ** (In other words, the "major" token.)
  772. **
  773. ** + The semantic value stored at this level of the stack. This is
  774. ** the information used by the action routines in the grammar.
  775. ** It is sometimes called the "minor" token.
  776. */
  777. struct yyStackEntry {
  778. int stateno; /* The state-number */
  779. int major; /* The major token value. This is the code
  780. ** number for the token at this stack level */
  781. YYMINORTYPE minor; /* The user-supplied minor token value. This
  782. ** is the value of the token */
  783. };
  784. typedef struct yyStackEntry yyStackEntry;
  785. /* The state of the parser is completely contained in an instance of
  786. ** the following structure */
  787. struct yyParser {
  788. int yyidx; /* Index of top element in stack */
  789. int yyerrcnt; /* Shifts left before out of the error */
  790. sqlite3ParserARG_SDECL /* A place to hold %extra_argument */
  791. #if YYSTACKDEPTH<=0
  792. int yystksz; /* Current side of the stack */
  793. yyStackEntry *yystack; /* The parser's stack */
  794. #else
  795. yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
  796. #endif
  797. };
  798. typedef struct yyParser yyParser;
  799. #ifndef NDEBUG
  800. #include <stdio.h>
  801. static FILE *yyTraceFILE = 0;
  802. static char *yyTracePrompt = 0;
  803. #endif /* NDEBUG */
  804. #ifndef NDEBUG
  805. /*
  806. ** Turn parser tracing on by giving a stream to which to write the trace
  807. ** and a prompt to preface each trace message. Tracing is turned off
  808. ** by making either argument NULL
  809. **
  810. ** Inputs:
  811. ** <ul>
  812. ** <li> A FILE* to which trace output should be written.
  813. ** If NULL, then tracing is turned off.
  814. ** <li> A prefix string written at the beginning of every
  815. ** line of trace output. If NULL, then tracing is
  816. ** turned off.
  817. ** </ul>
  818. **
  819. ** Outputs:
  820. ** None.
  821. */
  822. void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
  823. yyTraceFILE = TraceFILE;
  824. yyTracePrompt = zTracePrompt;
  825. if( yyTraceFILE==0 ) yyTracePrompt = 0;
  826. else if( yyTracePrompt==0 ) yyTraceFILE = 0;
  827. }
  828. #endif /* NDEBUG */
  829. #ifndef NDEBUG
  830. /* For tracing shifts, the names of all terminals and nonterminals
  831. ** are required. The following table supplies these names */
  832. static const char *const yyTokenName[] = {
  833. "$", "SEMI", "EXPLAIN", "QUERY",
  834. "PLAN", "BEGIN", "TRANSACTION", "DEFERRED",
  835. "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END",
  836. "ROLLBACK", "CREATE", "TABLE", "IF",
  837. "NOT", "EXISTS", "TEMP", "LP",
  838. "RP", "AS", "COMMA", "ID",
  839. "ABORT", "AFTER", "ANALYZE", "ASC",
  840. "ATTACH", "BEFORE", "CASCADE", "CAST",
  841. "CONFLICT", "DATABASE", "DESC", "DETACH",
  842. "EACH", "FAIL", "FOR", "IGNORE",
  843. "INITIALLY", "INSTEAD", "LIKE_KW", "MATCH",
  844. "KEY", "OF", "OFFSET", "PRAGMA",
  845. "RAISE", "REPLACE", "RESTRICT", "ROW",
  846. "TRIGGER", "VACUUM", "VIEW", "VIRTUAL",
  847. "REINDEX", "RENAME", "CTIME_KW", "ANY",
  848. "OR", "AND", "IS", "BETWEEN",
  849. "IN", "ISNULL", "NOTNULL", "NE",
  850. "EQ", "GT", "LE", "LT",
  851. "GE", "ESCAPE", "BITAND", "BITOR",
  852. "LSHIFT", "RSHIFT", "PLUS", "MINUS",
  853. "STAR", "SLASH", "REM", "CONCAT",
  854. "COLLATE", "UMINUS", "UPLUS", "BITNOT",
  855. "STRING", "JOIN_KW", "CONSTRAINT", "DEFAULT",
  856. "NULL", "PRIMARY", "UNIQUE", "CHECK",
  857. "REFERENCES", "AUTOINCR", "ON", "DELETE",
  858. "UPDATE", "INSERT", "SET", "DEFERRABLE",
  859. "FOREIGN", "DROP", "UNION", "ALL",
  860. "EXCEPT", "INTERSECT", "SELECT", "DISTINCT",
  861. "DOT", "FROM", "JOIN", "USING",
  862. "ORDER", "BY", "GROUP", "HAVING",
  863. "LIMIT", "WHERE", "INTO", "VALUES",
  864. "INTEGER", "FLOAT", "BLOB", "REGISTER",
  865. "VARIABLE", "CASE", "WHEN", "THEN",
  866. "ELSE", "INDEX", "ALTER", "TO",
  867. "ADD", "COLUMNKW", "error", "input",
  868. "cmdlist", "ecmd", "cmdx", "cmd",
  869. "explain", "transtype", "trans_opt", "nm",
  870. "create_table", "create_table_args", "temp", "ifnotexists",
  871. "dbnm", "columnlist", "conslist_opt", "select",
  872. "column", "columnid", "type", "carglist",
  873. "id", "ids", "typetoken", "typename",
  874. "signed", "plus_num", "minus_num", "carg",
  875. "ccons", "term", "expr", "onconf",
  876. "sortorder", "autoinc", "idxlist_opt", "refargs",
  877. "defer_subclause", "refarg", "refact", "init_deferred_pred_opt",
  878. "conslist", "tcons", "idxlist", "defer_subclause_opt",
  879. "orconf", "resolvetype", "raisetype", "ifexists",
  880. "fullname", "oneselect", "multiselect_op", "distinct",
  881. "selcollist", "from", "where_opt", "groupby_opt",
  882. "having_opt", "orderby_opt", "limit_opt", "sclp",
  883. "as", "seltablist", "stl_prefix", "joinop",
  884. "on_opt", "using_opt", "seltablist_paren", "joinop2",
  885. "inscollist", "sortlist", "sortitem", "nexprlist",
  886. "setlist", "insert_cmd", "inscollist_opt", "itemlist",
  887. "exprlist", "likeop", "escape", "between_op",
  888. "in_op", "case_operand", "case_exprlist", "case_else",
  889. "uniqueflag", "idxitem", "collate", "nmnum",
  890. "plus_opt", "number", "trigger_decl", "trigger_cmd_list",
  891. "trigger_time", "trigger_event", "foreach_clause", "when_clause",
  892. "trigger_cmd", "database_kw_opt", "key_opt", "add_column_fullname",
  893. "kwcolumn_opt", "create_vtab", "vtabarglist", "vtabarg",
  894. "vtabargtoken", "lp", "anylist",
  895. };
  896. #endif /* NDEBUG */
  897. #ifndef NDEBUG
  898. /* For tracing reduce actions, the names of all rules are required.
  899. */
  900. static const char *const yyRuleName[] = {
  901. /* 0 */ "input ::= cmdlist",
  902. /* 1 */ "cmdlist ::= cmdlist ecmd",
  903. /* 2 */ "cmdlist ::= ecmd",
  904. /* 3 */ "cmdx ::= cmd",
  905. /* 4 */ "ecmd ::= SEMI",
  906. /* 5 */ "ecmd ::= explain cmdx SEMI",
  907. /* 6 */ "explain ::=",
  908. /* 7 */ "explain ::= EXPLAIN",
  909. /* 8 */ "explain ::= EXPLAIN QUERY PLAN",
  910. /* 9 */ "cmd ::= BEGIN transtype trans_opt",
  911. /* 10 */ "trans_opt ::=",
  912. /* 11 */ "trans_opt ::= TRANSACTION",
  913. /* 12 */ "trans_opt ::= TRANSACTION nm",
  914. /* 13 */ "transtype ::=",
  915. /* 14 */ "transtype ::= DEFERRED",
  916. /* 15 */ "transtype ::= IMMEDIATE",
  917. /* 16 */ "transtype ::= EXCLUSIVE",
  918. /* 17 */ "cmd ::= COMMIT trans_opt",
  919. /* 18 */ "cmd ::= END trans_opt",
  920. /* 19 */ "cmd ::= ROLLBACK trans_opt",
  921. /* 20 */ "cmd ::= create_table create_table_args",
  922. /* 21 */ "create_table ::= CREATE temp TABLE ifnotexists nm dbnm",
  923. /* 22 */ "ifnotexists ::=",
  924. /* 23 */ "ifnotexists ::= IF NOT EXISTS",
  925. /* 24 */ "temp ::= TEMP",
  926. /* 25 */ "temp ::=",
  927. /* 26 */ "create_table_args ::= LP columnlist conslist_opt RP",
  928. /* 27 */ "create_table_args ::= AS select",
  929. /* 28 */ "columnlist ::= columnlist COMMA column",
  930. /* 29 */ "columnlist ::= column",
  931. /* 30 */ "column ::= columnid type carglist",
  932. /* 31 */ "columnid ::= nm",
  933. /* 32 */ "id ::= ID",
  934. /* 33 */ "ids ::= ID|STRING",
  935. /* 34 */ "nm ::= ID",
  936. /* 35 */ "nm ::= STRING",
  937. /* 36 */ "nm ::= JOIN_KW",
  938. /* 37 */ "type ::=",
  939. /* 38 */ "type ::= typetoken",
  940. /* 39 */ "typetoken ::= typename",
  941. /* 40 */ "typetoken ::= typename LP signed RP",
  942. /* 41 */ "typetoken ::= typename LP signed COMMA signed RP",
  943. /* 42 */ "typename ::= ids",
  944. /* 43 */ "typename ::= typename ids",
  945. /* 44 */ "signed ::= plus_num",
  946. /* 45 */ "signed ::= minus_num",
  947. /* 46 */ "carglist ::= carglist carg",
  948. /* 47 */ "carglist ::=",
  949. /* 48 */ "carg ::= CONSTRAINT nm ccons",
  950. /* 49 */ "carg ::= ccons",
  951. /* 50 */ "ccons ::= DEFAULT term",
  952. /* 51 */ "ccons ::= DEFAULT LP expr RP",
  953. /* 52 */ "ccons ::= DEFAULT PLUS term",
  954. /* 53 */ "ccons ::= DEFAULT MINUS term",
  955. /* 54 */ "ccons ::= DEFAULT id",
  956. /* 55 */ "ccons ::= NULL onconf",
  957. /* 56 */ "ccons ::= NOT NULL onconf",
  958. /* 57 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
  959. /* 58 */ "ccons ::= UNIQUE onconf",
  960. /* 59 */ "ccons ::= CHECK LP expr RP",
  961. /* 60 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
  962. /* 61 */ "ccons ::= defer_subclause",
  963. /* 62 */ "ccons ::= COLLATE ids",
  964. /* 63 */ "autoinc ::=",
  965. /* 64 */ "autoinc ::= AUTOINCR",
  966. /* 65 */ "refargs ::=",
  967. /* 66 */ "refargs ::= refargs refarg",
  968. /* 67 */ "refarg ::= MATCH nm",
  969. /* 68 */ "refarg ::= ON DELETE refact",
  970. /* 69 */ "refarg ::= ON UPDATE refact",
  971. /* 70 */ "refarg ::= ON INSERT refact",
  972. /* 71 */ "refact ::= SET NULL",
  973. /* 72 */ "refact ::= SET DEFAULT",
  974. /* 73 */ "refact ::= CASCADE",
  975. /* 74 */ "refact ::= RESTRICT",
  976. /* 75 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
  977. /* 76 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
  978. /* 77 */ "init_deferred_pred_opt ::=",
  979. /* 78 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
  980. /* 79 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
  981. /* 80 */ "conslist_opt ::=",
  982. /* 81 */ "conslist_opt ::= COMMA conslist",
  983. /* 82 */ "conslist ::= conslist COMMA tcons",
  984. /* 83 */ "conslist ::= conslist tcons",
  985. /* 84 */ "conslist ::= tcons",
  986. /* 85 */ "tcons ::= CONSTRAINT nm",
  987. /* 86 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
  988. /* 87 */ "tcons ::= UNIQUE LP idxlist RP onconf",
  989. /* 88 */ "tcons ::= CHECK LP expr RP onconf",
  990. /* 89 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
  991. /* 90 */ "defer_subclause_opt ::=",
  992. /* 91 */ "defer_subclause_opt ::= defer_subclause",
  993. /* 92 */ "onconf ::=",
  994. /* 93 */ "onconf ::= ON CONFLICT resolvetype",
  995. /* 94 */ "orconf ::=",
  996. /* 95 */ "orconf ::= OR resolvetype",
  997. /* 96 */ "resolvetype ::= raisetype",
  998. /* 97 */ "resolvetype ::= IGNORE",
  999. /* 98 */ "resolvetype ::= REPLACE",
  1000. /* 99 */ "cmd ::= DROP TABLE ifexists fullname",
  1001. /* 100 */ "ifexists ::= IF EXISTS",
  1002. /* 101 */ "ifexists ::=",
  1003. /* 102 */ "cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select",
  1004. /* 103 */ "cmd ::= DROP VIEW ifexists fullname",
  1005. /* 104 */ "cmd ::= select",
  1006. /* 105 */ "select ::= oneselect",
  1007. /* 106 */ "select ::= select multiselect_op oneselect",
  1008. /* 107 */ "multiselect_op ::= UNION",
  1009. /* 108 */ "multiselect_op ::= UNION ALL",
  1010. /* 109 */ "multiselect_op ::= EXCEPT|INTERSECT",
  1011. /* 110 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
  1012. /* 111 */ "distinct ::= DISTINCT",
  1013. /* 112 */ "distinct ::= ALL",
  1014. /* 113 */ "distinct ::=",
  1015. /* 114 */ "sclp ::= selcollist COMMA",
  1016. /* 115 */ "sclp ::=",
  1017. /* 116 */ "selcollist ::= sclp expr as",
  1018. /* 117 */ "selcollist ::= sclp STAR",
  1019. /* 118 */ "selcollist ::= sclp nm DOT STAR",
  1020. /* 119 */ "as ::= AS nm",
  1021. /* 120 */ "as ::= ids",
  1022. /* 121 */ "as ::=",
  1023. /* 122 */ "from ::=",
  1024. /* 123 */ "from ::= FROM seltablist",
  1025. /* 124 */ "stl_prefix ::= seltablist joinop",
  1026. /* 125 */ "stl_prefix ::=",
  1027. /* 126 */ "seltablist ::= stl_prefix nm dbnm as on_opt using_opt",
  1028. /* 127 */ "seltablist ::= stl_prefix LP seltablist_paren RP as on_opt using_opt",
  1029. /* 128 */ "seltablist_paren ::= select",
  1030. /* 129 */ "seltablist_paren ::= seltablist",
  1031. /* 130 */ "dbnm ::=",
  1032. /* 131 */ "dbnm ::= DOT nm",
  1033. /* 132 */ "fullname ::= nm dbnm",
  1034. /* 133 */ "joinop ::= COMMA|JOIN",
  1035. /* 134 */ "joinop ::= JOIN_KW JOIN",
  1036. /* 135 */ "joinop ::= JOIN_KW nm JOIN",
  1037. /* 136 */ "joinop ::= JOIN_KW nm nm JOIN",
  1038. /* 137 */ "on_opt ::= ON expr",
  1039. /* 138 */ "on_opt ::=",
  1040. /* 139 */ "using_opt ::= USING LP inscollist RP",
  1041. /* 140 */ "using_opt ::=",
  1042. /* 141 */ "orderby_opt ::=",
  1043. /* 142 */ "orderby_opt ::= ORDER BY sortlist",
  1044. /* 143 */ "sortlist ::= sortlist COMMA sortitem sortorder",
  1045. /* 144 */ "sortlist ::= sortitem sortorder",
  1046. /* 145 */ "sortitem ::= expr",
  1047. /* 146 */ "sortorder ::= ASC",
  1048. /* 147 */ "sortorder ::= DESC",
  1049. /* 148 */ "sortorder ::=",
  1050. /* 149 */ "groupby_opt ::=",
  1051. /* 150 */ "groupby_opt ::= GROUP BY nexprlist",
  1052. /* 151 */ "having_opt ::=",
  1053. /* 152 */ "having_opt ::= HAVING expr",
  1054. /* 153 */ "limit_opt ::=",
  1055. /* 154 */ "limit_opt ::= LIMIT expr",
  1056. /* 155 */ "limit_opt ::= LIMIT expr OFFSET expr",
  1057. /* 156 */ "limit_opt ::= LIMIT expr COMMA expr",
  1058. /* 157 */ "cmd ::= DELETE FROM fullname where_opt",
  1059. /* 158 */ "where_opt ::=",
  1060. /* 159 */ "where_opt ::= WHERE expr",
  1061. /* 160 */ "cmd ::= UPDATE orconf fullname SET setlist where_opt",
  1062. /* 161 */ "setlist ::= setlist COMMA nm EQ expr",
  1063. /* 162 */ "setlist ::= nm EQ expr",
  1064. /* 163 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP",
  1065. /* 164 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
  1066. /* 165 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
  1067. /* 166 */ "insert_cmd ::= INSERT orconf",
  1068. /* 167 */ "insert_cmd ::= REPLACE",
  1069. /* 168 */ "itemlist ::= itemlist COMMA expr",
  1070. /* 169 */ "itemlist ::= expr",
  1071. /* 170 */ "inscollist_opt ::=",
  1072. /* 171 */ "inscollist_opt ::= LP inscollist RP",
  1073. /* 172 */ "inscollist ::= inscollist COMMA nm",
  1074. /* 173 */ "inscollist ::= nm",
  1075. /* 174 */ "expr ::= term",
  1076. /* 175 */ "expr ::= LP expr RP",
  1077. /* 176 */ "term ::= NULL",
  1078. /* 177 */ "expr ::= ID",
  1079. /* 178 */ "expr ::= JOIN_KW",
  1080. /* 179 */ "expr ::= nm DOT nm",
  1081. /* 180 */ "expr ::= nm DOT nm DOT nm",
  1082. /* 181 */ "term ::= INTEGER|FLOAT|BLOB",
  1083. /* 182 */ "term ::= STRING",
  1084. /* 183 */ "expr ::= REGISTER",
  1085. /* 184 */ "expr ::= VARIABLE",
  1086. /* 185 */ "expr ::= expr COLLATE ids",
  1087. /* 186 */ "expr ::= CAST LP expr AS typetoken RP",
  1088. /* 187 */ "expr ::= ID LP distinct exprlist RP",
  1089. /* 188 */ "expr ::= ID LP STAR RP",
  1090. /* 189 */ "term ::= CTIME_KW",
  1091. /* 190 */ "expr ::= expr AND expr",
  1092. /* 191 */ "expr ::= expr OR expr",
  1093. /* 192 */ "expr ::= expr LT|GT|GE|LE expr",
  1094. /* 193 */ "expr ::= expr EQ|NE expr",
  1095. /* 194 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
  1096. /* 195 */ "expr ::= expr PLUS|MINUS expr",
  1097. /* 196 */ "expr ::= expr STAR|SLASH|REM expr",
  1098. /* 197 */ "expr ::= expr CONCAT expr",
  1099. /* 198 */ "likeop ::= LIKE_KW",
  1100. /* 199 */ "likeop ::= NOT LIKE_KW",
  1101. /* 200 */ "likeop ::= MATCH",
  1102. /* 201 */ "likeop ::= NOT MATCH",
  1103. /* 202 */ "escape ::= ESCAPE expr",
  1104. /* 203 */ "escape ::=",
  1105. /* 204 */ "expr ::= expr likeop expr escape",
  1106. /* 205 */ "expr ::= expr ISNULL|NOTNULL",
  1107. /* 206 */ "expr ::= expr IS NULL",
  1108. /* 207 */ "expr ::= expr NOT NULL",
  1109. /* 208 */ "expr ::= expr IS NOT NULL",
  1110. /* 209 */ "expr ::= NOT expr",
  1111. /* 210 */ "expr ::= BITNOT expr",
  1112. /* 211 */ "expr ::= MINUS expr",
  1113. /* 212 */ "expr ::= PLUS expr",
  1114. /* 213 */ "between_op ::= BETWEEN",
  1115. /* 214 */ "between_op ::= NOT BETWEEN",
  1116. /* 215 */ "expr ::= expr between_op expr AND expr",
  1117. /* 216 */ "in_op ::= IN",
  1118. /* 217 */ "in_op ::= NOT IN",
  1119. /* 218 */ "expr ::= expr in_op LP exprlist RP",
  1120. /* 219 */ "expr ::= LP select RP",
  1121. /* 220 */ "expr ::= expr in_op LP select RP",
  1122. /* 221 */ "expr ::= expr in_op nm dbnm",
  1123. /* 222 */ "expr ::= EXISTS LP select RP",
  1124. /* 223 */ "expr ::= CASE case_operand case_exprlist case_else END",
  1125. /* 224 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
  1126. /* 225 */ "case_exprlist ::= WHEN expr THEN expr",
  1127. /* 226 */ "case_else ::= ELSE expr",
  1128. /* 227 */ "case_else ::=",
  1129. /* 228 */ "case_operand ::= expr",
  1130. /* 229 */ "case_operand ::=",
  1131. /* 230 */ "exprlist ::= nexprlist",
  1132. /* 231 */ "exprlist ::=",
  1133. /* 232 */ "nexprlist ::= nexprlist COMMA expr",
  1134. /* 233 */ "nexprlist ::= expr",
  1135. /* 234 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
  1136. /* 235 */ "uniqueflag ::= UNIQUE",
  1137. /* 236 */ "uniqueflag ::=",
  1138. /* 237 */ "idxlist_opt ::=",
  1139. /* 238 */ "idxlist_opt ::= LP idxlist RP",
  1140. /* 239 */ "idxlist ::= idxlist COMMA idxitem collate sortorder",
  1141. /* 240 */ "idxlist ::= idxitem collate sortorder",
  1142. /* 241 */ "idxitem ::= nm",
  1143. /* 242 */ "collate ::=",
  1144. /* 243 */ "collate ::= COLLATE ids",
  1145. /* 244 */ "cmd ::= DROP INDEX ifexists fullname",
  1146. /* 245 */ "cmd ::= VACUUM",
  1147. /* 246 */ "cmd ::= VACUUM nm",
  1148. /* 247 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
  1149. /* 248 */ "cmd ::= PRAGMA nm dbnm EQ ON",
  1150. /* 249 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
  1151. /* 250 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
  1152. /* 251 */ "cmd ::= PRAGMA nm dbnm",
  1153. /* 252 */ "nmnum ::= plus_num",
  1154. /* 253 */ "nmnum ::= nm",
  1155. /* 254 */ "plus_num ::= plus_opt number",
  1156. /* 255 */ "minus_num ::= MINUS number",
  1157. /* 256 */ "number ::= INTEGER|FLOAT",
  1158. /* 257 */ "plus_opt ::= PLUS",
  1159. /* 258 */ "plus_opt ::=",
  1160. /* 259 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END",
  1161. /* 260 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
  1162. /* 261 */ "trigger_time ::= BEFORE",
  1163. /* 262 */ "trigger_time ::= AFTER",
  1164. /* 263 */ "trigger_time ::= INSTEAD OF",
  1165. /* 264 */ "trigger_time ::=",
  1166. /* 265 */ "trigger_event ::= DELETE|INSERT",
  1167. /* 266 */ "trigger_event ::= UPDATE",
  1168. /* 267 */ "trigger_event ::= UPDATE OF inscollist",
  1169. /* 268 */ "foreach_clause ::=",
  1170. /* 269 */ "foreach_clause ::= FOR EACH ROW",
  1171. /* 270 */ "when_clause ::=",
  1172. /* 271 */ "when_clause ::= WHEN expr",
  1173. /* 272 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
  1174. /* 273 */ "trigger_cmd_list ::=",
  1175. /* 274 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt",
  1176. /* 275 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP",
  1177. /* 276 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select",
  1178. /* 277 */ "trigger_cmd ::= DELETE FROM nm where_opt",
  1179. /* 278 */ "trigger_cmd ::= select",
  1180. /* 279 */ "expr ::= RAISE LP IGNORE RP",
  1181. /* 280 */ "expr ::= RAISE LP raisetype COMMA nm RP",
  1182. /* 281 */ "raisetype ::= ROLLBACK",
  1183. /* 282 */ "raisetype ::= ABORT",
  1184. /* 283 */ "raisetype ::= FAIL",
  1185. /* 284 */ "cmd ::= DROP TRIGGER ifexists fullname",
  1186. /* 285 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
  1187. /* 286 */ "cmd ::= DETACH database_kw_opt expr",
  1188. /* 287 */ "key_opt ::=",
  1189. /* 288 */ "key_opt ::= KEY expr",
  1190. /* 289 */ "database_kw_opt ::= DATABASE",
  1191. /* 290 */ "database_kw_opt ::=",
  1192. /* 291 */ "cmd ::= REINDEX",
  1193. /* 292 */ "cmd ::= REINDEX nm dbnm",
  1194. /* 293 */ "cmd ::= ANALYZE",
  1195. /* 294 */ "cmd ::= ANALYZE nm dbnm",
  1196. /* 295 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
  1197. /* 296 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
  1198. /* 297 */ "add_column_fullname ::= fullname",
  1199. /* 298 */ "kwcolumn_opt ::=",
  1200. /* 299 */ "kwcolumn_opt ::= COLUMNKW",
  1201. /* 300 */ "cmd ::= create_vtab",
  1202. /* 301 */ "cmd ::= create_vtab LP vtabarglist RP",
  1203. /* 302 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm",
  1204. /* 303 */ "vtabarglist ::= vtabarg",
  1205. /* 304 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
  1206. /* 305 */ "vtabarg ::=",
  1207. /* 306 */ "vtabarg ::= vtabarg vtabargtoken",
  1208. /* 307 */ "vtabargtoken ::= ANY",
  1209. /* 308 */ "vtabargtoken ::= lp anylist RP",
  1210. /* 309 */ "lp ::= LP",
  1211. /* 310 */ "anylist ::=",
  1212. /* 311 */ "anylist ::= anylist ANY",
  1213. };
  1214. #endif /* NDEBUG */
  1215. #if YYSTACKDEPTH<=0
  1216. /*
  1217. ** Try to increase the size of the parser stack.
  1218. */
  1219. static void yyGrowStack(yyParser *p){
  1220. int newSize;
  1221. yyStackEntry *pNew;
  1222. newSize = p->yystksz*2 + 100;
  1223. pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
  1224. if( pNew ){
  1225. p->yystack = pNew;
  1226. p->yystksz = newSize;
  1227. #ifndef NDEBUG
  1228. if( yyTraceFILE ){
  1229. fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
  1230. yyTracePrompt, p->yystksz);
  1231. }
  1232. #endif
  1233. }
  1234. }
  1235. #endif
  1236. /*
  1237. ** This function allocates a new parser.
  1238. ** The only argument is a pointer to a function which works like
  1239. ** malloc.
  1240. **
  1241. ** Inputs:
  1242. ** A pointer to the function used to allocate memory.
  1243. **
  1244. ** Outputs:
  1245. ** A pointer to a parser. This pointer is used in subsequent calls
  1246. ** to sqlite3Parser and sqlite3ParserFree.
  1247. */
  1248. void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
  1249. yyParser *pParser;
  1250. pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
  1251. if( pParser ){
  1252. pParser->yyidx = -1;
  1253. #if YYSTACKDEPTH<=0
  1254. yyGrowStack(pParser);
  1255. #endif
  1256. }
  1257. return pParser;
  1258. }
  1259. /* The following function deletes the value associated with a
  1260. ** symbol. The symbol can be either a terminal or nonterminal.
  1261. ** "yymajor" is the symbol code, and "yypminor" is a pointer to
  1262. ** the value.
  1263. */
  1264. static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
  1265. switch( yymajor ){
  1266. /* Here is inserted the actions which take place when a
  1267. ** terminal or non-terminal is destroyed. This can happen
  1268. ** when the symbol is popped from the stack during a
  1269. ** reduce or during error processing or when a parser is
  1270. ** being destroyed before it is finished parsing.
  1271. **
  1272. ** Note: during a reduce, the only symbols destroyed are those
  1273. ** which appear on the RHS of the rule, but which are not used
  1274. ** inside the C code.
  1275. */
  1276. case 155:
  1277. case 189:
  1278. case 206:
  1279. #line 373 "parse.y"
  1280. {sqlite3SelectDelete((yypminor->yy219));}
  1281. #line 1302 "parse.c"
  1282. break;
  1283. case 169:
  1284. case 170:
  1285. case 194:
  1286. case 196:
  1287. case 204:
  1288. case 210:
  1289. case 218:
  1290. case 221:
  1291. case 223:
  1292. case 235:
  1293. #line 633 "parse.y"
  1294. {sqlite3ExprDelete((yypminor->yy172));}
  1295. #line 1316 "parse.c"
  1296. break;
  1297. case 174:
  1298. case 182:
  1299. case 192:
  1300. case 195:
  1301. case 197:
  1302. case 199:
  1303. case 209:
  1304. case 211:
  1305. case 212:
  1306. case 215:
  1307. case 216:
  1308. case 222:
  1309. #line 891 "parse.y"
  1310. {sqlite3ExprListDelete((yypminor->yy174));}
  1311. #line 1332 "parse.c"
  1312. break;
  1313. case 188:
  1314. case 193:
  1315. case 201:
  1316. case 202:
  1317. #line 490 "parse.y"
  1318. {sqlite3SrcListDelete((yypminor->yy373));}
  1319. #line 1340 "parse.c"
  1320. break;
  1321. case 205:
  1322. case 208:
  1323. case 214:
  1324. #line 507 "parse.y"
  1325. {sqlite3IdListDelete((yypminor->yy432));}
  1326. #line 1347 "parse.c"
  1327. break;
  1328. case 231:
  1329. case 236:
  1330. #line 994 "parse.y"
  1331. {sqlite3DeleteTriggerStep((yypminor->yy243));}
  1332. #line 1353 "parse.c"
  1333. break;
  1334. case 233:
  1335. #line 980 "parse.y"
  1336. {sqlite3IdListDelete((yypminor->yy370).b);}
  1337. #line 1358 "parse.c"
  1338. break;
  1339. case 238:
  1340. #line 1067 "parse.y"
  1341. {sqlite3ExprDelete((yypminor->yy386));}
  1342. #line 1363 "parse.c"
  1343. break;
  1344. default: break; /* If no destructor action specified: do nothing */
  1345. }
  1346. }
  1347. /*
  1348. ** Pop the parser's stack once.
  1349. **
  1350. ** If there is a destructor routine associated with the token which
  1351. ** is popped from the stack, then call it.
  1352. **
  1353. ** Return the major token number for the symbol popped.
  1354. */
  1355. static int yy_pop_parser_stack(yyParser *pParser){
  1356. YYCODETYPE yymajor;
  1357. yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
  1358. if( pParser->yyidx<0 ) return 0;
  1359. #ifndef NDEBUG
  1360. if( yyTraceFILE && pParser->yyidx>=0 ){
  1361. fprintf(yyTraceFILE,"%sPopping %s\n",
  1362. yyTracePrompt,
  1363. yyTokenName[yytos->major]);
  1364. }
  1365. #endif
  1366. yymajor = yytos->major;
  1367. yy_destructor( yymajor, &yytos->minor);
  1368. pParser->yyidx--;
  1369. return yymajor;
  1370. }
  1371. /*
  1372. ** Deallocate and destroy a parser. Destructors are all called for
  1373. ** all stack elements before shutting the parser down.
  1374. **
  1375. ** Inputs:
  1376. ** <ul>
  1377. ** <li> A pointer to the parser. This should be a pointer
  1378. ** obtained from sqlite3ParserAlloc.
  1379. ** <li> A pointer to a function used to reclaim memory obtained
  1380. ** from malloc.
  1381. ** </ul>
  1382. */
  1383. void sqlite3ParserFree(
  1384. void *p, /* The parser to be deleted */
  1385. void (*freeProc)(void*) /* Function used to reclaim memory */
  1386. ){
  1387. yyParser *pParser = (yyParser*)p;
  1388. if( pParser==0 ) return;
  1389. while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
  1390. #if YYSTACKDEPTH<=0
  1391. free(pParser->yystack);
  1392. #endif
  1393. (*freeProc)((void*)pParser);
  1394. }
  1395. /*
  1396. ** Find the appropriate action for a parser given the terminal
  1397. ** look-ahead token iLookAhead.
  1398. **
  1399. ** If the look-ahead token is YYNOCODE, then check to see if the action is
  1400. ** independent of the look-ahead. If it is, return the action, otherwise
  1401. ** return YY_NO_ACTION.
  1402. */
  1403. static int yy_find_shift_action(
  1404. yyParser *pParser, /* The parser */
  1405. YYCODETYPE iLookAhead /* The look-ahead token */
  1406. ){
  1407. int i;
  1408. int stateno = pParser->yystack[pParser->yyidx].stateno;
  1409. if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
  1410. return yy_default[stateno];
  1411. }
  1412. if( iLookAhead==YYNOCODE ){
  1413. return YY_NO_ACTION;
  1414. }
  1415. i += iLookAhead;
  1416. if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
  1417. if( iLookAhead>0 ){
  1418. #ifdef YYFALLBACK
  1419. int iFallback; /* Fallback token */
  1420. if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
  1421. && (iFallback = yyFallback[iLookAhead])!=0 ){
  1422. #ifndef NDEBUG
  1423. if( yyTraceFILE ){
  1424. fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
  1425. yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
  1426. }
  1427. #endif
  1428. return yy_find_shift_action(pParser, iFallback);
  1429. }
  1430. #endif
  1431. #ifdef YYWILDCARD
  1432. {
  1433. int j = i - iLookAhead + YYWILDCARD;
  1434. if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){
  1435. #ifndef NDEBUG
  1436. if( yyTraceFILE ){
  1437. fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
  1438. yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
  1439. }
  1440. #endif /* NDEBUG */
  1441. return yy_action[j];
  1442. }
  1443. }
  1444. #endif /* YYWILDCARD */
  1445. }
  1446. return yy_default[stateno];
  1447. }else{
  1448. return yy_action[i];
  1449. }
  1450. }
  1451. /*
  1452. ** Find the appropriate action for a parser given the non-terminal
  1453. ** look-ahead token iLookAhead.
  1454. **
  1455. ** If the look-ahead token is YYNOCODE, then check to see if the action is
  1456. ** independent of the look-ahead. If it is, return the action, otherwise
  1457. ** return YY_NO_ACTION.
  1458. */
  1459. static int yy_find_reduce_action(
  1460. int stateno, /* Current state number */
  1461. YYCODETYPE iLookAhead /* The look-ahead token */
  1462. ){
  1463. int i;
  1464. /* int stateno = pParser->yystack[pParser->yyidx].stateno; */
  1465. if( stateno>YY_REDUCE_MAX ||
  1466. (i = yy_reduce_ofst[stateno])==YY_REDUCE_USE_DFLT ){
  1467. return yy_default[stateno];
  1468. }
  1469. if( iLookAhead==YYNOCODE ){
  1470. return YY_NO_ACTION;
  1471. }
  1472. i += iLookAhead;
  1473. if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
  1474. return yy_default[stateno];
  1475. }else{
  1476. return yy_action[i];
  1477. }
  1478. }
  1479. /*
  1480. ** The following routine is called if the stack overflows.
  1481. */
  1482. static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
  1483. sqlite3ParserARG_FETCH;
  1484. yypParser->yyidx--;
  1485. #ifndef NDEBUG
  1486. if( yyTraceFILE ){
  1487. fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
  1488. }
  1489. #endif
  1490. while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  1491. /* Here code is inserted which will execute if the parser
  1492. ** stack every overflows */
  1493. #line 44 "parse.y"
  1494. sqlite3ErrorMsg(pParse, "parser stack overflow");
  1495. pParse->parseError = 1;
  1496. #line 1527 "parse.c"
  1497. sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
  1498. }
  1499. /*
  1500. ** Perform a shift action.
  1501. */
  1502. static void yy_shift(
  1503. yyParser *yypParser, /* The parser to be shifted */
  1504. int yyNewState, /* The new state to shift in */
  1505. int yyMajor, /* The major token to shift in */
  1506. YYMINORTYPE *yypMinor /* Pointer ot the minor token to shift in */
  1507. ){
  1508. yyStackEntry *yytos;
  1509. yypParser->yyidx++;
  1510. #if YYSTACKDEPTH>0
  1511. if( yypParser->yyidx>=YYSTACKDEPTH ){
  1512. yyStackOverflow(yypParser, yypMinor);
  1513. return;
  1514. }
  1515. #else
  1516. if( yypParser->yyidx>=yypParser->yystksz ){
  1517. yyGrowStack(yypParser);
  1518. if( yypParser->yyidx>=yypParser->yystksz ){
  1519. yyStackOverflow(yypParser, yypMinor);
  1520. return;
  1521. }
  1522. }
  1523. #endif
  1524. yytos = &yypParser->yystack[yypParser->yyidx];
  1525. yytos->stateno = yyNewState;
  1526. yytos->major = yyMajor;
  1527. yytos->minor = *yypMinor;
  1528. #ifndef NDEBUG
  1529. if( yyTraceFILE && yypParser->yyidx>0 ){
  1530. int i;
  1531. fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
  1532. fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
  1533. for(i=1; i<=yypParser->yyidx; i++)
  1534. fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
  1535. fprintf(yyTraceFILE,"\n");
  1536. }
  1537. #endif
  1538. }
  1539. /* The following table contains information about every rule that
  1540. ** is used during the reduce.
  1541. */
  1542. static const struct {
  1543. YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
  1544. unsigned char nrhs; /* Number of right-hand side symbols in the rule */
  1545. } yyRuleInfo[] = {
  1546. { 139, 1 },
  1547. { 140, 2 },
  1548. { 140, 1 },
  1549. { 142, 1 },
  1550. { 141, 1 },
  1551. { 141, 3 },
  1552. { 144, 0 },
  1553. { 144, 1 },
  1554. { 144, 3 },
  1555. { 143, 3 },
  1556. { 146, 0 },
  1557. { 146, 1 },
  1558. { 146, 2 },
  1559. { 145, 0 },
  1560. { 145, 1 },
  1561. { 145, 1 },
  1562. { 145, 1 },
  1563. { 143, 2 },
  1564. { 143, 2 },
  1565. { 143, 2 },
  1566. { 143, 2 },
  1567. { 148, 6 },
  1568. { 151, 0 },
  1569. { 151, 3 },
  1570. { 150, 1 },
  1571. { 150, 0 },
  1572. { 149, 4 },
  1573. { 149, 2 },
  1574. { 153, 3 },
  1575. { 153, 1 },
  1576. { 156, 3 },
  1577. { 157, 1 },
  1578. { 160, 1 },
  1579. { 161, 1 },
  1580. { 147, 1 },
  1581. { 147, 1 },
  1582. { 147, 1 },
  1583. { 158, 0 },
  1584. { 158, 1 },
  1585. { 162, 1 },
  1586. { 162, 4 },
  1587. { 162, 6 },
  1588. { 163, 1 },
  1589. { 163, 2 },
  1590. { 164, 1 },
  1591. { 164, 1 },
  1592. { 159, 2 },
  1593. { 159, 0 },
  1594. { 167, 3 },
  1595. { 167, 1 },
  1596. { 168, 2 },
  1597. { 168, 4 },
  1598. { 168, 3 },
  1599. { 168, 3 },
  1600. { 168, 2 },
  1601. { 168, 2 },
  1602. { 168, 3 },
  1603. { 168, 5 },
  1604. { 168, 2 },
  1605. { 168, 4 },
  1606. { 168, 4 },
  1607. { 168, 1 },
  1608. { 168, 2 },
  1609. { 173, 0 },
  1610. { 173, 1 },
  1611. { 175, 0 },
  1612. { 175, 2 },
  1613. { 177, 2 },
  1614. { 177, 3 },
  1615. { 177, 3 },
  1616. { 177, 3 },
  1617. { 178, 2 },
  1618. { 178, 2 },
  1619. { 178, 1 },
  1620. { 178, 1 },
  1621. { 176, 3 },
  1622. { 176, 2 },
  1623. { 179, 0 },
  1624. { 179, 2 },
  1625. { 179, 2 },
  1626. { 154, 0 },
  1627. { 154, 2 },
  1628. { 180, 3 },
  1629. { 180, 2 },
  1630. { 180, 1 },
  1631. { 181, 2 },
  1632. { 181, 7 },
  1633. { 181, 5 },
  1634. { 181, 5 },
  1635. { 181, 10 },
  1636. { 183, 0 },
  1637. { 183, 1 },
  1638. { 171, 0 },
  1639. { 171, 3 },
  1640. { 184, 0 },
  1641. { 184, 2 },
  1642. { 185, 1 },
  1643. { 185, 1 },
  1644. { 185, 1 },
  1645. { 143, 4 },
  1646. { 187, 2 },
  1647. { 187, 0 },
  1648. { 143, 8 },
  1649. { 143, 4 },
  1650. { 143, 1 },
  1651. { 155, 1 },
  1652. { 155, 3 },
  1653. { 190, 1 },
  1654. { 190, 2 },
  1655. { 190, 1 },
  1656. { 189, 9 },
  1657. { 191, 1 },
  1658. { 191, 1 },
  1659. { 191, 0 },
  1660. { 199, 2 },
  1661. { 199, 0 },
  1662. { 192, 3 },
  1663. { 192, 2 },
  1664. { 192, 4 },
  1665. { 200, 2 },
  1666. { 200, 1 },
  1667. { 200, 0 },
  1668. { 193, 0 },
  1669. { 193, 2 },
  1670. { 202, 2 },
  1671. { 202, 0 },
  1672. { 201, 6 },
  1673. { 201, 7 },
  1674. { 206, 1 },
  1675. { 206, 1 },
  1676. { 152, 0 },
  1677. { 152, 2 },
  1678. { 188, 2 },
  1679. { 203, 1 },
  1680. { 203, 2 },
  1681. { 203, 3 },
  1682. { 203, 4 },
  1683. { 204, 2 },
  1684. { 204, 0 },
  1685. { 205, 4 },
  1686. { 205, 0 },
  1687. { 197, 0 },
  1688. { 197, 3 },
  1689. { 209, 4 },
  1690. { 209, 2 },
  1691. { 210, 1 },
  1692. { 172, 1 },
  1693. { 172, 1 },
  1694. { 172, 0 },
  1695. { 195, 0 },
  1696. { 195, 3 },
  1697. { 196, 0 },
  1698. { 196, 2 },
  1699. { 198, 0 },
  1700. { 198, 2 },
  1701. { 198, 4 },
  1702. { 198, 4 },
  1703. { 143, 4 },
  1704. { 194, 0 },
  1705. { 194, 2 },
  1706. { 143, 6 },
  1707. { 212, 5 },
  1708. { 212, 3 },
  1709. { 143, 8 },
  1710. { 143, 5 },
  1711. { 143, 6 },
  1712. { 213, 2 },
  1713. { 213, 1 },
  1714. { 215, 3 },
  1715. { 215, 1 },
  1716. { 214, 0 },
  1717. { 214, 3 },
  1718. { 208, 3 },
  1719. { 208, 1 },
  1720. { 170, 1 },
  1721. { 170, 3 },
  1722. { 169, 1 },
  1723. { 170, 1 },
  1724. { 170, 1 },
  1725. { 170, 3 },
  1726. { 170, 5 },
  1727. { 169, 1 },
  1728. { 169, 1 },
  1729. { 170, 1 },
  1730. { 170, 1 },
  1731. { 170, 3 },
  1732. { 170, 6 },
  1733. { 170, 5 },
  1734. { 170, 4 },
  1735. { 169, 1 },
  1736. { 170, 3 },
  1737. { 170, 3 },
  1738. { 170, 3 },
  1739. { 170, 3 },
  1740. { 170, 3 },
  1741. { 170, 3 },
  1742. { 170, 3 },
  1743. { 170, 3 },
  1744. { 217, 1 },
  1745. { 217, 2 },
  1746. { 217, 1 },
  1747. { 217, 2 },
  1748. { 218, 2 },
  1749. { 218, 0 },
  1750. { 170, 4 },
  1751. { 170, 2 },
  1752. { 170, 3 },
  1753. { 170, 3 },
  1754. { 170, 4 },
  1755. { 170, 2 },
  1756. { 170, 2 },
  1757. { 170, 2 },
  1758. { 170, 2 },
  1759. { 219, 1 },
  1760. { 219, 2 },
  1761. { 170, 5 },
  1762. { 220, 1 },
  1763. { 220, 2 },
  1764. { 170, 5 },
  1765. { 170, 3 },
  1766. { 170, 5 },
  1767. { 170, 4 },
  1768. { 170, 4 },
  1769. { 170, 5 },
  1770. { 222, 5 },
  1771. { 222, 4 },
  1772. { 223, 2 },
  1773. { 223, 0 },
  1774. { 221, 1 },
  1775. { 221, 0 },
  1776. { 216, 1 },
  1777. { 216, 0 },
  1778. { 211, 3 },
  1779. { 211, 1 },
  1780. { 143, 11 },
  1781. { 224, 1 },
  1782. { 224, 0 },
  1783. { 174, 0 },
  1784. { 174, 3 },
  1785. { 182, 5 },
  1786. { 182, 3 },
  1787. { 225, 1 },
  1788. { 226, 0 },
  1789. { 226, 2 },
  1790. { 143, 4 },
  1791. { 143, 1 },
  1792. { 143, 2 },
  1793. { 143, 5 },
  1794. { 143, 5 },
  1795. { 143, 5 },
  1796. { 143, 6 },
  1797. { 143, 3 },
  1798. { 227, 1 },
  1799. { 227, 1 },
  1800. { 165, 2 },
  1801. { 166, 2 },
  1802. { 229, 1 },
  1803. { 228, 1 },
  1804. { 228, 0 },
  1805. { 143, 5 },
  1806. { 230, 11 },
  1807. { 232, 1 },
  1808. { 232, 1 },
  1809. { 232, 2 },
  1810. { 232, 0 },
  1811. { 233, 1 },
  1812. { 233, 1 },
  1813. { 233, 3 },
  1814. { 234, 0 },
  1815. { 234, 3 },
  1816. { 235, 0 },
  1817. { 235, 2 },
  1818. { 231, 3 },
  1819. { 231, 0 },
  1820. { 236, 6 },
  1821. { 236, 8 },
  1822. { 236, 5 },
  1823. { 236, 4 },
  1824. { 236, 1 },
  1825. { 170, 4 },
  1826. { 170, 6 },
  1827. { 186, 1 },
  1828. { 186, 1 },
  1829. { 186, 1 },
  1830. { 143, 4 },
  1831. { 143, 6 },
  1832. { 143, 3 },
  1833. { 238, 0 },
  1834. { 238, 2 },
  1835. { 237, 1 },
  1836. { 237, 0 },
  1837. { 143, 1 },
  1838. { 143, 3 },
  1839. { 143, 1 },
  1840. { 143, 3 },
  1841. { 143, 6 },
  1842. { 143, 6 },
  1843. { 239, 1 },
  1844. { 240, 0 },
  1845. { 240, 1 },
  1846. { 143, 1 },
  1847. { 143, 4 },
  1848. { 241, 7 },
  1849. { 242, 1 },
  1850. { 242, 3 },
  1851. { 243, 0 },
  1852. { 243, 2 },
  1853. { 244, 1 },
  1854. { 244, 3 },
  1855. { 245, 1 },
  1856. { 246, 0 },
  1857. { 246, 2 },
  1858. };
  1859. static void yy_accept(yyParser*); /* Forward Declaration */
  1860. /*
  1861. ** Perform a reduce action and the shift that must immediately
  1862. ** follow the reduce.
  1863. */
  1864. static void yy_reduce(
  1865. yyParser *yypParser, /* The parser */
  1866. int yyruleno /* Number of the rule by which to reduce */
  1867. ){
  1868. int yygoto; /* The next state */
  1869. int yyact; /* The next action */
  1870. YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
  1871. yyStackEntry *yymsp; /* The top of the parser's stack */
  1872. int yysize; /* Amount to pop the stack */
  1873. sqlite3ParserARG_FETCH;
  1874. yymsp = &yypParser->yystack[yypParser->yyidx];
  1875. #ifndef NDEBUG
  1876. if( yyTraceFILE && yyruleno>=0
  1877. && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
  1878. fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
  1879. yyRuleName[yyruleno]);
  1880. }
  1881. #endif /* NDEBUG */
  1882. /* Silence complaints from purify about yygotominor being uninitialized
  1883. ** in some cases when it is copied into the stack after the following
  1884. ** switch. yygotominor is uninitialized when a rule reduces that does
  1885. ** not set the value of its left-hand side nonterminal. Leaving the
  1886. ** value of the nonterminal uninitialized is utterly harmless as long
  1887. ** as the value is never used. So really the only thing this code
  1888. ** accomplishes is to quieten purify.
  1889. **
  1890. ** 2007-01-16: The wireshark project (www.wireshark.org) reports that
  1891. ** without this code, their parser segfaults. I'm not sure what there
  1892. ** parser is doing to make this happen. This is the second bug report
  1893. ** from wireshark this week. Clearly they are stressing Lemon in ways
  1894. ** that it has not been previously stressed... (SQLite ticket #2172)
  1895. */
  1896. memset(&yygotominor, 0, sizeof(yygotominor));
  1897. switch( yyruleno ){
  1898. /* Beginning here are the reduction cases. A typical example
  1899. ** follows:
  1900. ** case 0:
  1901. ** #line <lineno> <grammarfile>
  1902. ** { ... } // User supplied code
  1903. ** #line <lineno> <thisfile>
  1904. ** break;
  1905. */
  1906. case 0:
  1907. case 1:
  1908. case 2:
  1909. case 4:
  1910. case 5:
  1911. case 10:
  1912. case 11:
  1913. case 12:
  1914. case 20:
  1915. case 28:
  1916. case 29:
  1917. case 37:
  1918. case 44:
  1919. case 45:
  1920. case 46:
  1921. case 47:
  1922. case 48:
  1923. case 49:
  1924. case 55:
  1925. case 82:
  1926. case 83:
  1927. case 84:
  1928. case 85:
  1929. case 257:
  1930. case 258:
  1931. case 268:
  1932. case 269:
  1933. case 289:
  1934. case 290:
  1935. case 298:
  1936. case 299:
  1937. case 303:
  1938. case 304:
  1939. case 306:
  1940. case 310:
  1941. #line 96 "parse.y"
  1942. {
  1943. }
  1944. #line 1982 "parse.c"
  1945. break;
  1946. case 3:
  1947. #line 99 "parse.y"
  1948. { sqlite3FinishCoding(pParse); }
  1949. #line 1987 "parse.c"
  1950. break;
  1951. case 6:
  1952. #line 102 "parse.y"
  1953. { sqlite3BeginParse(pParse, 0); }
  1954. #line 1992 "parse.c"
  1955. break;
  1956. case 7:
  1957. #line 104 "parse.y"
  1958. { sqlite3BeginParse(pParse, 1); }
  1959. #line 1997 "parse.c"
  1960. break;
  1961. case 8:
  1962. #line 105 "parse.y"
  1963. { sqlite3BeginParse(pParse, 2); }
  1964. #line 2002 "parse.c"
  1965. break;
  1966. case 9:
  1967. #line 111 "parse.y"
  1968. {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy46);}
  1969. #line 2007 "parse.c"
  1970. break;
  1971. case 13:
  1972. #line 116 "parse.y"
  1973. {yygotominor.yy46 = TK_DEFERRED;}
  1974. #line 2012 "parse.c"
  1975. break;
  1976. case 14:
  1977. case 15:
  1978. case 16:
  1979. case 107:
  1980. case 109:
  1981. #line 117 "parse.y"
  1982. {yygotominor.yy46 = yymsp[0].major;}
  1983. #line 2021 "parse.c"
  1984. break;
  1985. case 17:
  1986. case 18:
  1987. #line 120 "parse.y"
  1988. {sqlite3CommitTransaction(pParse);}
  1989. #line 2027 "parse.c"
  1990. break;
  1991. case 19:
  1992. #line 122 "parse.y"
  1993. {sqlite3RollbackTransaction(pParse);}
  1994. #line 2032 "parse.c"
  1995. break;
  1996. case 21:
  1997. #line 127 "parse.y"
  1998. {
  1999. sqlite3StartTable(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410,yymsp[-4].minor.yy46,0,0,yymsp[-2].minor.yy46);
  2000. }
  2001. #line 2039 "parse.c"
  2002. break;
  2003. case 22:
  2004. case 25:
  2005. case 63:
  2006. case 77:
  2007. case 79:
  2008. case 90:
  2009. case 101:
  2010. case 112:
  2011. case 113:
  2012. case 213:
  2013. case 216:
  2014. #line 131 "parse.y"
  2015. {yygotominor.yy46 = 0;}
  2016. #line 2054 "parse.c"
  2017. break;
  2018. case 23:
  2019. case 24:
  2020. case 64:
  2021. case 78:
  2022. case 100:
  2023. case 111:
  2024. case 214:
  2025. case 217:
  2026. #line 132 "parse.y"
  2027. {yygotominor.yy46 = 1;}
  2028. #line 2066 "parse.c"
  2029. break;
  2030. case 26:
  2031. #line 138 "parse.y"
  2032. {
  2033. sqlite3EndTable(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy0,0);
  2034. }
  2035. #line 2073 "parse.c"
  2036. break;
  2037. case 27:
  2038. #line 141 "parse.y"
  2039. {
  2040. sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy219);
  2041. sqlite3SelectDelete(yymsp[0].minor.yy219);
  2042. }
  2043. #line 2081 "parse.c"
  2044. break;
  2045. case 30:
  2046. #line 153 "parse.y"
  2047. {
  2048. yygotominor.yy410.z = yymsp[-2].minor.yy410.z;
  2049. yygotominor.yy410.n = (pParse->sLastToken.z-yymsp[-2].minor.yy410.z) + pParse->sLastToken.n;
  2050. }
  2051. #line 2089 "parse.c"
  2052. break;
  2053. case 31:
  2054. #line 157 "parse.y"
  2055. {
  2056. sqlite3AddColumn(pParse,&yymsp[0].minor.yy410);
  2057. yygotominor.yy410 = yymsp[0].minor.yy410;
  2058. }
  2059. #line 2097 "parse.c"
  2060. break;
  2061. case 32:
  2062. case 33:
  2063. case 34:
  2064. case 35:
  2065. case 36:
  2066. case 256:
  2067. #line 167 "parse.y"
  2068. {yygotominor.yy410 = yymsp[0].minor.yy0;}
  2069. #line 2107 "parse.c"
  2070. break;
  2071. case 38:
  2072. #line 228 "parse.y"
  2073. {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy410);}
  2074. #line 2112 "parse.c"
  2075. break;
  2076. case 39:
  2077. case 42:
  2078. case 119:
  2079. case 120:
  2080. case 131:
  2081. case 241:
  2082. case 243:
  2083. case 252:
  2084. case 253:
  2085. case 254:
  2086. case 255:
  2087. #line 229 "parse.y"
  2088. {yygotominor.yy410 = yymsp[0].minor.yy410;}
  2089. #line 2127 "parse.c"
  2090. break;
  2091. case 40:
  2092. #line 230 "parse.y"
  2093. {
  2094. yygotominor.yy410.z = yymsp[-3].minor.yy410.z;
  2095. yygotominor.yy410.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy410.z;
  2096. }
  2097. #line 2135 "parse.c"
  2098. break;
  2099. case 41:
  2100. #line 234 "parse.y"
  2101. {
  2102. yygotominor.yy410.z = yymsp[-5].minor.yy410.z;
  2103. yygotominor.yy410.n = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy410.z;
  2104. }
  2105. #line 2143 "parse.c"
  2106. break;
  2107. case 43:
  2108. #line 240 "parse.y"
  2109. {yygotominor.yy410.z=yymsp[-1].minor.yy410.z; yygotominor.yy410.n=yymsp[0].minor.yy410.n+(yymsp[0].minor.yy410.z-yymsp[-1].minor.yy410.z);}
  2110. #line 2148 "parse.c"
  2111. break;
  2112. case 50:
  2113. case 52:
  2114. #line 251 "parse.y"
  2115. {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy172);}
  2116. #line 2154 "parse.c"
  2117. break;
  2118. case 51:
  2119. #line 252 "parse.y"
  2120. {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy172);}
  2121. #line 2159 "parse.c"
  2122. break;
  2123. case 53:
  2124. #line 254 "parse.y"
  2125. {
  2126. Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy172, 0, 0);
  2127. sqlite3AddDefaultValue(pParse,p);
  2128. }
  2129. #line 2167 "parse.c"
  2130. break;
  2131. case 54:
  2132. #line 258 "parse.y"
  2133. {
  2134. Expr *p = sqlite3PExpr(pParse, TK_STRING, 0, 0, &yymsp[0].minor.yy410);
  2135. sqlite3AddDefaultValue(pParse,p);
  2136. }
  2137. #line 2175 "parse.c"
  2138. break;
  2139. case 56:
  2140. #line 267 "parse.y"
  2141. {sqlite3AddNotNull(pParse, yymsp[0].minor.yy46);}
  2142. #line 2180 "parse.c"
  2143. break;
  2144. case 57:
  2145. #line 269 "parse.y"
  2146. {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy46,yymsp[0].minor.yy46,yymsp[-2].minor.yy46);}
  2147. #line 2185 "parse.c"
  2148. break;
  2149. case 58:
  2150. #line 270 "parse.y"
  2151. {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy46,0,0,0,0);}
  2152. #line 2190 "parse.c"
  2153. break;
  2154. case 59:
  2155. #line 271 "parse.y"
  2156. {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy172);}
  2157. #line 2195 "parse.c"
  2158. break;
  2159. case 60:
  2160. #line 273 "parse.y"
  2161. {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy410,yymsp[-1].minor.yy174,yymsp[0].minor.yy46);}
  2162. #line 2200 "parse.c"
  2163. break;
  2164. case 61:
  2165. #line 274 "parse.y"
  2166. {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy46);}
  2167. #line 2205 "parse.c"
  2168. break;
  2169. case 62:
  2170. #line 275 "parse.y"
  2171. {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy410);}
  2172. #line 2210 "parse.c"
  2173. break;
  2174. case 65:
  2175. #line 288 "parse.y"
  2176. { yygotominor.yy46 = OE_Restrict * 0x010101; }
  2177. #line 2215 "parse.c"
  2178. break;
  2179. case 66:
  2180. #line 289 "parse.y"
  2181. { yygotominor.yy46 = (yymsp[-1].minor.yy46 & yymsp[0].minor.yy405.mask) | yymsp[0].minor.yy405.value; }
  2182. #line 2220 "parse.c"
  2183. break;
  2184. case 67:
  2185. #line 291 "parse.y"
  2186. { yygotominor.yy405.value = 0; yygotominor.yy405.mask = 0x000000; }
  2187. #line 2225 "parse.c"
  2188. break;
  2189. case 68:
  2190. #line 292 "parse.y"
  2191. { yygotominor.yy405.value = yymsp[0].minor.yy46; yygotominor.yy405.mask = 0x0000ff; }
  2192. #line 2230 "parse.c"
  2193. break;
  2194. case 69:
  2195. #line 293 "parse.y"
  2196. { yygotominor.yy405.value = yymsp[0].minor.yy46<<8; yygotominor.yy405.mask = 0x00ff00; }
  2197. #line 2235 "parse.c"
  2198. break;
  2199. case 70:
  2200. #line 294 "parse.y"
  2201. { yygotominor.yy405.value = yymsp[0].minor.yy46<<16; yygotominor.yy405.mask = 0xff0000; }
  2202. #line 2240 "parse.c"
  2203. break;
  2204. case 71:
  2205. #line 296 "parse.y"
  2206. { yygotominor.yy46 = OE_SetNull; }
  2207. #line 2245 "parse.c"
  2208. break;
  2209. case 72:
  2210. #line 297 "parse.y"
  2211. { yygotominor.yy46 = OE_SetDflt; }
  2212. #line 2250 "parse.c"
  2213. break;
  2214. case 73:
  2215. #line 298 "parse.y"
  2216. { yygotominor.yy46 = OE_Cascade; }
  2217. #line 2255 "parse.c"
  2218. break;
  2219. case 74:
  2220. #line 299 "parse.y"
  2221. { yygotominor.yy46 = OE_Restrict; }
  2222. #line 2260 "parse.c"
  2223. break;
  2224. case 75:
  2225. case 76:
  2226. case 91:
  2227. case 93:
  2228. case 95:
  2229. case 96:
  2230. case 166:
  2231. #line 301 "parse.y"
  2232. {yygotominor.yy46 = yymsp[0].minor.yy46;}
  2233. #line 2271 "parse.c"
  2234. break;
  2235. case 80:
  2236. #line 311 "parse.y"
  2237. {yygotominor.yy410.n = 0; yygotominor.yy410.z = 0;}
  2238. #line 2276 "parse.c"
  2239. break;
  2240. case 81:
  2241. #line 312 "parse.y"
  2242. {yygotominor.yy410 = yymsp[-1].minor.yy0;}
  2243. #line 2281 "parse.c"
  2244. break;
  2245. case 86:
  2246. #line 318 "parse.y"
  2247. {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy174,yymsp[0].minor.yy46,yymsp[-2].minor.yy46,0);}
  2248. #line 2286 "parse.c"
  2249. break;
  2250. case 87:
  2251. #line 320 "parse.y"
  2252. {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy174,yymsp[0].minor.yy46,0,0,0,0);}
  2253. #line 2291 "parse.c"
  2254. break;
  2255. case 88:
  2256. #line 321 "parse.y"
  2257. {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy172);}
  2258. #line 2296 "parse.c"
  2259. break;
  2260. case 89:
  2261. #line 323 "parse.y"
  2262. {
  2263. sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy174, &yymsp[-3].minor.yy410, yymsp[-2].minor.yy174, yymsp[-1].minor.yy46);
  2264. sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy46);
  2265. }
  2266. #line 2304 "parse.c"
  2267. break;
  2268. case 92:
  2269. case 94:
  2270. #line 337 "parse.y"
  2271. {yygotominor.yy46 = OE_Default;}
  2272. #line 2310 "parse.c"
  2273. break;
  2274. case 97:
  2275. #line 342 "parse.y"
  2276. {yygotominor.yy46 = OE_Ignore;}
  2277. #line 2315 "parse.c"
  2278. break;
  2279. case 98:
  2280. case 167:
  2281. #line 343 "parse.y"
  2282. {yygotominor.yy46 = OE_Replace;}
  2283. #line 2321 "parse.c"
  2284. break;
  2285. case 99:
  2286. #line 347 "parse.y"
  2287. {
  2288. sqlite3DropTable(pParse, yymsp[0].minor.yy373, 0, yymsp[-1].minor.yy46);
  2289. }
  2290. #line 2328 "parse.c"
  2291. break;
  2292. case 102:
  2293. #line 357 "parse.y"
  2294. {
  2295. sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy410, &yymsp[-2].minor.yy410, yymsp[0].minor.yy219, yymsp[-6].minor.yy46, yymsp[-4].minor.yy46);
  2296. }
  2297. #line 2335 "parse.c"
  2298. break;
  2299. case 103:
  2300. #line 360 "parse.y"
  2301. {
  2302. sqlite3DropTable(pParse, yymsp[0].minor.yy373, 1, yymsp[-1].minor.yy46);
  2303. }
  2304. #line 2342 "parse.c"
  2305. break;
  2306. case 104:
  2307. #line 367 "parse.y"
  2308. {
  2309. sqlite3Select(pParse, yymsp[0].minor.yy219, SRT_Callback, 0, 0, 0, 0, 0);
  2310. sqlite3SelectDelete(yymsp[0].minor.yy219);
  2311. }
  2312. #line 2350 "parse.c"
  2313. break;
  2314. case 105:
  2315. case 128:
  2316. #line 377 "parse.y"
  2317. {yygotominor.yy219 = yymsp[0].minor.yy219;}
  2318. #line 2356 "parse.c"
  2319. break;
  2320. case 106:
  2321. #line 379 "parse.y"
  2322. {
  2323. if( yymsp[0].minor.yy219 ){
  2324. yymsp[0].minor.yy219->op = yymsp[-1].minor.yy46;
  2325. yymsp[0].minor.yy219->pPrior = yymsp[-2].minor.yy219;
  2326. }else{
  2327. sqlite3SelectDelete(yymsp[-2].minor.yy219);
  2328. }
  2329. yygotominor.yy219 = yymsp[0].minor.yy219;
  2330. }
  2331. #line 2369 "parse.c"
  2332. break;
  2333. case 108:
  2334. #line 390 "parse.y"
  2335. {yygotominor.yy46 = TK_ALL;}
  2336. #line 2374 "parse.c"
  2337. break;
  2338. case 110:
  2339. #line 394 "parse.y"
  2340. {
  2341. yygotominor.yy219 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy174,yymsp[-5].minor.yy373,yymsp[-4].minor.yy172,yymsp[-3].minor.yy174,yymsp[-2].minor.yy172,yymsp[-1].minor.yy174,yymsp[-7].minor.yy46,yymsp[0].minor.yy234.pLimit,yymsp[0].minor.yy234.pOffset);
  2342. }
  2343. #line 2381 "parse.c"
  2344. break;
  2345. case 114:
  2346. case 238:
  2347. #line 415 "parse.y"
  2348. {yygotominor.yy174 = yymsp[-1].minor.yy174;}
  2349. #line 2387 "parse.c"
  2350. break;
  2351. case 115:
  2352. case 141:
  2353. case 149:
  2354. case 231:
  2355. case 237:
  2356. #line 416 "parse.y"
  2357. {yygotominor.yy174 = 0;}
  2358. #line 2396 "parse.c"
  2359. break;
  2360. case 116:
  2361. #line 417 "parse.y"
  2362. {
  2363. yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy174,yymsp[-1].minor.yy172,yymsp[0].minor.yy410.n?&yymsp[0].minor.yy410:0);
  2364. }
  2365. #line 2403 "parse.c"
  2366. break;
  2367. case 117:
  2368. #line 420 "parse.y"
  2369. {
  2370. Expr *p = sqlite3PExpr(pParse, TK_ALL, 0, 0, 0);
  2371. yygotominor.yy174 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy174, p, 0);
  2372. }
  2373. #line 2411 "parse.c"
  2374. break;
  2375. case 118:
  2376. #line 424 "parse.y"
  2377. {
  2378. Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, 0);
  2379. Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy410);
  2380. Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
  2381. yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy174, pDot, 0);
  2382. }
  2383. #line 2421 "parse.c"
  2384. break;
  2385. case 121:
  2386. #line 437 "parse.y"
  2387. {yygotominor.yy410.n = 0;}
  2388. #line 2426 "parse.c"
  2389. break;
  2390. case 122:
  2391. #line 449 "parse.y"
  2392. {yygotominor.yy373 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy373));}
  2393. #line 2431 "parse.c"
  2394. break;
  2395. case 123:
  2396. #line 450 "parse.y"
  2397. {
  2398. yygotominor.yy373 = yymsp[0].minor.yy373;
  2399. sqlite3SrcListShiftJoinType(yygotominor.yy373);
  2400. }
  2401. #line 2439 "parse.c"
  2402. break;
  2403. case 124:
  2404. #line 458 "parse.y"
  2405. {
  2406. yygotominor.yy373 = yymsp[-1].minor.yy373;
  2407. if( yygotominor.yy373 && yygotominor.yy373->nSrc>0 ) yygotominor.yy373->a[yygotominor.yy373->nSrc-1].jointype = yymsp[0].minor.yy46;
  2408. }
  2409. #line 2447 "parse.c"
  2410. break;
  2411. case 125:
  2412. #line 462 "parse.y"
  2413. {yygotominor.yy373 = 0;}
  2414. #line 2452 "parse.c"
  2415. break;
  2416. case 126:
  2417. #line 463 "parse.y"
  2418. {
  2419. yygotominor.yy373 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy373,&yymsp[-4].minor.yy410,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,0,yymsp[-1].minor.yy172,yymsp[0].minor.yy432);
  2420. }
  2421. #line 2459 "parse.c"
  2422. break;
  2423. case 127:
  2424. #line 468 "parse.y"
  2425. {
  2426. yygotominor.yy373 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy373,0,0,&yymsp[-2].minor.yy410,yymsp[-4].minor.yy219,yymsp[-1].minor.yy172,yymsp[0].minor.yy432);
  2427. }
  2428. #line 2466 "parse.c"
  2429. break;
  2430. case 129:
  2431. #line 479 "parse.y"
  2432. {
  2433. sqlite3SrcListShiftJoinType(yymsp[0].minor.yy373);
  2434. yygotominor.yy219 = sqlite3SelectNew(pParse,0,yymsp[0].minor.yy373,0,0,0,0,0,0,0);
  2435. }
  2436. #line 2474 "parse.c"
  2437. break;
  2438. case 130:
  2439. #line 486 "parse.y"
  2440. {yygotominor.yy410.z=0; yygotominor.yy410.n=0;}
  2441. #line 2479 "parse.c"
  2442. break;
  2443. case 132:
  2444. #line 491 "parse.y"
  2445. {yygotominor.yy373 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410);}
  2446. #line 2484 "parse.c"
  2447. break;
  2448. case 133:
  2449. #line 495 "parse.y"
  2450. { yygotominor.yy46 = JT_INNER; }
  2451. #line 2489 "parse.c"
  2452. break;
  2453. case 134:
  2454. #line 496 "parse.y"
  2455. { yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
  2456. #line 2494 "parse.c"
  2457. break;
  2458. case 135:
  2459. #line 497 "parse.y"
  2460. { yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy410,0); }
  2461. #line 2499 "parse.c"
  2462. break;
  2463. case 136:
  2464. #line 499 "parse.y"
  2465. { yygotominor.yy46 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy410,&yymsp[-1].minor.yy410); }
  2466. #line 2504 "parse.c"
  2467. break;
  2468. case 137:
  2469. case 145:
  2470. case 152:
  2471. case 159:
  2472. case 174:
  2473. case 202:
  2474. case 226:
  2475. case 228:
  2476. #line 503 "parse.y"
  2477. {yygotominor.yy172 = yymsp[0].minor.yy172;}
  2478. #line 2516 "parse.c"
  2479. break;
  2480. case 138:
  2481. case 151:
  2482. case 158:
  2483. case 203:
  2484. case 227:
  2485. case 229:
  2486. #line 504 "parse.y"
  2487. {yygotominor.yy172 = 0;}
  2488. #line 2526 "parse.c"
  2489. break;
  2490. case 139:
  2491. case 171:
  2492. #line 508 "parse.y"
  2493. {yygotominor.yy432 = yymsp[-1].minor.yy432;}
  2494. #line 2532 "parse.c"
  2495. break;
  2496. case 140:
  2497. case 170:
  2498. #line 509 "parse.y"
  2499. {yygotominor.yy432 = 0;}
  2500. #line 2538 "parse.c"
  2501. break;
  2502. case 142:
  2503. case 150:
  2504. case 230:
  2505. #line 520 "parse.y"
  2506. {yygotominor.yy174 = yymsp[0].minor.yy174;}
  2507. #line 2545 "parse.c"
  2508. break;
  2509. case 143:
  2510. #line 521 "parse.y"
  2511. {
  2512. yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy174,yymsp[-1].minor.yy172,0);
  2513. if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
  2514. }
  2515. #line 2553 "parse.c"
  2516. break;
  2517. case 144:
  2518. #line 525 "parse.y"
  2519. {
  2520. yygotominor.yy174 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy172,0);
  2521. if( yygotominor.yy174 && yygotominor.yy174->a ) yygotominor.yy174->a[0].sortOrder = yymsp[0].minor.yy46;
  2522. }
  2523. #line 2561 "parse.c"
  2524. break;
  2525. case 146:
  2526. case 148:
  2527. #line 533 "parse.y"
  2528. {yygotominor.yy46 = SQLITE_SO_ASC;}
  2529. #line 2567 "parse.c"
  2530. break;
  2531. case 147:
  2532. #line 534 "parse.y"
  2533. {yygotominor.yy46 = SQLITE_SO_DESC;}
  2534. #line 2572 "parse.c"
  2535. break;
  2536. case 153:
  2537. #line 560 "parse.y"
  2538. {yygotominor.yy234.pLimit = 0; yygotominor.yy234.pOffset = 0;}
  2539. #line 2577 "parse.c"
  2540. break;
  2541. case 154:
  2542. #line 561 "parse.y"
  2543. {yygotominor.yy234.pLimit = yymsp[0].minor.yy172; yygotominor.yy234.pOffset = 0;}
  2544. #line 2582 "parse.c"
  2545. break;
  2546. case 155:
  2547. #line 563 "parse.y"
  2548. {yygotominor.yy234.pLimit = yymsp[-2].minor.yy172; yygotominor.yy234.pOffset = yymsp[0].minor.yy172;}
  2549. #line 2587 "parse.c"
  2550. break;
  2551. case 156:
  2552. #line 565 "parse.y"
  2553. {yygotominor.yy234.pOffset = yymsp[-2].minor.yy172; yygotominor.yy234.pLimit = yymsp[0].minor.yy172;}
  2554. #line 2592 "parse.c"
  2555. break;
  2556. case 157:
  2557. #line 569 "parse.y"
  2558. {sqlite3DeleteFrom(pParse,yymsp[-1].minor.yy373,yymsp[0].minor.yy172);}
  2559. #line 2597 "parse.c"
  2560. break;
  2561. case 160:
  2562. #line 579 "parse.y"
  2563. {
  2564. sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy174,SQLITE_MAX_COLUMN,"set list");
  2565. sqlite3Update(pParse,yymsp[-3].minor.yy373,yymsp[-1].minor.yy174,yymsp[0].minor.yy172,yymsp[-4].minor.yy46);
  2566. }
  2567. #line 2605 "parse.c"
  2568. break;
  2569. case 161:
  2570. #line 588 "parse.y"
  2571. {yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy174,yymsp[0].minor.yy172,&yymsp[-2].minor.yy410);}
  2572. #line 2610 "parse.c"
  2573. break;
  2574. case 162:
  2575. #line 590 "parse.y"
  2576. {yygotominor.yy174 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy172,&yymsp[-2].minor.yy410);}
  2577. #line 2615 "parse.c"
  2578. break;
  2579. case 163:
  2580. #line 596 "parse.y"
  2581. {sqlite3Insert(pParse, yymsp[-5].minor.yy373, yymsp[-1].minor.yy174, 0, yymsp[-4].minor.yy432, yymsp[-7].minor.yy46);}
  2582. #line 2620 "parse.c"
  2583. break;
  2584. case 164:
  2585. #line 598 "parse.y"
  2586. {sqlite3Insert(pParse, yymsp[-2].minor.yy373, 0, yymsp[0].minor.yy219, yymsp[-1].minor.yy432, yymsp[-4].minor.yy46);}
  2587. #line 2625 "parse.c"
  2588. break;
  2589. case 165:
  2590. #line 600 "parse.y"
  2591. {sqlite3Insert(pParse, yymsp[-3].minor.yy373, 0, 0, yymsp[-2].minor.yy432, yymsp[-5].minor.yy46);}
  2592. #line 2630 "parse.c"
  2593. break;
  2594. case 168:
  2595. case 232:
  2596. #line 611 "parse.y"
  2597. {yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy174,yymsp[0].minor.yy172,0);}
  2598. #line 2636 "parse.c"
  2599. break;
  2600. case 169:
  2601. case 233:
  2602. #line 613 "parse.y"
  2603. {yygotominor.yy174 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy172,0);}
  2604. #line 2642 "parse.c"
  2605. break;
  2606. case 172:
  2607. #line 623 "parse.y"
  2608. {yygotominor.yy432 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy432,&yymsp[0].minor.yy410);}
  2609. #line 2647 "parse.c"
  2610. break;
  2611. case 173:
  2612. #line 625 "parse.y"
  2613. {yygotominor.yy432 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy410);}
  2614. #line 2652 "parse.c"
  2615. break;
  2616. case 175:
  2617. #line 636 "parse.y"
  2618. {yygotominor.yy172 = yymsp[-1].minor.yy172; sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); }
  2619. #line 2657 "parse.c"
  2620. break;
  2621. case 176:
  2622. case 181:
  2623. case 182:
  2624. #line 637 "parse.y"
  2625. {yygotominor.yy172 = sqlite3PExpr(pParse, yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);}
  2626. #line 2664 "parse.c"
  2627. break;
  2628. case 177:
  2629. case 178:
  2630. #line 638 "parse.y"
  2631. {yygotominor.yy172 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);}
  2632. #line 2670 "parse.c"
  2633. break;
  2634. case 179:
  2635. #line 640 "parse.y"
  2636. {
  2637. Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy410);
  2638. Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy410);
  2639. yygotominor.yy172 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
  2640. }
  2641. #line 2679 "parse.c"
  2642. break;
  2643. case 180:
  2644. #line 645 "parse.y"
  2645. {
  2646. Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy410);
  2647. Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy410);
  2648. Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy410);
  2649. Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
  2650. yygotominor.yy172 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
  2651. }
  2652. #line 2690 "parse.c"
  2653. break;
  2654. case 183:
  2655. #line 654 "parse.y"
  2656. {yygotominor.yy172 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);}
  2657. #line 2695 "parse.c"
  2658. break;
  2659. case 184:
  2660. #line 655 "parse.y"
  2661. {
  2662. Token *pToken = &yymsp[0].minor.yy0;
  2663. Expr *pExpr = yygotominor.yy172 = sqlite3PExpr(pParse, TK_VARIABLE, 0, 0, pToken);
  2664. sqlite3ExprAssignVarNumber(pParse, pExpr);
  2665. }
  2666. #line 2704 "parse.c"
  2667. break;
  2668. case 185:
  2669. #line 660 "parse.y"
  2670. {
  2671. yygotominor.yy172 = sqlite3ExprSetColl(pParse, yymsp[-2].minor.yy172, &yymsp[0].minor.yy410);
  2672. }
  2673. #line 2711 "parse.c"
  2674. break;
  2675. case 186:
  2676. #line 664 "parse.y"
  2677. {
  2678. yygotominor.yy172 = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy172, 0, &yymsp[-1].minor.yy410);
  2679. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
  2680. }
  2681. #line 2719 "parse.c"
  2682. break;
  2683. case 187:
  2684. #line 669 "parse.y"
  2685. {
  2686. if( yymsp[-1].minor.yy174 && yymsp[-1].minor.yy174->nExpr>SQLITE_MAX_FUNCTION_ARG ){
  2687. sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
  2688. }
  2689. yygotominor.yy172 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy174, &yymsp[-4].minor.yy0);
  2690. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
  2691. if( yymsp[-2].minor.yy46 && yygotominor.yy172 ){
  2692. yygotominor.yy172->flags |= EP_Distinct;
  2693. }
  2694. }
  2695. #line 2733 "parse.c"
  2696. break;
  2697. case 188:
  2698. #line 679 "parse.y"
  2699. {
  2700. yygotominor.yy172 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
  2701. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
  2702. }
  2703. #line 2741 "parse.c"
  2704. break;
  2705. case 189:
  2706. #line 683 "parse.y"
  2707. {
  2708. /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
  2709. ** treated as functions that return constants */
  2710. yygotominor.yy172 = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
  2711. if( yygotominor.yy172 ){
  2712. yygotominor.yy172->op = TK_CONST_FUNC;
  2713. yygotominor.yy172->span = yymsp[0].minor.yy0;
  2714. }
  2715. }
  2716. #line 2754 "parse.c"
  2717. break;
  2718. case 190:
  2719. case 191:
  2720. case 192:
  2721. case 193:
  2722. case 194:
  2723. case 195:
  2724. case 196:
  2725. case 197:
  2726. #line 692 "parse.y"
  2727. {yygotominor.yy172 = sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy172,yymsp[0].minor.yy172,0);}
  2728. #line 2766 "parse.c"
  2729. break;
  2730. case 198:
  2731. case 200:
  2732. #line 704 "parse.y"
  2733. {yygotominor.yy72.eOperator = yymsp[0].minor.yy0; yygotominor.yy72.not = 0;}
  2734. #line 2772 "parse.c"
  2735. break;
  2736. case 199:
  2737. case 201:
  2738. #line 705 "parse.y"
  2739. {yygotominor.yy72.eOperator = yymsp[0].minor.yy0; yygotominor.yy72.not = 1;}
  2740. #line 2778 "parse.c"
  2741. break;
  2742. case 204:
  2743. #line 712 "parse.y"
  2744. {
  2745. ExprList *pList;
  2746. pList = sqlite3ExprListAppend(pParse,0, yymsp[-1].minor.yy172, 0);
  2747. pList = sqlite3ExprListAppend(pParse,pList, yymsp[-3].minor.yy172, 0);
  2748. if( yymsp[0].minor.yy172 ){
  2749. pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy172, 0);
  2750. }
  2751. yygotominor.yy172 = sqlite3ExprFunction(pParse, pList, &yymsp[-2].minor.yy72.eOperator);
  2752. if( yymsp[-2].minor.yy72.not ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
  2753. sqlite3ExprSpan(yygotominor.yy172, &yymsp[-3].minor.yy172->span, &yymsp[-1].minor.yy172->span);
  2754. if( yygotominor.yy172 ) yygotominor.yy172->flags |= EP_InfixFunc;
  2755. }
  2756. #line 2794 "parse.c"
  2757. break;
  2758. case 205:
  2759. #line 725 "parse.y"
  2760. {
  2761. yygotominor.yy172 = sqlite3PExpr(pParse, yymsp[0].major, yymsp[-1].minor.yy172, 0, 0);
  2762. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy172->span,&yymsp[0].minor.yy0);
  2763. }
  2764. #line 2802 "parse.c"
  2765. break;
  2766. case 206:
  2767. #line 729 "parse.y"
  2768. {
  2769. yygotominor.yy172 = sqlite3PExpr(pParse, TK_ISNULL, yymsp[-2].minor.yy172, 0, 0);
  2770. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy172->span,&yymsp[0].minor.yy0);
  2771. }
  2772. #line 2810 "parse.c"
  2773. break;
  2774. case 207:
  2775. #line 733 "parse.y"
  2776. {
  2777. yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-2].minor.yy172, 0, 0);
  2778. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy172->span,&yymsp[0].minor.yy0);
  2779. }
  2780. #line 2818 "parse.c"
  2781. break;
  2782. case 208:
  2783. #line 737 "parse.y"
  2784. {
  2785. yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-3].minor.yy172, 0, 0);
  2786. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy172->span,&yymsp[0].minor.yy0);
  2787. }
  2788. #line 2826 "parse.c"
  2789. break;
  2790. case 209:
  2791. case 210:
  2792. #line 741 "parse.y"
  2793. {
  2794. yygotominor.yy172 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy172, 0, 0);
  2795. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
  2796. }
  2797. #line 2835 "parse.c"
  2798. break;
  2799. case 211:
  2800. #line 749 "parse.y"
  2801. {
  2802. yygotominor.yy172 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy172, 0, 0);
  2803. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
  2804. }
  2805. #line 2843 "parse.c"
  2806. break;
  2807. case 212:
  2808. #line 753 "parse.y"
  2809. {
  2810. yygotominor.yy172 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy172, 0, 0);
  2811. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy172->span);
  2812. }
  2813. #line 2851 "parse.c"
  2814. break;
  2815. case 215:
  2816. #line 760 "parse.y"
  2817. {
  2818. ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy172, 0);
  2819. pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy172, 0);
  2820. yygotominor.yy172 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy172, 0, 0);
  2821. if( yygotominor.yy172 ){
  2822. yygotominor.yy172->pList = pList;
  2823. }else{
  2824. sqlite3ExprListDelete(pList);
  2825. }
  2826. if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
  2827. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy172->span);
  2828. }
  2829. #line 2867 "parse.c"
  2830. break;
  2831. case 218:
  2832. #line 776 "parse.y"
  2833. {
  2834. yygotominor.yy172 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy172, 0, 0);
  2835. if( yygotominor.yy172 ){
  2836. yygotominor.yy172->pList = yymsp[-1].minor.yy174;
  2837. sqlite3ExprSetHeight(yygotominor.yy172);
  2838. }else{
  2839. sqlite3ExprListDelete(yymsp[-1].minor.yy174);
  2840. }
  2841. if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
  2842. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy0);
  2843. }
  2844. #line 2882 "parse.c"
  2845. break;
  2846. case 219:
  2847. #line 787 "parse.y"
  2848. {
  2849. yygotominor.yy172 = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
  2850. if( yygotominor.yy172 ){
  2851. yygotominor.yy172->pSelect = yymsp[-1].minor.yy219;
  2852. sqlite3ExprSetHeight(yygotominor.yy172);
  2853. }else{
  2854. sqlite3SelectDelete(yymsp[-1].minor.yy219);
  2855. }
  2856. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
  2857. }
  2858. #line 2896 "parse.c"
  2859. break;
  2860. case 220:
  2861. #line 797 "parse.y"
  2862. {
  2863. yygotominor.yy172 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy172, 0, 0);
  2864. if( yygotominor.yy172 ){
  2865. yygotominor.yy172->pSelect = yymsp[-1].minor.yy219;
  2866. sqlite3ExprSetHeight(yygotominor.yy172);
  2867. }else{
  2868. sqlite3SelectDelete(yymsp[-1].minor.yy219);
  2869. }
  2870. if( yymsp[-3].minor.yy46 ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
  2871. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-4].minor.yy172->span,&yymsp[0].minor.yy0);
  2872. }
  2873. #line 2911 "parse.c"
  2874. break;
  2875. case 221:
  2876. #line 808 "parse.y"
  2877. {
  2878. SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410);
  2879. yygotominor.yy172 = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy172, 0, 0);
  2880. if( yygotominor.yy172 ){
  2881. yygotominor.yy172->pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
  2882. sqlite3ExprSetHeight(yygotominor.yy172);
  2883. }else{
  2884. sqlite3SrcListDelete(pSrc);
  2885. }
  2886. if( yymsp[-2].minor.yy46 ) yygotominor.yy172 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy172, 0, 0);
  2887. sqlite3ExprSpan(yygotominor.yy172,&yymsp[-3].minor.yy172->span,yymsp[0].minor.yy410.z?&yymsp[0].minor.yy410:&yymsp[-1].minor.yy410);
  2888. }
  2889. #line 2927 "parse.c"
  2890. break;
  2891. case 222:
  2892. #line 820 "parse.y"
  2893. {
  2894. Expr *p = yygotominor.yy172 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
  2895. if( p ){
  2896. p->pSelect = yymsp[-1].minor.yy219;
  2897. sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
  2898. sqlite3ExprSetHeight(yygotominor.yy172);
  2899. }else{
  2900. sqlite3SelectDelete(yymsp[-1].minor.yy219);
  2901. }
  2902. }
  2903. #line 2941 "parse.c"
  2904. break;
  2905. case 223:
  2906. #line 833 "parse.y"
  2907. {
  2908. yygotominor.yy172 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, 0);
  2909. if( yygotominor.yy172 ){
  2910. yygotominor.yy172->pList = yymsp[-2].minor.yy174;
  2911. sqlite3ExprSetHeight(yygotominor.yy172);
  2912. }else{
  2913. sqlite3ExprListDelete(yymsp[-2].minor.yy174);
  2914. }
  2915. sqlite3ExprSpan(yygotominor.yy172, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
  2916. }
  2917. #line 2955 "parse.c"
  2918. break;
  2919. case 224:
  2920. #line 845 "parse.y"
  2921. {
  2922. yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy174, yymsp[-2].minor.yy172, 0);
  2923. yygotominor.yy174 = sqlite3ExprListAppend(pParse,yygotominor.yy174, yymsp[0].minor.yy172, 0);
  2924. }
  2925. #line 2963 "parse.c"
  2926. break;
  2927. case 225:
  2928. #line 849 "parse.y"
  2929. {
  2930. yygotominor.yy174 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy172, 0);
  2931. yygotominor.yy174 = sqlite3ExprListAppend(pParse,yygotominor.yy174, yymsp[0].minor.yy172, 0);
  2932. }
  2933. #line 2971 "parse.c"
  2934. break;
  2935. case 234:
  2936. #line 878 "parse.y"
  2937. {
  2938. sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy410, &yymsp[-5].minor.yy410,
  2939. sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy410,0), yymsp[-1].minor.yy174, yymsp[-9].minor.yy46,
  2940. &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy46);
  2941. }
  2942. #line 2980 "parse.c"
  2943. break;
  2944. case 235:
  2945. case 282:
  2946. #line 885 "parse.y"
  2947. {yygotominor.yy46 = OE_Abort;}
  2948. #line 2986 "parse.c"
  2949. break;
  2950. case 236:
  2951. #line 886 "parse.y"
  2952. {yygotominor.yy46 = OE_None;}
  2953. #line 2991 "parse.c"
  2954. break;
  2955. case 239:
  2956. #line 896 "parse.y"
  2957. {
  2958. Expr *p = 0;
  2959. if( yymsp[-1].minor.yy410.n>0 ){
  2960. p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
  2961. sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy410);
  2962. }
  2963. yygotominor.yy174 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy174, p, &yymsp[-2].minor.yy410);
  2964. sqlite3ExprListCheckLength(pParse, yygotominor.yy174, SQLITE_MAX_COLUMN, "index");
  2965. if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
  2966. }
  2967. #line 3005 "parse.c"
  2968. break;
  2969. case 240:
  2970. #line 906 "parse.y"
  2971. {
  2972. Expr *p = 0;
  2973. if( yymsp[-1].minor.yy410.n>0 ){
  2974. p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
  2975. sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy410);
  2976. }
  2977. yygotominor.yy174 = sqlite3ExprListAppend(pParse,0, p, &yymsp[-2].minor.yy410);
  2978. sqlite3ExprListCheckLength(pParse, yygotominor.yy174, SQLITE_MAX_COLUMN, "index");
  2979. if( yygotominor.yy174 ) yygotominor.yy174->a[yygotominor.yy174->nExpr-1].sortOrder = yymsp[0].minor.yy46;
  2980. }
  2981. #line 3019 "parse.c"
  2982. break;
  2983. case 242:
  2984. #line 919 "parse.y"
  2985. {yygotominor.yy410.z = 0; yygotominor.yy410.n = 0;}
  2986. #line 3024 "parse.c"
  2987. break;
  2988. case 244:
  2989. #line 925 "parse.y"
  2990. {sqlite3DropIndex(pParse, yymsp[0].minor.yy373, yymsp[-1].minor.yy46);}
  2991. #line 3029 "parse.c"
  2992. break;
  2993. case 245:
  2994. case 246:
  2995. #line 931 "parse.y"
  2996. {sqlite3Vacuum(pParse);}
  2997. #line 3035 "parse.c"
  2998. break;
  2999. case 247:
  3000. #line 939 "parse.y"
  3001. {sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy410,0);}
  3002. #line 3040 "parse.c"
  3003. break;
  3004. case 248:
  3005. #line 940 "parse.y"
  3006. {sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy0,0);}
  3007. #line 3045 "parse.c"
  3008. break;
  3009. case 249:
  3010. #line 941 "parse.y"
  3011. {
  3012. sqlite3Pragma(pParse,&yymsp[-3].minor.yy410,&yymsp[-2].minor.yy410,&yymsp[0].minor.yy410,1);
  3013. }
  3014. #line 3052 "parse.c"
  3015. break;
  3016. case 250:
  3017. #line 944 "parse.y"
  3018. {sqlite3Pragma(pParse,&yymsp[-4].minor.yy410,&yymsp[-3].minor.yy410,&yymsp[-1].minor.yy410,0);}
  3019. #line 3057 "parse.c"
  3020. break;
  3021. case 251:
  3022. #line 945 "parse.y"
  3023. {sqlite3Pragma(pParse,&yymsp[-1].minor.yy410,&yymsp[0].minor.yy410,0,0);}
  3024. #line 3062 "parse.c"
  3025. break;
  3026. case 259:
  3027. #line 959 "parse.y"
  3028. {
  3029. Token all;
  3030. all.z = yymsp[-3].minor.yy410.z;
  3031. all.n = (yymsp[0].minor.yy0.z - yymsp[-3].minor.yy410.z) + yymsp[0].minor.yy0.n;
  3032. sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy243, &all);
  3033. }
  3034. #line 3072 "parse.c"
  3035. break;
  3036. case 260:
  3037. #line 968 "parse.y"
  3038. {
  3039. sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy410, &yymsp[-6].minor.yy410, yymsp[-5].minor.yy46, yymsp[-4].minor.yy370.a, yymsp[-4].minor.yy370.b, yymsp[-2].minor.yy373, yymsp[0].minor.yy172, yymsp[-10].minor.yy46, yymsp[-8].minor.yy46);
  3040. yygotominor.yy410 = (yymsp[-6].minor.yy410.n==0?yymsp[-7].minor.yy410:yymsp[-6].minor.yy410);
  3041. }
  3042. #line 3080 "parse.c"
  3043. break;
  3044. case 261:
  3045. case 264:
  3046. #line 974 "parse.y"
  3047. { yygotominor.yy46 = TK_BEFORE; }
  3048. #line 3086 "parse.c"
  3049. break;
  3050. case 262:
  3051. #line 975 "parse.y"
  3052. { yygotominor.yy46 = TK_AFTER; }
  3053. #line 3091 "parse.c"
  3054. break;
  3055. case 263:
  3056. #line 976 "parse.y"
  3057. { yygotominor.yy46 = TK_INSTEAD;}
  3058. #line 3096 "parse.c"
  3059. break;
  3060. case 265:
  3061. case 266:
  3062. #line 981 "parse.y"
  3063. {yygotominor.yy370.a = yymsp[0].major; yygotominor.yy370.b = 0;}
  3064. #line 3102 "parse.c"
  3065. break;
  3066. case 267:
  3067. #line 983 "parse.y"
  3068. {yygotominor.yy370.a = TK_UPDATE; yygotominor.yy370.b = yymsp[0].minor.yy432;}
  3069. #line 3107 "parse.c"
  3070. break;
  3071. case 270:
  3072. #line 990 "parse.y"
  3073. { yygotominor.yy172 = 0; }
  3074. #line 3112 "parse.c"
  3075. break;
  3076. case 271:
  3077. #line 991 "parse.y"
  3078. { yygotominor.yy172 = yymsp[0].minor.yy172; }
  3079. #line 3117 "parse.c"
  3080. break;
  3081. case 272:
  3082. #line 995 "parse.y"
  3083. {
  3084. if( yymsp[-2].minor.yy243 ){
  3085. yymsp[-2].minor.yy243->pLast->pNext = yymsp[-1].minor.yy243;
  3086. }else{
  3087. yymsp[-2].minor.yy243 = yymsp[-1].minor.yy243;
  3088. }
  3089. yymsp[-2].minor.yy243->pLast = yymsp[-1].minor.yy243;
  3090. yygotominor.yy243 = yymsp[-2].minor.yy243;
  3091. }
  3092. #line 3130 "parse.c"
  3093. break;
  3094. case 273:
  3095. #line 1004 "parse.y"
  3096. { yygotominor.yy243 = 0; }
  3097. #line 3135 "parse.c"
  3098. break;
  3099. case 274:
  3100. #line 1010 "parse.y"
  3101. { yygotominor.yy243 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-3].minor.yy410, yymsp[-1].minor.yy174, yymsp[0].minor.yy172, yymsp[-4].minor.yy46); }
  3102. #line 3140 "parse.c"
  3103. break;
  3104. case 275:
  3105. #line 1015 "parse.y"
  3106. {yygotominor.yy243 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy410, yymsp[-4].minor.yy432, yymsp[-1].minor.yy174, 0, yymsp[-7].minor.yy46);}
  3107. #line 3145 "parse.c"
  3108. break;
  3109. case 276:
  3110. #line 1018 "parse.y"
  3111. {yygotominor.yy243 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy410, yymsp[-1].minor.yy432, 0, yymsp[0].minor.yy219, yymsp[-4].minor.yy46);}
  3112. #line 3150 "parse.c"
  3113. break;
  3114. case 277:
  3115. #line 1022 "parse.y"
  3116. {yygotominor.yy243 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-1].minor.yy410, yymsp[0].minor.yy172);}
  3117. #line 3155 "parse.c"
  3118. break;
  3119. case 278:
  3120. #line 1025 "parse.y"
  3121. {yygotominor.yy243 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy219); }
  3122. #line 3160 "parse.c"
  3123. break;
  3124. case 279:
  3125. #line 1028 "parse.y"
  3126. {
  3127. yygotominor.yy172 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
  3128. if( yygotominor.yy172 ){
  3129. yygotominor.yy172->iColumn = OE_Ignore;
  3130. sqlite3ExprSpan(yygotominor.yy172, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
  3131. }
  3132. }
  3133. #line 3171 "parse.c"
  3134. break;
  3135. case 280:
  3136. #line 1035 "parse.y"
  3137. {
  3138. yygotominor.yy172 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy410);
  3139. if( yygotominor.yy172 ) {
  3140. yygotominor.yy172->iColumn = yymsp[-3].minor.yy46;
  3141. sqlite3ExprSpan(yygotominor.yy172, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
  3142. }
  3143. }
  3144. #line 3182 "parse.c"
  3145. break;
  3146. case 281:
  3147. #line 1045 "parse.y"
  3148. {yygotominor.yy46 = OE_Rollback;}
  3149. #line 3187 "parse.c"
  3150. break;
  3151. case 283:
  3152. #line 1047 "parse.y"
  3153. {yygotominor.yy46 = OE_Fail;}
  3154. #line 3192 "parse.c"
  3155. break;
  3156. case 284:
  3157. #line 1052 "parse.y"
  3158. {
  3159. sqlite3DropTrigger(pParse,yymsp[0].minor.yy373,yymsp[-1].minor.yy46);
  3160. }
  3161. #line 3199 "parse.c"
  3162. break;
  3163. case 285:
  3164. #line 1059 "parse.y"
  3165. {
  3166. sqlite3Attach(pParse, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, yymsp[0].minor.yy386);
  3167. }
  3168. #line 3206 "parse.c"
  3169. break;
  3170. case 286:
  3171. #line 1062 "parse.y"
  3172. {
  3173. sqlite3Detach(pParse, yymsp[0].minor.yy172);
  3174. }
  3175. #line 3213 "parse.c"
  3176. break;
  3177. case 287:
  3178. #line 1068 "parse.y"
  3179. { yygotominor.yy386 = 0; }
  3180. #line 3218 "parse.c"
  3181. break;
  3182. case 288:
  3183. #line 1069 "parse.y"
  3184. { yygotominor.yy386 = yymsp[0].minor.yy172; }
  3185. #line 3223 "parse.c"
  3186. break;
  3187. case 291:
  3188. #line 1077 "parse.y"
  3189. {sqlite3Reindex(pParse, 0, 0);}
  3190. #line 3228 "parse.c"
  3191. break;
  3192. case 292:
  3193. #line 1078 "parse.y"
  3194. {sqlite3Reindex(pParse, &yymsp[-1].minor.yy410, &yymsp[0].minor.yy410);}
  3195. #line 3233 "parse.c"
  3196. break;
  3197. case 293:
  3198. #line 1083 "parse.y"
  3199. {sqlite3Analyze(pParse, 0, 0);}
  3200. #line 3238 "parse.c"
  3201. break;
  3202. case 294:
  3203. #line 1084 "parse.y"
  3204. {sqlite3Analyze(pParse, &yymsp[-1].minor.yy410, &yymsp[0].minor.yy410);}
  3205. #line 3243 "parse.c"
  3206. break;
  3207. case 295:
  3208. #line 1089 "parse.y"
  3209. {
  3210. sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy373,&yymsp[0].minor.yy410);
  3211. }
  3212. #line 3250 "parse.c"
  3213. break;
  3214. case 296:
  3215. #line 1092 "parse.y"
  3216. {
  3217. sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy410);
  3218. }
  3219. #line 3257 "parse.c"
  3220. break;
  3221. case 297:
  3222. #line 1095 "parse.y"
  3223. {
  3224. sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy373);
  3225. }
  3226. #line 3264 "parse.c"
  3227. break;
  3228. case 300:
  3229. #line 1104 "parse.y"
  3230. {sqlite3VtabFinishParse(pParse,0);}
  3231. #line 3269 "parse.c"
  3232. break;
  3233. case 301:
  3234. #line 1105 "parse.y"
  3235. {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
  3236. #line 3274 "parse.c"
  3237. break;
  3238. case 302:
  3239. #line 1106 "parse.y"
  3240. {
  3241. sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy410, &yymsp[-2].minor.yy410, &yymsp[0].minor.yy410);
  3242. }
  3243. #line 3281 "parse.c"
  3244. break;
  3245. case 305:
  3246. #line 1111 "parse.y"
  3247. {sqlite3VtabArgInit(pParse);}
  3248. #line 3286 "parse.c"
  3249. break;
  3250. case 307:
  3251. case 308:
  3252. case 309:
  3253. case 311:
  3254. #line 1113 "parse.y"
  3255. {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
  3256. #line 3294 "parse.c"
  3257. break;
  3258. };
  3259. yygoto = yyRuleInfo[yyruleno].lhs;
  3260. yysize = yyRuleInfo[yyruleno].nrhs;
  3261. yypParser->yyidx -= yysize;
  3262. yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto);
  3263. if( yyact < YYNSTATE ){
  3264. #ifdef NDEBUG
  3265. /* If we are not debugging and the reduce action popped at least
  3266. ** one element off the stack, then we can push the new element back
  3267. ** onto the stack here, and skip the stack overflow test in yy_shift().
  3268. ** That gives a significant speed improvement. */
  3269. if( yysize ){
  3270. yypParser->yyidx++;
  3271. yymsp -= yysize-1;
  3272. yymsp->stateno = yyact;
  3273. yymsp->major = yygoto;
  3274. yymsp->minor = yygotominor;
  3275. }else
  3276. #endif
  3277. {
  3278. yy_shift(yypParser,yyact,yygoto,&yygotominor);
  3279. }
  3280. }else if( yyact == YYNSTATE + YYNRULE + 1 ){
  3281. yy_accept(yypParser);
  3282. }
  3283. }
  3284. /*
  3285. ** The following code executes when the parse fails
  3286. */
  3287. static void yy_parse_failed(
  3288. yyParser *yypParser /* The parser */
  3289. ){
  3290. sqlite3ParserARG_FETCH;
  3291. #ifndef NDEBUG
  3292. if( yyTraceFILE ){
  3293. fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
  3294. }
  3295. #endif
  3296. while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  3297. /* Here code is inserted which will be executed whenever the
  3298. ** parser fails */
  3299. sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
  3300. }
  3301. /*
  3302. ** The following code executes when a syntax error first occurs.
  3303. */
  3304. static void yy_syntax_error(
  3305. yyParser *yypParser, /* The parser */
  3306. int yymajor, /* The major type of the error token */
  3307. YYMINORTYPE yyminor /* The minor type of the error token */
  3308. ){
  3309. sqlite3ParserARG_FETCH;
  3310. #define TOKEN (yyminor.yy0)
  3311. #line 34 "parse.y"
  3312. if( !pParse->parseError ){
  3313. if( TOKEN.z[0] ){
  3314. sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
  3315. }else{
  3316. sqlite3ErrorMsg(pParse, "incomplete SQL statement");
  3317. }
  3318. pParse->parseError = 1;
  3319. }
  3320. #line 3362 "parse.c"
  3321. sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
  3322. }
  3323. /*
  3324. ** The following is executed when the parser accepts
  3325. */
  3326. static void yy_accept(
  3327. yyParser *yypParser /* The parser */
  3328. ){
  3329. sqlite3ParserARG_FETCH;
  3330. #ifndef NDEBUG
  3331. if( yyTraceFILE ){
  3332. fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
  3333. }
  3334. #endif
  3335. while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  3336. /* Here code is inserted which will be executed whenever the
  3337. ** parser accepts */
  3338. sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
  3339. }
  3340. /* The main parser program.
  3341. ** The first argument is a pointer to a structure obtained from
  3342. ** "sqlite3ParserAlloc" which describes the current state of the parser.
  3343. ** The second argument is the major token number. The third is
  3344. ** the minor token. The fourth optional argument is whatever the
  3345. ** user wants (and specified in the grammar) and is available for
  3346. ** use by the action routines.
  3347. **
  3348. ** Inputs:
  3349. ** <ul>
  3350. ** <li> A pointer to the parser (an opaque structure.)
  3351. ** <li> The major token number.
  3352. ** <li> The minor token number.
  3353. ** <li> An option argument of a grammar-specified type.
  3354. ** </ul>
  3355. **
  3356. ** Outputs:
  3357. ** None.
  3358. */
  3359. void sqlite3Parser(
  3360. void *yyp, /* The parser */
  3361. int yymajor, /* The major token code number */
  3362. sqlite3ParserTOKENTYPE yyminor /* The value for the token */
  3363. sqlite3ParserARG_PDECL /* Optional %extra_argument parameter */
  3364. ){
  3365. YYMINORTYPE yyminorunion;
  3366. int yyact; /* The parser action. */
  3367. int yyendofinput; /* True if we are at the end of input */
  3368. int yyerrorhit = 0; /* True if yymajor has invoked an error */
  3369. yyParser *yypParser; /* The parser */
  3370. /* (re)initialize the parser, if necessary */
  3371. yypParser = (yyParser*)yyp;
  3372. if( yypParser->yyidx<0 ){
  3373. #if YYSTACKDEPTH<=0
  3374. if( yypParser->yystksz <=0 ){
  3375. memset(&yyminorunion, 0, sizeof(yyminorunion));
  3376. yyStackOverflow(yypParser, &yyminorunion);
  3377. return;
  3378. }
  3379. #endif
  3380. yypParser->yyidx = 0;
  3381. yypParser->yyerrcnt = -1;
  3382. yypParser->yystack[0].stateno = 0;
  3383. yypParser->yystack[0].major = 0;
  3384. }
  3385. yyminorunion.yy0 = yyminor;
  3386. yyendofinput = (yymajor==0);
  3387. sqlite3ParserARG_STORE;
  3388. #ifndef NDEBUG
  3389. if( yyTraceFILE ){
  3390. fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
  3391. }
  3392. #endif
  3393. do{
  3394. yyact = yy_find_shift_action(yypParser,yymajor);
  3395. if( yyact<YYNSTATE ){
  3396. yy_shift(yypParser,yyact,yymajor,&yyminorunion);
  3397. yypParser->yyerrcnt--;
  3398. if( yyendofinput && yypParser->yyidx>=0 ){
  3399. yymajor = 0;
  3400. }else{
  3401. yymajor = YYNOCODE;
  3402. }
  3403. }else if( yyact < YYNSTATE + YYNRULE ){
  3404. yy_reduce(yypParser,yyact-YYNSTATE);
  3405. }else if( yyact == YY_ERROR_ACTION ){
  3406. int yymx;
  3407. #ifndef NDEBUG
  3408. if( yyTraceFILE ){
  3409. fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
  3410. }
  3411. #endif
  3412. #ifdef YYERRORSYMBOL
  3413. /* A syntax error has occurred.
  3414. ** The response to an error depends upon whether or not the
  3415. ** grammar defines an error token "ERROR".
  3416. **
  3417. ** This is what we do if the grammar does define ERROR:
  3418. **
  3419. ** * Call the %syntax_error function.
  3420. **
  3421. ** * Begin popping the stack until we enter a state where
  3422. ** it is legal to shift the error symbol, then shift
  3423. ** the error symbol.
  3424. **
  3425. ** * Set the error count to three.
  3426. **
  3427. ** * Begin accepting and shifting new tokens. No new error
  3428. ** processing will occur until three tokens have been
  3429. ** shifted successfully.
  3430. **
  3431. */
  3432. if( yypParser->yyerrcnt<0 ){
  3433. yy_syntax_error(yypParser,yymajor,yyminorunion);
  3434. }
  3435. yymx = yypParser->yystack[yypParser->yyidx].major;
  3436. if( yymx==YYERRORSYMBOL || yyerrorhit ){
  3437. #ifndef NDEBUG
  3438. if( yyTraceFILE ){
  3439. fprintf(yyTraceFILE,"%sDiscard input token %s\n",
  3440. yyTracePrompt,yyTokenName[yymajor]);
  3441. }
  3442. #endif
  3443. yy_destructor(yymajor,&yyminorunion);
  3444. yymajor = YYNOCODE;
  3445. }else{
  3446. while(
  3447. yypParser->yyidx >= 0 &&
  3448. yymx != YYERRORSYMBOL &&
  3449. (yyact = yy_find_reduce_action(
  3450. yypParser->yystack[yypParser->yyidx].stateno,
  3451. YYERRORSYMBOL)) >= YYNSTATE
  3452. ){
  3453. yy_pop_parser_stack(yypParser);
  3454. }
  3455. if( yypParser->yyidx < 0 || yymajor==0 ){
  3456. yy_destructor(yymajor,&yyminorunion);
  3457. yy_parse_failed(yypParser);
  3458. yymajor = YYNOCODE;
  3459. }else if( yymx!=YYERRORSYMBOL ){
  3460. YYMINORTYPE u2;
  3461. u2.YYERRSYMDT = 0;
  3462. yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
  3463. }
  3464. }
  3465. yypParser->yyerrcnt = 3;
  3466. yyerrorhit = 1;
  3467. #else /* YYERRORSYMBOL is not defined */
  3468. /* This is what we do if the grammar does not define ERROR:
  3469. **
  3470. ** * Report an error message, and throw away the input token.
  3471. **
  3472. ** * If the input token is $, then fail the parse.
  3473. **
  3474. ** As before, subsequent error messages are suppressed until
  3475. ** three input tokens have been successfully shifted.
  3476. */
  3477. if( yypParser->yyerrcnt<=0 ){
  3478. yy_syntax_error(yypParser,yymajor,yyminorunion);
  3479. }
  3480. yypParser->yyerrcnt = 3;
  3481. yy_destructor(yymajor,&yyminorunion);
  3482. if( yyendofinput ){
  3483. yy_parse_failed(yypParser);
  3484. }
  3485. yymajor = YYNOCODE;
  3486. #endif
  3487. }else{
  3488. yy_accept(yypParser);
  3489. yymajor = YYNOCODE;
  3490. }
  3491. }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
  3492. return;
  3493. }