ast_expr2f.c 82 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648
  1. #line 2 "ast_expr2f.c"
  2. #line 4 "ast_expr2f.c"
  3. #define YY_INT_ALIGNED short int
  4. /* A lexical scanner generated by flex */
  5. #define FLEX_SCANNER
  6. #define YY_FLEX_MAJOR_VERSION 2
  7. #define YY_FLEX_MINOR_VERSION 5
  8. #define YY_FLEX_SUBMINOR_VERSION 31
  9. #if YY_FLEX_SUBMINOR_VERSION > 0
  10. #define FLEX_BETA
  11. #endif
  12. /* First, we deal with platform-specific or compiler-specific issues. */
  13. /* begin standard C headers. */
  14. #include <stdio.h>
  15. #include <string.h>
  16. #include <errno.h>
  17. #include <stdlib.h>
  18. /* end standard C headers. */
  19. /* flex integer type definitions */
  20. #ifndef FLEXINT_H
  21. #define FLEXINT_H
  22. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  23. #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
  24. #include <inttypes.h>
  25. typedef int8_t flex_int8_t;
  26. typedef uint8_t flex_uint8_t;
  27. typedef int16_t flex_int16_t;
  28. typedef uint16_t flex_uint16_t;
  29. typedef int32_t flex_int32_t;
  30. typedef uint32_t flex_uint32_t;
  31. #else
  32. typedef signed char flex_int8_t;
  33. typedef short int flex_int16_t;
  34. typedef int flex_int32_t;
  35. typedef unsigned char flex_uint8_t;
  36. typedef unsigned short int flex_uint16_t;
  37. typedef unsigned int flex_uint32_t;
  38. #endif /* ! C99 */
  39. /* Limits of integral types. */
  40. #ifndef INT8_MIN
  41. #define INT8_MIN (-128)
  42. #endif
  43. #ifndef INT16_MIN
  44. #define INT16_MIN (-32767-1)
  45. #endif
  46. #ifndef INT32_MIN
  47. #define INT32_MIN (-2147483647-1)
  48. #endif
  49. #ifndef INT8_MAX
  50. #define INT8_MAX (127)
  51. #endif
  52. #ifndef INT16_MAX
  53. #define INT16_MAX (32767)
  54. #endif
  55. #ifndef INT32_MAX
  56. #define INT32_MAX (2147483647)
  57. #endif
  58. #ifndef UINT8_MAX
  59. #define UINT8_MAX (255U)
  60. #endif
  61. #ifndef UINT16_MAX
  62. #define UINT16_MAX (65535U)
  63. #endif
  64. #ifndef UINT32_MAX
  65. #define UINT32_MAX (4294967295U)
  66. #endif
  67. #endif /* ! FLEXINT_H */
  68. #ifdef __cplusplus
  69. /* The "const" storage-class-modifier is valid. */
  70. #define YY_USE_CONST
  71. #else /* ! __cplusplus */
  72. #if __STDC__
  73. #define YY_USE_CONST
  74. #endif /* __STDC__ */
  75. #endif /* ! __cplusplus */
  76. #ifdef YY_USE_CONST
  77. #define yyconst const
  78. #else
  79. #define yyconst
  80. #endif
  81. /* Returned upon end-of-file. */
  82. #define YY_NULL 0
  83. /* Promotes a possibly negative, possibly signed char to an unsigned
  84. * integer for use as an array index. If the signed char is negative,
  85. * we want to instead treat it as an 8-bit unsigned char, hence the
  86. * double cast.
  87. */
  88. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  89. /* An opaque pointer. */
  90. #ifndef YY_TYPEDEF_YY_SCANNER_T
  91. #define YY_TYPEDEF_YY_SCANNER_T
  92. typedef void* yyscan_t;
  93. #endif
  94. /* For convenience, these vars (plus the bison vars far below)
  95. are macros in the reentrant scanner. */
  96. #define yyin yyg->yyin_r
  97. #define yyout yyg->yyout_r
  98. #define yyextra yyg->yyextra_r
  99. #define yyleng yyg->yyleng_r
  100. #define yytext yyg->yytext_r
  101. #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
  102. #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
  103. #define yy_flex_debug yyg->yy_flex_debug_r
  104. int ast_yylex_init (yyscan_t* scanner);
  105. /* Enter a start condition. This macro really ought to take a parameter,
  106. * but we do it the disgusting crufty way forced on us by the ()-less
  107. * definition of BEGIN.
  108. */
  109. #define BEGIN yyg->yy_start = 1 + 2 *
  110. /* Translate the current start state into a value that can be later handed
  111. * to BEGIN to return to the state. The YYSTATE alias is for lex
  112. * compatibility.
  113. */
  114. #define YY_START ((yyg->yy_start - 1) / 2)
  115. #define YYSTATE YY_START
  116. /* Action number for EOF rule of a given start state. */
  117. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  118. /* Special action meaning "start processing a new file". */
  119. #define YY_NEW_FILE ast_yyrestart(yyin ,yyscanner )
  120. #define YY_END_OF_BUFFER_CHAR 0
  121. /* Size of default input buffer. */
  122. #ifndef YY_BUF_SIZE
  123. #define YY_BUF_SIZE 16384
  124. #endif
  125. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  126. #define YY_TYPEDEF_YY_BUFFER_STATE
  127. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  128. #endif
  129. #define EOB_ACT_CONTINUE_SCAN 0
  130. #define EOB_ACT_END_OF_FILE 1
  131. #define EOB_ACT_LAST_MATCH 2
  132. #define YY_LESS_LINENO(n)
  133. /* Return all but the first "n" matched characters back to the input stream. */
  134. #define yyless(n) \
  135. do \
  136. { \
  137. /* Undo effects of setting up yytext. */ \
  138. int yyless_macro_arg = (n); \
  139. YY_LESS_LINENO(yyless_macro_arg);\
  140. *yy_cp = yyg->yy_hold_char; \
  141. YY_RESTORE_YY_MORE_OFFSET \
  142. yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  143. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  144. } \
  145. while ( 0 )
  146. #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
  147. /* The following is because we cannot portably get our hands on size_t
  148. * (without autoconf's help, which isn't available because we want
  149. * flex-generated scanners to compile on their own).
  150. */
  151. #ifndef YY_TYPEDEF_YY_SIZE_T
  152. #define YY_TYPEDEF_YY_SIZE_T
  153. typedef unsigned int yy_size_t;
  154. #endif
  155. #ifndef YY_STRUCT_YY_BUFFER_STATE
  156. #define YY_STRUCT_YY_BUFFER_STATE
  157. struct yy_buffer_state
  158. {
  159. FILE *yy_input_file;
  160. char *yy_ch_buf; /* input buffer */
  161. char *yy_buf_pos; /* current position in input buffer */
  162. /* Size of input buffer in bytes, not including room for EOB
  163. * characters.
  164. */
  165. yy_size_t yy_buf_size;
  166. /* Number of characters read into yy_ch_buf, not including EOB
  167. * characters.
  168. */
  169. int yy_n_chars;
  170. /* Whether we "own" the buffer - i.e., we know we created it,
  171. * and can realloc() it to grow it, and should free() it to
  172. * delete it.
  173. */
  174. int yy_is_our_buffer;
  175. /* Whether this is an "interactive" input source; if so, and
  176. * if we're using stdio for input, then we want to use getc()
  177. * instead of fread(), to make sure we stop fetching input after
  178. * each newline.
  179. */
  180. int yy_is_interactive;
  181. /* Whether we're considered to be at the beginning of a line.
  182. * If so, '^' rules will be active on the next match, otherwise
  183. * not.
  184. */
  185. int yy_at_bol;
  186. int yy_bs_lineno; /**< The line count. */
  187. int yy_bs_column; /**< The column count. */
  188. /* Whether to try to fill the input buffer when we reach the
  189. * end of it.
  190. */
  191. int yy_fill_buffer;
  192. int yy_buffer_status;
  193. #define YY_BUFFER_NEW 0
  194. #define YY_BUFFER_NORMAL 1
  195. /* When an EOF's been seen but there's still some text to process
  196. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  197. * shouldn't try reading from the input source any more. We might
  198. * still have a bunch of tokens to match, though, because of
  199. * possible backing-up.
  200. *
  201. * When we actually see the EOF, we change the status to "new"
  202. * (via ast_yyrestart()), so that the user can continue scanning by
  203. * just pointing yyin at a new input file.
  204. */
  205. #define YY_BUFFER_EOF_PENDING 2
  206. };
  207. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  208. /* We provide macros for accessing buffer states in case in the
  209. * future we want to put the buffer states in a more general
  210. * "scanner state".
  211. *
  212. * Returns the top of the stack, or NULL.
  213. */
  214. #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
  215. ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
  216. : NULL)
  217. /* Same as previous macro, but useful when we know that the buffer stack is not
  218. * NULL or when we need an lvalue. For internal use only.
  219. */
  220. #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
  221. void ast_yyrestart (FILE *input_file ,yyscan_t yyscanner );
  222. void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
  223. YY_BUFFER_STATE ast_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
  224. void ast_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
  225. void ast_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
  226. void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
  227. void ast_yypop_buffer_state (yyscan_t yyscanner );
  228. static void ast_yyensure_buffer_stack (yyscan_t yyscanner );
  229. static void ast_yy_load_buffer_state (yyscan_t yyscanner );
  230. static void ast_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
  231. #define YY_FLUSH_BUFFER ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
  232. YY_BUFFER_STATE ast_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
  233. YY_BUFFER_STATE ast_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
  234. YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
  235. void *ast_yyalloc (yy_size_t ,yyscan_t yyscanner );
  236. void *ast_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
  237. void ast_yyfree (void * ,yyscan_t yyscanner );
  238. #define yy_new_buffer ast_yy_create_buffer
  239. #define yy_set_interactive(is_interactive) \
  240. { \
  241. if ( ! YY_CURRENT_BUFFER ){ \
  242. ast_yyensure_buffer_stack (yyscanner); \
  243. YY_CURRENT_BUFFER_LVALUE = \
  244. ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  245. } \
  246. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  247. }
  248. #define yy_set_bol(at_bol) \
  249. { \
  250. if ( ! YY_CURRENT_BUFFER ){\
  251. ast_yyensure_buffer_stack (yyscanner); \
  252. YY_CURRENT_BUFFER_LVALUE = \
  253. ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  254. } \
  255. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  256. }
  257. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  258. /* Begin user sect3 */
  259. #define ast_yywrap(n) 1
  260. #define YY_SKIP_YYWRAP
  261. typedef char YY_CHAR;
  262. typedef int yy_state_type;
  263. #define yytext_ptr yytext_r
  264. static yyconst flex_int16_t yy_nxt[][128] =
  265. {
  266. {
  267. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  268. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  269. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  270. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  271. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  272. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  273. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  274. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  275. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  276. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  277. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  278. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  279. 0, 0, 0, 0, 0, 0, 0, 0
  280. },
  281. {
  282. 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,
  283. 6, 4, 4, 5, 4, 4, 4, 4, 4, 4,
  284. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  285. 4, 4, 5, 7, 8, 9, 9, 10, 11, 9,
  286. 12, 13, 14, 15, 9, 16, 9, 17, 18, 18,
  287. 18, 18, 18, 18, 18, 18, 18, 18, 19, 9,
  288. 20, 21, 22, 23, 9, 9, 9, 9, 9, 9,
  289. 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  290. 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  291. 9, 4, 9, 4, 9, 9, 4, 9, 9, 9,
  292. 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  293. 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  294. 9, 9, 9, 9, 24, 9, 4, 4
  295. },
  296. {
  297. 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,
  298. 6, 4, 4, 5, 4, 4, 4, 4, 4, 4,
  299. 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  300. 4, 4, 5, 7, 8, 9, 9, 10, 11, 9,
  301. 12, 13, 14, 15, 9, 16, 9, 17, 18, 18,
  302. 18, 18, 18, 18, 18, 18, 18, 18, 19, 9,
  303. 20, 21, 22, 23, 9, 9, 9, 9, 9, 9,
  304. 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  305. 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  306. 9, 4, 9, 4, 9, 9, 4, 9, 9, 9,
  307. 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  308. 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
  309. 9, 9, 9, 9, 24, 9, 4, 4
  310. },
  311. {
  312. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  313. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  314. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  315. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  316. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  317. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  318. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  319. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  320. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  321. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  322. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  323. -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
  324. -3, -3, -3, -3, -3, -3, -3, -3
  325. },
  326. {
  327. 3, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  328. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  329. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  330. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  331. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  332. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  333. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  334. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  335. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  336. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  337. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  338. -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
  339. -4, -4, -4, -4, -4, -4, -4, -4
  340. },
  341. {
  342. 3, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  343. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  344. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  345. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  346. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  347. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  348. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  349. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  350. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  351. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  352. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  353. -5, -5, -5, -5, -5, -5, -5, -5, -5, -5,
  354. -5, -5, -5, -5, -5, -5, -5, -5
  355. },
  356. {
  357. 3, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  358. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  359. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  360. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  361. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  362. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  363. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  364. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  365. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  366. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  367. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  368. -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
  369. -6, -6, -6, -6, -6, -6, -6, -6
  370. },
  371. {
  372. 3, -7, -7, -7, -7, -7, -7, -7, -7, -7,
  373. -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
  374. -7, -7, -7, -7, -7, -7, -7, -7, -7, -7,
  375. -7, -7, -7, 25, -7, 25, 25, 25, -7, 25,
  376. -7, -7, -7, -7, 25, -7, 25, -7, 25, 25,
  377. 25, 25, 25, 25, 25, 25, 25, 25, -7, 25,
  378. -7, 26, -7, -7, 25, 25, 25, 25, 25, 25,
  379. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  380. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  381. 25, -7, 25, -7, 25, 25, -7, 25, 25, 25,
  382. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  383. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  384. 25, 25, 25, 25, -7, 25, -7, -7
  385. },
  386. {
  387. 3, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  388. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  389. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  390. 27, 27, 27, 27, 28, 27, 27, 27, 27, 27,
  391. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  392. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  393. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  394. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  395. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  396. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  397. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  398. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  399. 27, 27, 27, 27, 27, 27, 27, 27
  400. },
  401. {
  402. 3, -9, -9, -9, -9, -9, -9, -9, -9, -9,
  403. -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
  404. -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
  405. -9, -9, -9, 25, -9, 25, 25, 25, -9, 25,
  406. -9, -9, -9, -9, 25, -9, 25, -9, 25, 25,
  407. 25, 25, 25, 25, 25, 25, 25, 25, -9, 25,
  408. -9, -9, -9, -9, 25, 25, 25, 25, 25, 25,
  409. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  410. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  411. 25, -9, 25, -9, 25, 25, -9, 25, 25, 25,
  412. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  413. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  414. 25, 25, 25, 25, -9, 25, -9, -9
  415. },
  416. {
  417. 3, -10, -10, -10, -10, -10, -10, -10, -10, -10,
  418. -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
  419. -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
  420. -10, -10, -10, 25, -10, 25, 25, 25, -10, 25,
  421. -10, -10, -10, -10, 25, -10, 25, -10, 25, 25,
  422. 25, 25, 25, 25, 25, 25, 25, 25, -10, 25,
  423. -10, -10, -10, -10, 25, 25, 25, 25, 25, 25,
  424. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  425. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  426. 25, -10, 25, -10, 25, 25, -10, 25, 25, 25,
  427. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  428. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  429. 25, 25, 25, 25, -10, 25, -10, -10
  430. },
  431. {
  432. 3, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  433. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  434. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  435. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  436. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  437. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  438. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  439. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  440. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  441. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  442. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  443. -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
  444. -11, -11, -11, -11, -11, -11, -11, -11
  445. },
  446. {
  447. 3, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  448. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  449. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  450. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  451. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  452. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  453. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  454. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  455. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  456. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  457. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  458. -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
  459. -12, -12, -12, -12, -12, -12, -12, -12
  460. },
  461. {
  462. 3, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  463. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  464. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  465. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  466. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  467. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  468. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  469. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  470. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  471. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  472. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  473. -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
  474. -13, -13, -13, -13, -13, -13, -13, -13
  475. },
  476. {
  477. 3, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  478. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  479. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  480. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  481. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  482. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  483. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  484. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  485. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  486. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  487. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  488. -14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
  489. -14, -14, -14, -14, -14, -14, -14, -14
  490. },
  491. {
  492. 3, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  493. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  494. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  495. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  496. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  497. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  498. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  499. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  500. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  501. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  502. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  503. -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
  504. -15, -15, -15, -15, -15, -15, -15, -15
  505. },
  506. {
  507. 3, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  508. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  509. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  510. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  511. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  512. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  513. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  514. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  515. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  516. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  517. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  518. -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
  519. -16, -16, -16, -16, -16, -16, -16, -16
  520. },
  521. {
  522. 3, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  523. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  524. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  525. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  526. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  527. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  528. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  529. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  530. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  531. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  532. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  533. -17, -17, -17, -17, -17, -17, -17, -17, -17, -17,
  534. -17, -17, -17, -17, -17, -17, -17, -17
  535. },
  536. {
  537. 3, -18, -18, -18, -18, -18, -18, -18, -18, -18,
  538. -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
  539. -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
  540. -18, -18, -18, 25, -18, 25, 25, 25, -18, 25,
  541. -18, -18, -18, -18, 25, -18, 25, -18, 29, 29,
  542. 29, 29, 29, 29, 29, 29, 29, 29, -18, 25,
  543. -18, -18, -18, -18, 25, 25, 25, 25, 25, 25,
  544. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  545. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  546. 25, -18, 25, -18, 25, 25, -18, 25, 25, 25,
  547. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  548. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  549. 25, 25, 25, 25, -18, 25, -18, -18
  550. },
  551. {
  552. 3, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  553. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  554. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  555. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  556. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  557. -19, -19, -19, -19, -19, -19, -19, -19, 30, -19,
  558. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  559. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  560. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  561. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  562. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  563. -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,
  564. -19, -19, -19, -19, -19, -19, -19, -19
  565. },
  566. {
  567. 3, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  568. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  569. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  570. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  571. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  572. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  573. -20, 31, -20, -20, -20, -20, -20, -20, -20, -20,
  574. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  575. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  576. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  577. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  578. -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,
  579. -20, -20, -20, -20, -20, -20, -20, -20
  580. },
  581. {
  582. 3, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  583. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  584. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  585. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  586. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  587. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  588. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  589. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  590. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  591. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  592. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  593. -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
  594. -21, -21, -21, -21, -21, -21, -21, -21
  595. },
  596. {
  597. 3, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  598. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  599. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  600. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  601. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  602. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  603. -22, 32, -22, -22, -22, -22, -22, -22, -22, -22,
  604. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  605. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  606. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  607. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  608. -22, -22, -22, -22, -22, -22, -22, -22, -22, -22,
  609. -22, -22, -22, -22, -22, -22, -22, -22
  610. },
  611. {
  612. 3, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  613. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  614. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  615. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  616. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  617. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  618. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  619. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  620. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  621. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  622. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  623. -23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
  624. -23, -23, -23, -23, -23, -23, -23, -23
  625. },
  626. {
  627. 3, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  628. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  629. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  630. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  631. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  632. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  633. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  634. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  635. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  636. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  637. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  638. -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
  639. -24, -24, -24, -24, -24, -24, -24, -24
  640. },
  641. {
  642. 3, -25, -25, -25, -25, -25, -25, -25, -25, -25,
  643. -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
  644. -25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
  645. -25, -25, -25, 25, -25, 25, 25, 25, -25, 25,
  646. -25, -25, -25, -25, 25, -25, 25, -25, 25, 25,
  647. 25, 25, 25, 25, 25, 25, 25, 25, -25, 25,
  648. -25, -25, -25, -25, 25, 25, 25, 25, 25, 25,
  649. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  650. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  651. 25, -25, 25, -25, 25, 25, -25, 25, 25, 25,
  652. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  653. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  654. 25, 25, 25, 25, -25, 25, -25, -25
  655. },
  656. {
  657. 3, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  658. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  659. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  660. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  661. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  662. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  663. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  664. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  665. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  666. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  667. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  668. -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
  669. -26, -26, -26, -26, -26, -26, -26, -26
  670. },
  671. {
  672. 3, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  673. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  674. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  675. 27, 27, 27, 27, 28, 27, 27, 27, 27, 27,
  676. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  677. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  678. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  679. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  680. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  681. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  682. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  683. 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
  684. 27, 27, 27, 27, 27, 27, 27, 27
  685. },
  686. {
  687. 3, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  688. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  689. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  690. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  691. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  692. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  693. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  694. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  695. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  696. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  697. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  698. -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,
  699. -28, -28, -28, -28, -28, -28, -28, -28
  700. },
  701. {
  702. 3, -29, -29, -29, -29, -29, -29, -29, -29, -29,
  703. -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
  704. -29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
  705. -29, -29, -29, 25, -29, 25, 25, 25, -29, 25,
  706. -29, -29, -29, -29, 25, -29, 25, -29, 29, 29,
  707. 29, 29, 29, 29, 29, 29, 29, 29, -29, 25,
  708. -29, -29, -29, -29, 25, 25, 25, 25, 25, 25,
  709. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  710. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  711. 25, -29, 25, -29, 25, 25, -29, 25, 25, 25,
  712. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  713. 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
  714. 25, 25, 25, 25, -29, 25, -29, -29
  715. },
  716. {
  717. 3, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  718. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  719. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  720. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  721. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  722. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  723. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  724. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  725. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  726. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  727. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  728. -30, -30, -30, -30, -30, -30, -30, -30, -30, -30,
  729. -30, -30, -30, -30, -30, -30, -30, -30
  730. },
  731. {
  732. 3, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  733. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  734. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  735. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  736. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  737. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  738. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  739. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  740. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  741. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  742. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  743. -31, -31, -31, -31, -31, -31, -31, -31, -31, -31,
  744. -31, -31, -31, -31, -31, -31, -31, -31
  745. },
  746. {
  747. 3, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  748. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  749. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  750. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  751. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  752. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  753. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  754. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  755. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  756. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  757. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  758. -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
  759. -32, -32, -32, -32, -32, -32, -32, -32
  760. },
  761. } ;
  762. static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
  763. static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
  764. static int yy_get_next_buffer (yyscan_t yyscanner );
  765. static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
  766. /* Done after the current pattern has been matched and before the
  767. * corresponding action - sets up yytext.
  768. */
  769. #define YY_DO_BEFORE_ACTION \
  770. yyg->yytext_ptr = yy_bp; \
  771. yyleng = (size_t) (yy_cp - yy_bp); \
  772. yyg->yy_hold_char = *yy_cp; \
  773. *yy_cp = '\0'; \
  774. yyg->yy_c_buf_p = yy_cp;
  775. #define YY_NUM_RULES 24
  776. #define YY_END_OF_BUFFER 25
  777. /* This struct is not used in this scanner,
  778. but its presence is necessary. */
  779. struct yy_trans_info
  780. {
  781. flex_int32_t yy_verify;
  782. flex_int32_t yy_nxt;
  783. };
  784. static yyconst flex_int16_t yy_accept[33] =
  785. { 0,
  786. 0, 0, 25, 24, 19, 21, 23, 24, 23, 13,
  787. 2, 17, 18, 11, 9, 10, 12, 22, 15, 5,
  788. 3, 4, 14, 1, 23, 8, 0, 20, 22, 16,
  789. 7, 6
  790. } ;
  791. static yyconst yy_state_type yy_NUL_trans[33] =
  792. { 0,
  793. 4, 4, 0, 0, 0, 0, 0, 27, 0, 0,
  794. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  795. 0, 0, 0, 0, 0, 0, 27, 0, 0, 0,
  796. 0, 0
  797. } ;
  798. /* The intent behind this definition is that it'll catch
  799. * any uses of REJECT which flex missed.
  800. */
  801. #define REJECT reject_used_but_not_detected
  802. #define yymore() yymore_used_but_not_detected
  803. #define YY_MORE_ADJ 0
  804. #define YY_RESTORE_YY_MORE_OFFSET
  805. #line 1 "ast_expr2.fl"
  806. #line 2 "ast_expr2.fl"
  807. #include <sys/types.h>
  808. #include <stdio.h>
  809. #include <stdlib.h>
  810. #include <string.h>
  811. #include <locale.h>
  812. #include <ctype.h>
  813. #if !defined(SOLARIS) && !defined(__CYGWIN__)
  814. #include <err.h>
  815. #else
  816. #define quad_t int64_t
  817. #endif
  818. #include <errno.h>
  819. #include <regex.h>
  820. #include <limits.h>
  821. #include <asterisk/ast_expr.h>
  822. #include <asterisk/logger.h>
  823. #include <asterisk/strings.h>
  824. enum valtype {
  825. AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string
  826. } ;
  827. struct val {
  828. enum valtype type;
  829. union {
  830. char *s;
  831. quad_t i;
  832. } u;
  833. } ;
  834. #include "ast_expr2.h" /* the o/p of the bison on ast_expr2.y */
  835. #define SET_COLUMNS yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);yylloc_param->last_column = yylloc_param->last_column + yyleng - 1; yylloc_param->first_line = yylloc_param->last_line = 1
  836. #define SET_STRING yylval_param->val = (struct val *)calloc(sizeof(struct val),1); yylval_param->val->type = AST_EXPR_string; yylval_param->val->u.s = strdup(yytext);
  837. #define SET_NUMERIC_STRING yylval_param->val = (struct val *)calloc(sizeof(struct val),1); yylval_param->val->type = AST_EXPR_numeric_string; yylval_param->val->u.s = strdup(yytext);
  838. struct parse_io
  839. {
  840. char *string;
  841. struct val *val;
  842. yyscan_t scanner;
  843. };
  844. void ast_yyset_column(int column_no, yyscan_t yyscanner);
  845. int ast_yyget_column(yyscan_t yyscanner);
  846. #line 1000 "ast_expr2f.c"
  847. #define INITIAL 0
  848. #ifndef YY_NO_UNISTD_H
  849. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  850. * down here because we want the user's section 1 to have been scanned first.
  851. * The user has a chance to override it with an option.
  852. */
  853. #include <unistd.h>
  854. #endif
  855. #ifndef YY_EXTRA_TYPE
  856. #define YY_EXTRA_TYPE void *
  857. #endif
  858. /* Holds the entire state of the reentrant scanner. */
  859. struct yyguts_t
  860. {
  861. /* User-defined. Not touched by flex. */
  862. YY_EXTRA_TYPE yyextra_r;
  863. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  864. FILE *yyin_r, *yyout_r;
  865. size_t yy_buffer_stack_top; /**< index of top of stack. */
  866. size_t yy_buffer_stack_max; /**< capacity of stack. */
  867. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  868. char yy_hold_char;
  869. int yy_n_chars;
  870. int yyleng_r;
  871. char *yy_c_buf_p;
  872. int yy_init;
  873. int yy_start;
  874. int yy_did_buffer_switch_on_eof;
  875. int yy_start_stack_ptr;
  876. int yy_start_stack_depth;
  877. int *yy_start_stack;
  878. yy_state_type yy_last_accepting_state;
  879. char* yy_last_accepting_cpos;
  880. int yylineno_r;
  881. int yy_flex_debug_r;
  882. char *yytext_r;
  883. int yy_more_flag;
  884. int yy_more_len;
  885. YYSTYPE * yylval_r;
  886. YYLTYPE * yylloc_r;
  887. }; /* end struct yyguts_t */
  888. /* This must go here because YYSTYPE and YYLTYPE are included
  889. * from bison output in section 1.*/
  890. # define yylval yyg->yylval_r
  891. # define yylloc yyg->yylloc_r
  892. /* Accessor methods to globals.
  893. These are made visible to non-reentrant scanners for convenience. */
  894. int ast_yylex_destroy (yyscan_t yyscanner );
  895. int ast_yyget_debug (yyscan_t yyscanner );
  896. void ast_yyset_debug (int debug_flag ,yyscan_t yyscanner );
  897. YY_EXTRA_TYPE ast_yyget_extra (yyscan_t yyscanner );
  898. void ast_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
  899. FILE *ast_yyget_in (yyscan_t yyscanner );
  900. void ast_yyset_in (FILE * in_str ,yyscan_t yyscanner );
  901. FILE *ast_yyget_out (yyscan_t yyscanner );
  902. void ast_yyset_out (FILE * out_str ,yyscan_t yyscanner );
  903. int ast_yyget_leng (yyscan_t yyscanner );
  904. char *ast_yyget_text (yyscan_t yyscanner );
  905. int ast_yyget_lineno (yyscan_t yyscanner );
  906. void ast_yyset_lineno (int line_number ,yyscan_t yyscanner );
  907. YYSTYPE * ast_yyget_lval (yyscan_t yyscanner );
  908. void ast_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
  909. YYLTYPE *ast_yyget_lloc (yyscan_t yyscanner );
  910. void ast_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
  911. /* Macros after this point can all be overridden by user definitions in
  912. * section 1.
  913. */
  914. #ifndef YY_SKIP_YYWRAP
  915. #ifdef __cplusplus
  916. extern "C" int ast_yywrap (yyscan_t yyscanner );
  917. #else
  918. extern int ast_yywrap (yyscan_t yyscanner );
  919. #endif
  920. #endif
  921. static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
  922. #ifndef yytext_ptr
  923. static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
  924. #endif
  925. #ifdef YY_NEED_STRLEN
  926. static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
  927. #endif
  928. #ifndef YY_NO_INPUT
  929. #ifdef __cplusplus
  930. static int yyinput (yyscan_t yyscanner );
  931. #else
  932. static int input (yyscan_t yyscanner );
  933. #endif
  934. #endif
  935. /* Amount of stuff to slurp up with each read. */
  936. #ifndef YY_READ_BUF_SIZE
  937. #define YY_READ_BUF_SIZE 8192
  938. #endif
  939. /* Copy whatever the last rule matched to the standard output. */
  940. #ifndef ECHO
  941. /* This used to be an fputs(), but since the string might contain NUL's,
  942. * we now use fwrite().
  943. */
  944. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  945. #endif
  946. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  947. * is returned in "result".
  948. */
  949. #ifndef YY_INPUT
  950. #define YY_INPUT(buf,result,max_size) \
  951. errno=0; \
  952. while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  953. { \
  954. if( errno != EINTR) \
  955. { \
  956. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  957. break; \
  958. } \
  959. errno=0; \
  960. clearerr(yyin); \
  961. }\
  962. \
  963. #endif
  964. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  965. * we don't want an extra ';' after the "return" because that will cause
  966. * some compilers to complain about unreachable statements.
  967. */
  968. #ifndef yyterminate
  969. #define yyterminate() return YY_NULL
  970. #endif
  971. /* Number of entries by which start-condition stack grows. */
  972. #ifndef YY_START_STACK_INCR
  973. #define YY_START_STACK_INCR 25
  974. #endif
  975. /* Report a fatal error. */
  976. #ifndef YY_FATAL_ERROR
  977. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  978. #endif
  979. /* end tables serialization structures and prototypes */
  980. /* Default declaration of generated scanner - a define so the user can
  981. * easily add parameters.
  982. */
  983. #ifndef YY_DECL
  984. #define YY_DECL_IS_OURS 1
  985. extern int ast_yylex (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
  986. #define YY_DECL int ast_yylex (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
  987. #endif /* !YY_DECL */
  988. /* Code executed at the beginning of each rule, after yytext and yyleng
  989. * have been set up.
  990. */
  991. #ifndef YY_USER_ACTION
  992. #define YY_USER_ACTION
  993. #endif
  994. /* Code executed at the end of each rule. */
  995. #ifndef YY_BREAK
  996. #define YY_BREAK break;
  997. #endif
  998. #define YY_RULE_SETUP \
  999. YY_USER_ACTION
  1000. /** The main scanner function which does all the work.
  1001. */
  1002. YY_DECL
  1003. {
  1004. register yy_state_type yy_current_state;
  1005. register char *yy_cp, *yy_bp;
  1006. register int yy_act;
  1007. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1008. #line 58 "ast_expr2.fl"
  1009. #line 1220 "ast_expr2f.c"
  1010. yylval = yylval_param;
  1011. yylloc = yylloc_param;
  1012. if ( yyg->yy_init )
  1013. {
  1014. yyg->yy_init = 0;
  1015. #ifdef YY_USER_INIT
  1016. YY_USER_INIT;
  1017. #endif
  1018. if ( ! yyg->yy_start )
  1019. yyg->yy_start = 1; /* first start state */
  1020. if ( ! yyin )
  1021. yyin = stdin;
  1022. if ( ! yyout )
  1023. yyout = stdout;
  1024. if ( ! YY_CURRENT_BUFFER ) {
  1025. ast_yyensure_buffer_stack (yyscanner);
  1026. YY_CURRENT_BUFFER_LVALUE =
  1027. ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  1028. }
  1029. ast_yy_load_buffer_state(yyscanner );
  1030. }
  1031. while ( 1 ) /* loops until end-of-file is reached */
  1032. {
  1033. yy_cp = yyg->yy_c_buf_p;
  1034. /* Support of yytext. */
  1035. *yy_cp = yyg->yy_hold_char;
  1036. /* yy_bp points to the position in yy_ch_buf of the start of
  1037. * the current run.
  1038. */
  1039. yy_bp = yy_cp;
  1040. yy_current_state = yyg->yy_start;
  1041. yy_match:
  1042. while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 )
  1043. {
  1044. if ( yy_accept[yy_current_state] )
  1045. {
  1046. yyg->yy_last_accepting_state = yy_current_state;
  1047. yyg->yy_last_accepting_cpos = yy_cp;
  1048. }
  1049. ++yy_cp;
  1050. }
  1051. yy_current_state = -yy_current_state;
  1052. yy_find_action:
  1053. yy_act = yy_accept[yy_current_state];
  1054. YY_DO_BEFORE_ACTION;
  1055. do_action: /* This label is used only to access EOF actions. */
  1056. switch ( yy_act )
  1057. { /* beginning of action switch */
  1058. case 0: /* must back up */
  1059. /* undo the effects of YY_DO_BEFORE_ACTION */
  1060. *yy_cp = yyg->yy_hold_char;
  1061. yy_cp = yyg->yy_last_accepting_cpos + 1;
  1062. yy_current_state = yyg->yy_last_accepting_state;
  1063. goto yy_find_action;
  1064. case 1:
  1065. YY_RULE_SETUP
  1066. #line 60 "ast_expr2.fl"
  1067. { SET_COLUMNS; SET_STRING; return TOK_OR;}
  1068. YY_BREAK
  1069. case 2:
  1070. YY_RULE_SETUP
  1071. #line 61 "ast_expr2.fl"
  1072. { SET_COLUMNS; SET_STRING; return TOK_AND;}
  1073. YY_BREAK
  1074. case 3:
  1075. YY_RULE_SETUP
  1076. #line 62 "ast_expr2.fl"
  1077. { SET_COLUMNS; SET_STRING; return TOK_EQ;}
  1078. YY_BREAK
  1079. case 4:
  1080. YY_RULE_SETUP
  1081. #line 63 "ast_expr2.fl"
  1082. { SET_COLUMNS; SET_STRING; return TOK_GT;}
  1083. YY_BREAK
  1084. case 5:
  1085. YY_RULE_SETUP
  1086. #line 64 "ast_expr2.fl"
  1087. { SET_COLUMNS; SET_STRING; return TOK_LT;}
  1088. YY_BREAK
  1089. case 6:
  1090. YY_RULE_SETUP
  1091. #line 65 "ast_expr2.fl"
  1092. { SET_COLUMNS; SET_STRING; return TOK_GE;}
  1093. YY_BREAK
  1094. case 7:
  1095. YY_RULE_SETUP
  1096. #line 66 "ast_expr2.fl"
  1097. { SET_COLUMNS; SET_STRING; return TOK_LE;}
  1098. YY_BREAK
  1099. case 8:
  1100. YY_RULE_SETUP
  1101. #line 67 "ast_expr2.fl"
  1102. { SET_COLUMNS; SET_STRING; return TOK_NE;}
  1103. YY_BREAK
  1104. case 9:
  1105. YY_RULE_SETUP
  1106. #line 68 "ast_expr2.fl"
  1107. { SET_COLUMNS; SET_STRING; return TOK_PLUS;}
  1108. YY_BREAK
  1109. case 10:
  1110. YY_RULE_SETUP
  1111. #line 69 "ast_expr2.fl"
  1112. { SET_COLUMNS; SET_STRING; return TOK_MINUS;}
  1113. YY_BREAK
  1114. case 11:
  1115. YY_RULE_SETUP
  1116. #line 70 "ast_expr2.fl"
  1117. { SET_COLUMNS; SET_STRING; return TOK_MULT;}
  1118. YY_BREAK
  1119. case 12:
  1120. YY_RULE_SETUP
  1121. #line 71 "ast_expr2.fl"
  1122. { SET_COLUMNS; SET_STRING; return TOK_DIV;}
  1123. YY_BREAK
  1124. case 13:
  1125. YY_RULE_SETUP
  1126. #line 72 "ast_expr2.fl"
  1127. { SET_COLUMNS; SET_STRING; return TOK_MOD;}
  1128. YY_BREAK
  1129. case 14:
  1130. YY_RULE_SETUP
  1131. #line 73 "ast_expr2.fl"
  1132. { SET_COLUMNS; SET_STRING; return TOK_COND;}
  1133. YY_BREAK
  1134. case 15:
  1135. YY_RULE_SETUP
  1136. #line 74 "ast_expr2.fl"
  1137. { SET_COLUMNS; SET_STRING; return TOK_COLON;}
  1138. YY_BREAK
  1139. case 16:
  1140. YY_RULE_SETUP
  1141. #line 75 "ast_expr2.fl"
  1142. { SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;}
  1143. YY_BREAK
  1144. case 17:
  1145. YY_RULE_SETUP
  1146. #line 76 "ast_expr2.fl"
  1147. { SET_COLUMNS; SET_STRING; return TOK_LP;}
  1148. YY_BREAK
  1149. case 18:
  1150. YY_RULE_SETUP
  1151. #line 77 "ast_expr2.fl"
  1152. { SET_COLUMNS; SET_STRING; return TOK_RP;}
  1153. YY_BREAK
  1154. case 19:
  1155. YY_RULE_SETUP
  1156. #line 79 "ast_expr2.fl"
  1157. {}
  1158. YY_BREAK
  1159. case 20:
  1160. /* rule 20 can match eol */
  1161. YY_RULE_SETUP
  1162. #line 80 "ast_expr2.fl"
  1163. {SET_COLUMNS; SET_STRING; return TOKEN;}
  1164. YY_BREAK
  1165. case 21:
  1166. /* rule 21 can match eol */
  1167. YY_RULE_SETUP
  1168. #line 82 "ast_expr2.fl"
  1169. {/* what to do with eol */}
  1170. YY_BREAK
  1171. case 22:
  1172. YY_RULE_SETUP
  1173. #line 83 "ast_expr2.fl"
  1174. { SET_COLUMNS; /* the original behavior of the expression parser was to bring in numbers as a numeric string */
  1175. SET_NUMERIC_STRING;
  1176. return TOKEN;}
  1177. YY_BREAK
  1178. case 23:
  1179. YY_RULE_SETUP
  1180. #line 86 "ast_expr2.fl"
  1181. {SET_COLUMNS; SET_STRING; return TOKEN;}
  1182. YY_BREAK
  1183. case 24:
  1184. YY_RULE_SETUP
  1185. #line 88 "ast_expr2.fl"
  1186. ECHO;
  1187. YY_BREAK
  1188. #line 1419 "ast_expr2f.c"
  1189. case YY_STATE_EOF(INITIAL):
  1190. yyterminate();
  1191. case YY_END_OF_BUFFER:
  1192. {
  1193. /* Amount of text matched not including the EOB char. */
  1194. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  1195. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1196. *yy_cp = yyg->yy_hold_char;
  1197. YY_RESTORE_YY_MORE_OFFSET
  1198. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  1199. {
  1200. /* We're scanning a new file or input source. It's
  1201. * possible that this happened because the user
  1202. * just pointed yyin at a new source and called
  1203. * ast_yylex(). If so, then we have to assure
  1204. * consistency between YY_CURRENT_BUFFER and our
  1205. * globals. Here is the right place to do so, because
  1206. * this is the first action (other than possibly a
  1207. * back-up) that will match for the new input source.
  1208. */
  1209. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1210. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  1211. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  1212. }
  1213. /* Note that here we test for yy_c_buf_p "<=" to the position
  1214. * of the first EOB in the buffer, since yy_c_buf_p will
  1215. * already have been incremented past the NUL character
  1216. * (since all states make transitions on EOB to the
  1217. * end-of-buffer state). Contrast this with the test
  1218. * in input().
  1219. */
  1220. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1221. { /* This was really a NUL. */
  1222. yy_state_type yy_next_state;
  1223. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  1224. yy_current_state = yy_get_previous_state( yyscanner );
  1225. /* Okay, we're now positioned to make the NUL
  1226. * transition. We couldn't have
  1227. * yy_get_previous_state() go ahead and do it
  1228. * for us because it doesn't know how to deal
  1229. * with the possibility of jamming (and we don't
  1230. * want to build jamming into it because then it
  1231. * will run more slowly).
  1232. */
  1233. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  1234. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1235. if ( yy_next_state )
  1236. {
  1237. /* Consume the NUL. */
  1238. yy_cp = ++yyg->yy_c_buf_p;
  1239. yy_current_state = yy_next_state;
  1240. goto yy_match;
  1241. }
  1242. else
  1243. {
  1244. yy_cp = yyg->yy_c_buf_p;
  1245. goto yy_find_action;
  1246. }
  1247. }
  1248. else switch ( yy_get_next_buffer( yyscanner ) )
  1249. {
  1250. case EOB_ACT_END_OF_FILE:
  1251. {
  1252. yyg->yy_did_buffer_switch_on_eof = 0;
  1253. if ( ast_yywrap(yyscanner ) )
  1254. {
  1255. /* Note: because we've taken care in
  1256. * yy_get_next_buffer() to have set up
  1257. * yytext, we can now set up
  1258. * yy_c_buf_p so that if some total
  1259. * hoser (like flex itself) wants to
  1260. * call the scanner after we return the
  1261. * YY_NULL, it'll still work - another
  1262. * YY_NULL will get returned.
  1263. */
  1264. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  1265. yy_act = YY_STATE_EOF(YY_START);
  1266. goto do_action;
  1267. }
  1268. else
  1269. {
  1270. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1271. YY_NEW_FILE;
  1272. }
  1273. break;
  1274. }
  1275. case EOB_ACT_CONTINUE_SCAN:
  1276. yyg->yy_c_buf_p =
  1277. yyg->yytext_ptr + yy_amount_of_matched_text;
  1278. yy_current_state = yy_get_previous_state( yyscanner );
  1279. yy_cp = yyg->yy_c_buf_p;
  1280. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1281. goto yy_match;
  1282. case EOB_ACT_LAST_MATCH:
  1283. yyg->yy_c_buf_p =
  1284. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  1285. yy_current_state = yy_get_previous_state( yyscanner );
  1286. yy_cp = yyg->yy_c_buf_p;
  1287. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1288. goto yy_find_action;
  1289. }
  1290. break;
  1291. }
  1292. default:
  1293. YY_FATAL_ERROR(
  1294. "fatal flex scanner internal error--no action found" );
  1295. } /* end of action switch */
  1296. } /* end of scanning one token */
  1297. } /* end of ast_yylex */
  1298. /* yy_get_next_buffer - try to read in a new buffer
  1299. *
  1300. * Returns a code representing an action:
  1301. * EOB_ACT_LAST_MATCH -
  1302. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1303. * EOB_ACT_END_OF_FILE - end of file
  1304. */
  1305. static int yy_get_next_buffer (yyscan_t yyscanner)
  1306. {
  1307. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1308. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1309. register char *source = yyg->yytext_ptr;
  1310. register int number_to_move, i;
  1311. int ret_val;
  1312. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  1313. YY_FATAL_ERROR(
  1314. "fatal flex scanner internal error--end of buffer missed" );
  1315. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1316. { /* Don't try to fill the buffer, so this is an EOF. */
  1317. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  1318. {
  1319. /* We matched a single character, the EOB, so
  1320. * treat this as a final EOF.
  1321. */
  1322. return EOB_ACT_END_OF_FILE;
  1323. }
  1324. else
  1325. {
  1326. /* We matched some text prior to the EOB, first
  1327. * process it.
  1328. */
  1329. return EOB_ACT_LAST_MATCH;
  1330. }
  1331. }
  1332. /* Try to read more data. */
  1333. /* First move last chars to start of buffer. */
  1334. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
  1335. for ( i = 0; i < number_to_move; ++i )
  1336. *(dest++) = *(source++);
  1337. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1338. /* don't do the read, it's not guaranteed to return an EOF,
  1339. * just force an EOF
  1340. */
  1341. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  1342. else
  1343. {
  1344. size_t num_to_read =
  1345. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1346. while ( num_to_read <= 0 )
  1347. { /* Not enough room in the buffer - grow it. */
  1348. /* just a shorter name for the current buffer */
  1349. YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  1350. int yy_c_buf_p_offset =
  1351. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  1352. if ( b->yy_is_our_buffer )
  1353. {
  1354. int new_size = b->yy_buf_size * 2;
  1355. if ( new_size <= 0 )
  1356. b->yy_buf_size += b->yy_buf_size / 8;
  1357. else
  1358. b->yy_buf_size *= 2;
  1359. b->yy_ch_buf = (char *)
  1360. /* Include room in for 2 EOB chars. */
  1361. ast_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
  1362. }
  1363. else
  1364. /* Can't grow it, we don't own it. */
  1365. b->yy_ch_buf = 0;
  1366. if ( ! b->yy_ch_buf )
  1367. YY_FATAL_ERROR(
  1368. "fatal error - scanner input buffer overflow" );
  1369. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1370. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  1371. number_to_move - 1;
  1372. }
  1373. if ( num_to_read > YY_READ_BUF_SIZE )
  1374. num_to_read = YY_READ_BUF_SIZE;
  1375. /* Read in more data. */
  1376. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1377. yyg->yy_n_chars, num_to_read );
  1378. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1379. }
  1380. if ( yyg->yy_n_chars == 0 )
  1381. {
  1382. if ( number_to_move == YY_MORE_ADJ )
  1383. {
  1384. ret_val = EOB_ACT_END_OF_FILE;
  1385. ast_yyrestart(yyin ,yyscanner);
  1386. }
  1387. else
  1388. {
  1389. ret_val = EOB_ACT_LAST_MATCH;
  1390. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1391. YY_BUFFER_EOF_PENDING;
  1392. }
  1393. }
  1394. else
  1395. ret_val = EOB_ACT_CONTINUE_SCAN;
  1396. yyg->yy_n_chars += number_to_move;
  1397. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1398. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1399. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1400. return ret_val;
  1401. }
  1402. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1403. static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  1404. {
  1405. register yy_state_type yy_current_state;
  1406. register char *yy_cp;
  1407. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1408. yy_current_state = yyg->yy_start;
  1409. for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  1410. {
  1411. if ( *yy_cp )
  1412. {
  1413. yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)];
  1414. }
  1415. else
  1416. yy_current_state = yy_NUL_trans[yy_current_state];
  1417. if ( yy_accept[yy_current_state] )
  1418. {
  1419. yyg->yy_last_accepting_state = yy_current_state;
  1420. yyg->yy_last_accepting_cpos = yy_cp;
  1421. }
  1422. }
  1423. return yy_current_state;
  1424. }
  1425. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1426. *
  1427. * synopsis
  1428. * next_state = yy_try_NUL_trans( current_state );
  1429. */
  1430. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
  1431. {
  1432. register int yy_is_jam;
  1433. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1434. register char *yy_cp = yyg->yy_c_buf_p;
  1435. yy_current_state = yy_NUL_trans[yy_current_state];
  1436. yy_is_jam = (yy_current_state == 0);
  1437. if ( ! yy_is_jam )
  1438. {
  1439. if ( yy_accept[yy_current_state] )
  1440. {
  1441. yyg->yy_last_accepting_state = yy_current_state;
  1442. yyg->yy_last_accepting_cpos = yy_cp;
  1443. }
  1444. }
  1445. return yy_is_jam ? 0 : yy_current_state;
  1446. }
  1447. static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
  1448. {
  1449. register char *yy_cp;
  1450. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1451. yy_cp = yyg->yy_c_buf_p;
  1452. /* undo effects of setting up yytext */
  1453. *yy_cp = yyg->yy_hold_char;
  1454. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1455. { /* need to shift things up to make room */
  1456. /* +2 for EOB chars. */
  1457. register int number_to_move = yyg->yy_n_chars + 2;
  1458. register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1459. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1460. register char *source =
  1461. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1462. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1463. *--dest = *--source;
  1464. yy_cp += (int) (dest - source);
  1465. yy_bp += (int) (dest - source);
  1466. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1467. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1468. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1469. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1470. }
  1471. *--yy_cp = (char) c;
  1472. yyg->yytext_ptr = yy_bp;
  1473. yyg->yy_hold_char = *yy_cp;
  1474. yyg->yy_c_buf_p = yy_cp;
  1475. }
  1476. #ifndef YY_NO_INPUT
  1477. #ifdef __cplusplus
  1478. static int yyinput (yyscan_t yyscanner)
  1479. #else
  1480. static int input (yyscan_t yyscanner)
  1481. #endif
  1482. {
  1483. int c;
  1484. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1485. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1486. if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1487. {
  1488. /* yy_c_buf_p now points to the character we want to return.
  1489. * If this occurs *before* the EOB characters, then it's a
  1490. * valid NUL; if not, then we've hit the end of the buffer.
  1491. */
  1492. if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1493. /* This was really a NUL. */
  1494. *yyg->yy_c_buf_p = '\0';
  1495. else
  1496. { /* need more input */
  1497. int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
  1498. ++yyg->yy_c_buf_p;
  1499. switch ( yy_get_next_buffer( yyscanner ) )
  1500. {
  1501. case EOB_ACT_LAST_MATCH:
  1502. /* This happens because yy_g_n_b()
  1503. * sees that we've accumulated a
  1504. * token and flags that we need to
  1505. * try matching the token before
  1506. * proceeding. But for input(),
  1507. * there's no matching to consider.
  1508. * So convert the EOB_ACT_LAST_MATCH
  1509. * to EOB_ACT_END_OF_FILE.
  1510. */
  1511. /* Reset buffer status. */
  1512. ast_yyrestart(yyin ,yyscanner);
  1513. /*FALLTHROUGH*/
  1514. case EOB_ACT_END_OF_FILE:
  1515. {
  1516. if ( ast_yywrap(yyscanner ) )
  1517. return EOF;
  1518. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1519. YY_NEW_FILE;
  1520. #ifdef __cplusplus
  1521. return yyinput(yyscanner);
  1522. #else
  1523. return input(yyscanner);
  1524. #endif
  1525. }
  1526. case EOB_ACT_CONTINUE_SCAN:
  1527. yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  1528. break;
  1529. }
  1530. }
  1531. }
  1532. c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  1533. *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
  1534. yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  1535. return c;
  1536. }
  1537. #endif /* ifndef YY_NO_INPUT */
  1538. /** Immediately switch to a different input stream.
  1539. * @param input_file A readable stream.
  1540. * @param yyscanner The scanner object.
  1541. * @note This function does not reset the start condition to @c INITIAL .
  1542. */
  1543. void ast_yyrestart (FILE * input_file , yyscan_t yyscanner)
  1544. {
  1545. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1546. if ( ! YY_CURRENT_BUFFER ){
  1547. ast_yyensure_buffer_stack (yyscanner);
  1548. YY_CURRENT_BUFFER_LVALUE =
  1549. ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  1550. }
  1551. ast_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
  1552. ast_yy_load_buffer_state(yyscanner );
  1553. }
  1554. /** Switch to a different input buffer.
  1555. * @param new_buffer The new input buffer.
  1556. * @param yyscanner The scanner object.
  1557. */
  1558. void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1559. {
  1560. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1561. /* TODO. We should be able to replace this entire function body
  1562. * with
  1563. * ast_yypop_buffer_state();
  1564. * ast_yypush_buffer_state(new_buffer);
  1565. */
  1566. ast_yyensure_buffer_stack (yyscanner);
  1567. if ( YY_CURRENT_BUFFER == new_buffer )
  1568. return;
  1569. if ( YY_CURRENT_BUFFER )
  1570. {
  1571. /* Flush out information for old buffer. */
  1572. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1573. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1574. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1575. }
  1576. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1577. ast_yy_load_buffer_state(yyscanner );
  1578. /* We don't actually know whether we did this switch during
  1579. * EOF (ast_yywrap()) processing, but the only time this flag
  1580. * is looked at is after ast_yywrap() is called, so it's safe
  1581. * to go ahead and always set it.
  1582. */
  1583. yyg->yy_did_buffer_switch_on_eof = 1;
  1584. }
  1585. static void ast_yy_load_buffer_state (yyscan_t yyscanner)
  1586. {
  1587. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1588. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1589. yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1590. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1591. yyg->yy_hold_char = *yyg->yy_c_buf_p;
  1592. }
  1593. /** Allocate and initialize an input buffer state.
  1594. * @param file A readable stream.
  1595. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1596. * @param yyscanner The scanner object.
  1597. * @return the allocated buffer state.
  1598. */
  1599. YY_BUFFER_STATE ast_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  1600. {
  1601. YY_BUFFER_STATE b;
  1602. b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  1603. if ( ! b )
  1604. YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
  1605. b->yy_buf_size = size;
  1606. /* yy_ch_buf has to be 2 characters longer than the size given because
  1607. * we need to put in 2 end-of-buffer characters.
  1608. */
  1609. b->yy_ch_buf = (char *) ast_yyalloc(b->yy_buf_size + 2 ,yyscanner );
  1610. if ( ! b->yy_ch_buf )
  1611. YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
  1612. b->yy_is_our_buffer = 1;
  1613. ast_yy_init_buffer(b,file ,yyscanner);
  1614. return b;
  1615. }
  1616. /** Destroy the buffer.
  1617. * @param b a buffer created with ast_yy_create_buffer()
  1618. * @param yyscanner The scanner object.
  1619. */
  1620. void ast_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1621. {
  1622. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1623. if ( ! b )
  1624. return;
  1625. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1626. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1627. if ( b->yy_is_our_buffer )
  1628. ast_yyfree((void *) b->yy_ch_buf ,yyscanner );
  1629. ast_yyfree((void *) b ,yyscanner );
  1630. }
  1631. #ifndef __cplusplus
  1632. extern int isatty (int );
  1633. #endif /* __cplusplus */
  1634. /* Initializes or reinitializes a buffer.
  1635. * This function is sometimes called more than once on the same buffer,
  1636. * such as during a ast_yyrestart() or at EOF.
  1637. */
  1638. static void ast_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  1639. {
  1640. int oerrno = errno;
  1641. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1642. ast_yy_flush_buffer(b ,yyscanner);
  1643. b->yy_input_file = file;
  1644. b->yy_fill_buffer = 1;
  1645. /* If b is the current buffer, then ast_yy_init_buffer was _probably_
  1646. * called from ast_yyrestart() or through yy_get_next_buffer.
  1647. * In that case, we don't want to reset the lineno or column.
  1648. */
  1649. if (b != YY_CURRENT_BUFFER){
  1650. b->yy_bs_lineno = 1;
  1651. b->yy_bs_column = 0;
  1652. }
  1653. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1654. errno = oerrno;
  1655. }
  1656. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1657. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1658. * @param yyscanner The scanner object.
  1659. */
  1660. void ast_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1661. {
  1662. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1663. if ( ! b )
  1664. return;
  1665. b->yy_n_chars = 0;
  1666. /* We always need two end-of-buffer characters. The first causes
  1667. * a transition to the end-of-buffer state. The second causes
  1668. * a jam in that state.
  1669. */
  1670. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1671. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1672. b->yy_buf_pos = &b->yy_ch_buf[0];
  1673. b->yy_at_bol = 1;
  1674. b->yy_buffer_status = YY_BUFFER_NEW;
  1675. if ( b == YY_CURRENT_BUFFER )
  1676. ast_yy_load_buffer_state(yyscanner );
  1677. }
  1678. /** Pushes the new state onto the stack. The new state becomes
  1679. * the current state. This function will allocate the stack
  1680. * if necessary.
  1681. * @param new_buffer The new state.
  1682. * @param yyscanner The scanner object.
  1683. */
  1684. void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1685. {
  1686. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1687. if (new_buffer == NULL)
  1688. return;
  1689. ast_yyensure_buffer_stack(yyscanner);
  1690. /* This block is copied from ast_yy_switch_to_buffer. */
  1691. if ( YY_CURRENT_BUFFER )
  1692. {
  1693. /* Flush out information for old buffer. */
  1694. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1695. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1696. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1697. }
  1698. /* Only push if top exists. Otherwise, replace top. */
  1699. if (YY_CURRENT_BUFFER)
  1700. yyg->yy_buffer_stack_top++;
  1701. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1702. /* copied from ast_yy_switch_to_buffer. */
  1703. ast_yy_load_buffer_state(yyscanner );
  1704. yyg->yy_did_buffer_switch_on_eof = 1;
  1705. }
  1706. /** Removes and deletes the top of the stack, if present.
  1707. * The next element becomes the new top.
  1708. * @param yyscanner The scanner object.
  1709. */
  1710. void ast_yypop_buffer_state (yyscan_t yyscanner)
  1711. {
  1712. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1713. if (!YY_CURRENT_BUFFER)
  1714. return;
  1715. ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
  1716. YY_CURRENT_BUFFER_LVALUE = NULL;
  1717. if (yyg->yy_buffer_stack_top > 0)
  1718. --yyg->yy_buffer_stack_top;
  1719. if (YY_CURRENT_BUFFER) {
  1720. ast_yy_load_buffer_state(yyscanner );
  1721. yyg->yy_did_buffer_switch_on_eof = 1;
  1722. }
  1723. }
  1724. /* Allocates the stack if it does not exist.
  1725. * Guarantees space for at least one push.
  1726. */
  1727. static void ast_yyensure_buffer_stack (yyscan_t yyscanner)
  1728. {
  1729. int num_to_alloc;
  1730. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1731. if (!yyg->yy_buffer_stack) {
  1732. /* First allocation is just for 2 elements, since we don't know if this
  1733. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1734. * immediate realloc on the next call.
  1735. */
  1736. num_to_alloc = 1;
  1737. yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc
  1738. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1739. , yyscanner);
  1740. memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1741. yyg->yy_buffer_stack_max = num_to_alloc;
  1742. yyg->yy_buffer_stack_top = 0;
  1743. return;
  1744. }
  1745. if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  1746. /* Increase the buffer to prepare for a possible push. */
  1747. int grow_size = 8 /* arbitrary grow size */;
  1748. num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
  1749. yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyrealloc
  1750. (yyg->yy_buffer_stack,
  1751. num_to_alloc * sizeof(struct yy_buffer_state*)
  1752. , yyscanner);
  1753. /* zero only the new slots.*/
  1754. memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  1755. yyg->yy_buffer_stack_max = num_to_alloc;
  1756. }
  1757. }
  1758. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1759. * @param base the character buffer
  1760. * @param size the size in bytes of the character buffer
  1761. * @param yyscanner The scanner object.
  1762. * @return the newly allocated buffer state object.
  1763. */
  1764. YY_BUFFER_STATE ast_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  1765. {
  1766. YY_BUFFER_STATE b;
  1767. if ( size < 2 ||
  1768. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1769. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1770. /* They forgot to leave room for the EOB's. */
  1771. return 0;
  1772. b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  1773. if ( ! b )
  1774. YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );
  1775. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1776. b->yy_buf_pos = b->yy_ch_buf = base;
  1777. b->yy_is_our_buffer = 0;
  1778. b->yy_input_file = 0;
  1779. b->yy_n_chars = b->yy_buf_size;
  1780. b->yy_is_interactive = 0;
  1781. b->yy_at_bol = 1;
  1782. b->yy_fill_buffer = 0;
  1783. b->yy_buffer_status = YY_BUFFER_NEW;
  1784. ast_yy_switch_to_buffer(b ,yyscanner );
  1785. return b;
  1786. }
  1787. /** Setup the input buffer state to scan a string. The next call to ast_yylex() will
  1788. * scan from a @e copy of @a str.
  1789. * @param yy_str a NUL-terminated string to scan
  1790. * @param yyscanner The scanner object.
  1791. * @return the newly allocated buffer state object.
  1792. * @note If you want to scan bytes that may contain NUL values, then use
  1793. * ast_yy_scan_bytes() instead.
  1794. */
  1795. YY_BUFFER_STATE ast_yy_scan_string (yyconst char * yy_str , yyscan_t yyscanner)
  1796. {
  1797. return ast_yy_scan_bytes(yy_str,strlen(yy_str) ,yyscanner);
  1798. }
  1799. /** Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will
  1800. * scan from a @e copy of @a bytes.
  1801. * @param bytes the byte buffer to scan
  1802. * @param len the number of bytes in the buffer pointed to by @a bytes.
  1803. * @param yyscanner The scanner object.
  1804. * @return the newly allocated buffer state object.
  1805. */
  1806. YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char * bytes, int len , yyscan_t yyscanner)
  1807. {
  1808. YY_BUFFER_STATE b;
  1809. char *buf;
  1810. yy_size_t n;
  1811. int i;
  1812. /* Get memory for full buffer, including space for trailing EOB's. */
  1813. n = len + 2;
  1814. buf = (char *) ast_yyalloc(n ,yyscanner );
  1815. if ( ! buf )
  1816. YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );
  1817. for ( i = 0; i < len; ++i )
  1818. buf[i] = bytes[i];
  1819. buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  1820. b = ast_yy_scan_buffer(buf,n ,yyscanner);
  1821. if ( ! b )
  1822. YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );
  1823. /* It's okay to grow etc. this buffer, and we should throw it
  1824. * away when we're done.
  1825. */
  1826. b->yy_is_our_buffer = 1;
  1827. return b;
  1828. }
  1829. #ifndef YY_EXIT_FAILURE
  1830. #define YY_EXIT_FAILURE 2
  1831. #endif
  1832. static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
  1833. {
  1834. (void) fprintf( stderr, "%s\n", msg );
  1835. exit( YY_EXIT_FAILURE );
  1836. }
  1837. /* Redefine yyless() so it works in section 3 code. */
  1838. #undef yyless
  1839. #define yyless(n) \
  1840. do \
  1841. { \
  1842. /* Undo effects of setting up yytext. */ \
  1843. int yyless_macro_arg = (n); \
  1844. YY_LESS_LINENO(yyless_macro_arg);\
  1845. yytext[yyleng] = yyg->yy_hold_char; \
  1846. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  1847. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  1848. *yyg->yy_c_buf_p = '\0'; \
  1849. yyleng = yyless_macro_arg; \
  1850. } \
  1851. while ( 0 )
  1852. /* Accessor methods (get/set functions) to struct members. */
  1853. /** Get the user-defined data for this scanner.
  1854. * @param yyscanner The scanner object.
  1855. */
  1856. YY_EXTRA_TYPE ast_yyget_extra (yyscan_t yyscanner)
  1857. {
  1858. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1859. return yyextra;
  1860. }
  1861. /** Get the current line number.
  1862. * @param yyscanner The scanner object.
  1863. */
  1864. int ast_yyget_lineno (yyscan_t yyscanner)
  1865. {
  1866. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1867. if (! YY_CURRENT_BUFFER)
  1868. return 0;
  1869. return yylineno;
  1870. }
  1871. /** Get the current column number.
  1872. * @param yyscanner The scanner object.
  1873. */
  1874. int ast_yyget_column (yyscan_t yyscanner)
  1875. {
  1876. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1877. if (! YY_CURRENT_BUFFER)
  1878. return 0;
  1879. return yycolumn;
  1880. }
  1881. /** Get the input stream.
  1882. * @param yyscanner The scanner object.
  1883. */
  1884. FILE *ast_yyget_in (yyscan_t yyscanner)
  1885. {
  1886. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1887. return yyin;
  1888. }
  1889. /** Get the output stream.
  1890. * @param yyscanner The scanner object.
  1891. */
  1892. FILE *ast_yyget_out (yyscan_t yyscanner)
  1893. {
  1894. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1895. return yyout;
  1896. }
  1897. /** Get the length of the current token.
  1898. * @param yyscanner The scanner object.
  1899. */
  1900. int ast_yyget_leng (yyscan_t yyscanner)
  1901. {
  1902. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1903. return yyleng;
  1904. }
  1905. /** Get the current token.
  1906. * @param yyscanner The scanner object.
  1907. */
  1908. char *ast_yyget_text (yyscan_t yyscanner)
  1909. {
  1910. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1911. return yytext;
  1912. }
  1913. /** Set the user-defined data. This data is never touched by the scanner.
  1914. * @param user_defined The data to be associated with this scanner.
  1915. * @param yyscanner The scanner object.
  1916. */
  1917. void ast_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  1918. {
  1919. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1920. yyextra = user_defined ;
  1921. }
  1922. /** Set the current line number.
  1923. * @param line_number
  1924. * @param yyscanner The scanner object.
  1925. */
  1926. void ast_yyset_lineno (int line_number , yyscan_t yyscanner)
  1927. {
  1928. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1929. /* lineno is only valid if an input buffer exists. */
  1930. if (! YY_CURRENT_BUFFER )
  1931. yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner);
  1932. yylineno = line_number;
  1933. }
  1934. /** Set the current column.
  1935. * @param column_no
  1936. * @param yyscanner The scanner object.
  1937. */
  1938. void ast_yyset_column (int column_no , yyscan_t yyscanner)
  1939. {
  1940. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1941. /* column is only valid if an input buffer exists. */
  1942. if (! YY_CURRENT_BUFFER )
  1943. yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner);
  1944. yycolumn = column_no;
  1945. }
  1946. /** Set the input stream. This does not discard the current
  1947. * input buffer.
  1948. * @param in_str A readable stream.
  1949. * @param yyscanner The scanner object.
  1950. * @see ast_yy_switch_to_buffer
  1951. */
  1952. void ast_yyset_in (FILE * in_str , yyscan_t yyscanner)
  1953. {
  1954. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1955. yyin = in_str ;
  1956. }
  1957. void ast_yyset_out (FILE * out_str , yyscan_t yyscanner)
  1958. {
  1959. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1960. yyout = out_str ;
  1961. }
  1962. int ast_yyget_debug (yyscan_t yyscanner)
  1963. {
  1964. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1965. return yy_flex_debug;
  1966. }
  1967. void ast_yyset_debug (int bdebug , yyscan_t yyscanner)
  1968. {
  1969. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1970. yy_flex_debug = bdebug ;
  1971. }
  1972. /* Accessor methods for yylval and yylloc */
  1973. YYSTYPE * ast_yyget_lval (yyscan_t yyscanner)
  1974. {
  1975. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1976. return yylval;
  1977. }
  1978. void ast_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
  1979. {
  1980. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1981. yylval = yylval_param;
  1982. }
  1983. YYLTYPE *ast_yyget_lloc (yyscan_t yyscanner)
  1984. {
  1985. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1986. return yylloc;
  1987. }
  1988. void ast_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
  1989. {
  1990. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1991. yylloc = yylloc_param;
  1992. }
  1993. static int yy_init_globals (yyscan_t yyscanner)
  1994. {
  1995. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1996. /* Initialization is the same as for the non-reentrant scanner.
  1997. This function is called once per scanner lifetime. */
  1998. yyg->yy_buffer_stack = 0;
  1999. yyg->yy_buffer_stack_top = 0;
  2000. yyg->yy_buffer_stack_max = 0;
  2001. yyg->yy_c_buf_p = (char *) 0;
  2002. yyg->yy_init = 1;
  2003. yyg->yy_start = 0;
  2004. yyg->yy_start_stack_ptr = 0;
  2005. yyg->yy_start_stack_depth = 0;
  2006. yyg->yy_start_stack = (int *) 0;
  2007. /* Defined in main.c */
  2008. #ifdef YY_STDINIT
  2009. yyin = stdin;
  2010. yyout = stdout;
  2011. #else
  2012. yyin = (FILE *) 0;
  2013. yyout = (FILE *) 0;
  2014. #endif
  2015. /* For future reference: Set errno on error, since we are called by
  2016. * ast_yylex_init()
  2017. */
  2018. return 0;
  2019. }
  2020. /* User-visible API */
  2021. /* ast_yylex_init is special because it creates the scanner itself, so it is
  2022. * the ONLY reentrant function that doesn't take the scanner as the last argument.
  2023. * That's why we explicitly handle the declaration, instead of using our macros.
  2024. */
  2025. int ast_yylex_init(yyscan_t* ptr_yy_globals)
  2026. {
  2027. if (ptr_yy_globals == NULL){
  2028. errno = EINVAL;
  2029. return 1;
  2030. }
  2031. *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );
  2032. if (*ptr_yy_globals == NULL){
  2033. errno = ENOMEM;
  2034. return 1;
  2035. }
  2036. memset(*ptr_yy_globals,0,sizeof(struct yyguts_t));
  2037. return yy_init_globals ( *ptr_yy_globals );
  2038. }
  2039. /* ast_yylex_destroy is for both reentrant and non-reentrant scanners. */
  2040. int ast_yylex_destroy (yyscan_t yyscanner)
  2041. {
  2042. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2043. /* Pop the buffer stack, destroying each element. */
  2044. while(YY_CURRENT_BUFFER){
  2045. ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
  2046. YY_CURRENT_BUFFER_LVALUE = NULL;
  2047. ast_yypop_buffer_state(yyscanner);
  2048. }
  2049. /* Destroy the stack itself. */
  2050. ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
  2051. yyg->yy_buffer_stack = NULL;
  2052. /* Destroy the start condition stack. */
  2053. ast_yyfree(yyg->yy_start_stack ,yyscanner );
  2054. yyg->yy_start_stack = NULL;
  2055. /* Destroy the main struct (reentrant only). */
  2056. ast_yyfree ( yyscanner , yyscanner );
  2057. return 0;
  2058. }
  2059. /*
  2060. * Internal utility routines.
  2061. */
  2062. #ifndef yytext_ptr
  2063. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
  2064. {
  2065. register int i;
  2066. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2067. for ( i = 0; i < n; ++i )
  2068. s1[i] = s2[i];
  2069. }
  2070. #endif
  2071. #ifdef YY_NEED_STRLEN
  2072. static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
  2073. {
  2074. register int n;
  2075. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2076. for ( n = 0; s[n]; ++n )
  2077. ;
  2078. return n;
  2079. }
  2080. #endif
  2081. void *ast_yyalloc (yy_size_t size , yyscan_t yyscanner)
  2082. {
  2083. return (void *) malloc( size );
  2084. }
  2085. void *ast_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
  2086. {
  2087. /* The cast to (char *) in the following accommodates both
  2088. * implementations that use char* generic pointers, and those
  2089. * that use void* generic pointers. It works with the latter
  2090. * because both ANSI C and C++ allow castless assignment from
  2091. * any pointer type to void*, and deal with argument conversions
  2092. * as though doing an assignment.
  2093. */
  2094. return (void *) realloc( (char *) ptr, size );
  2095. }
  2096. void ast_yyfree (void * ptr , yyscan_t yyscanner)
  2097. {
  2098. free( (char *) ptr ); /* see ast_yyrealloc() for (char *) cast */
  2099. }
  2100. #define YYTABLES_NAME "yytables"
  2101. #undef YY_NEW_FILE
  2102. #undef YY_FLUSH_BUFFER
  2103. #undef yy_set_bol
  2104. #undef yy_new_buffer
  2105. #undef yy_set_interactive
  2106. #undef yytext_ptr
  2107. #undef YY_DO_BEFORE_ACTION
  2108. #ifdef YY_DECL_IS_OURS
  2109. #undef YY_DECL_IS_OURS
  2110. #undef YY_DECL
  2111. #endif
  2112. #line 88 "ast_expr2.fl"
  2113. /* I'm putting the interface routine to the whole parse here in the flexer input file
  2114. mainly because of all the flexer initialization that has to be done. Shouldn't matter
  2115. where it is, as long as it's somewhere. I didn't want to define a prototype for the
  2116. ast_yy_scan_string in the .y file, because then, I'd have to define YY_BUFFER_STATE there...
  2117. UGH! that would be inappropriate. */
  2118. int ast_yyparse(void *); /* need to/should define this prototype for the call to yyparse */
  2119. int ast_yyerror(const char *, YYLTYPE *, struct parse_io *); /* likewise */
  2120. int ast_expr(char *expr, char *buf, int length)
  2121. {
  2122. struct parse_io *io;
  2123. io = calloc(sizeof(struct parse_io),1);
  2124. io->string = expr; /* to pass to the error routine */
  2125. ast_yylex_init(&io->scanner);
  2126. ast_yy_scan_string(expr, io->scanner);
  2127. ast_yyparse ((void *) io);
  2128. ast_yylex_destroy(io->scanner);
  2129. if (io->val == NULL) {
  2130. if (length > 1) {
  2131. strcpy(buf, "0");
  2132. return 1;
  2133. }
  2134. } else {
  2135. if (io->val->type == AST_EXPR_integer) {
  2136. int res_length;
  2137. res_length = snprintf(buf, length, "%ld", (long int) io->val->u.i);
  2138. return res_length <= length ? res_length : length;
  2139. } else {
  2140. #ifdef STANDALONE
  2141. strncpy(buf, io->val->u.s, length - 1);
  2142. #else /* !STANDALONE */
  2143. ast_copy_string(buf, io->val->u.s, length);
  2144. #endif /* STANDALONE */
  2145. return strlen(buf);
  2146. }
  2147. free(io->val);
  2148. }
  2149. free(io);
  2150. return 0;
  2151. }
  2152. int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio )
  2153. {
  2154. struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
  2155. char spacebuf[8000]; /* best safe than sorry */
  2156. char spacebuf2[8000]; /* best safe than sorry */
  2157. int i=0;
  2158. spacebuf[0] = 0;
  2159. #ifdef WHEN_LOC_MEANS_SOMETHING
  2160. if( loc->first_column > 7990 ) /* if things get out of whack, why crash? */
  2161. loc->first_column = 7990;
  2162. if( loc->last_column > 7990 )
  2163. loc->last_column = 7990;
  2164. for(i=0;i<loc->first_column;i++) spacebuf[i] = ' ';
  2165. for( ;i<loc->last_column;i++) spacebuf[i] = '^';
  2166. spacebuf[i] = 0;
  2167. #endif
  2168. for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' '; /* uh... assuming yyg is defined, then I can use the yycolumn macro,
  2169. which is the same thing as... get this:
  2170. yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
  2171. I was tempted to just use yy_buf_pos in the STATE, but..., well:
  2172. a. the yy_buf_pos is the current position in the buffer, which
  2173. may not relate to the entire string/buffer because of the
  2174. buffering.
  2175. b. but, analysis of the situation is that when you use the
  2176. ast_yy_scan_string func, it creates a single buffer the size of
  2177. string, so the two would be the same...
  2178. so, in the end, the yycolumn macro is available, shorter, therefore easier. */
  2179. spacebuf2[i++]='^';
  2180. spacebuf2[i]= 0;
  2181. #ifdef STANDALONE3
  2182. /* easier to read in the standalone version */
  2183. printf("ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n",
  2184. s, parseio->string,spacebuf2);
  2185. #else
  2186. ast_log(LOG_WARNING,"ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n",
  2187. s, parseio->string,spacebuf2);
  2188. #endif
  2189. #ifndef STANDALONE
  2190. ast_log(LOG_WARNING,"If you have questions, please refer to doc/README.variables in the asterisk source.\n");
  2191. #endif
  2192. return(0);
  2193. }