ael_lex.c 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479
  1. #define ASTMM_LIBC ASTMM_REDIRECT
  2. #include "asterisk.h"
  3. #line 2 "ael_lex.c"
  4. #line 4 "ael_lex.c"
  5. #define YY_INT_ALIGNED short int
  6. /* A lexical scanner generated by flex */
  7. #define FLEX_SCANNER
  8. #define YY_FLEX_MAJOR_VERSION 2
  9. #define YY_FLEX_MINOR_VERSION 5
  10. #define YY_FLEX_SUBMINOR_VERSION 35
  11. #if YY_FLEX_SUBMINOR_VERSION > 0
  12. #define FLEX_BETA
  13. #endif
  14. /* First, we deal with platform-specific or compiler-specific issues. */
  15. /* begin standard C headers. */
  16. #include <stdio.h>
  17. #include <string.h>
  18. #include <errno.h>
  19. #include <stdlib.h>
  20. /* end standard C headers. */
  21. /* flex integer type definitions */
  22. #ifndef FLEXINT_H
  23. #define FLEXINT_H
  24. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  25. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  26. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  27. * if you want the limit (max/min) macros for int types.
  28. */
  29. #ifndef __STDC_LIMIT_MACROS
  30. #define __STDC_LIMIT_MACROS 1
  31. #endif
  32. #include <inttypes.h>
  33. typedef int8_t flex_int8_t;
  34. typedef uint8_t flex_uint8_t;
  35. typedef int16_t flex_int16_t;
  36. typedef uint16_t flex_uint16_t;
  37. typedef int32_t flex_int32_t;
  38. typedef uint32_t flex_uint32_t;
  39. #else
  40. typedef signed char flex_int8_t;
  41. typedef short int flex_int16_t;
  42. typedef int flex_int32_t;
  43. typedef unsigned char flex_uint8_t;
  44. typedef unsigned short int flex_uint16_t;
  45. typedef unsigned int flex_uint32_t;
  46. #endif /* ! C99 */
  47. /* Limits of integral types. */
  48. #ifndef INT8_MIN
  49. #define INT8_MIN (-128)
  50. #endif
  51. #ifndef INT16_MIN
  52. #define INT16_MIN (-32767-1)
  53. #endif
  54. #ifndef INT32_MIN
  55. #define INT32_MIN (-2147483647-1)
  56. #endif
  57. #ifndef INT8_MAX
  58. #define INT8_MAX (127)
  59. #endif
  60. #ifndef INT16_MAX
  61. #define INT16_MAX (32767)
  62. #endif
  63. #ifndef INT32_MAX
  64. #define INT32_MAX (2147483647)
  65. #endif
  66. #ifndef UINT8_MAX
  67. #define UINT8_MAX (255U)
  68. #endif
  69. #ifndef UINT16_MAX
  70. #define UINT16_MAX (65535U)
  71. #endif
  72. #ifndef UINT32_MAX
  73. #define UINT32_MAX (4294967295U)
  74. #endif
  75. #endif /* ! FLEXINT_H */
  76. #ifdef __cplusplus
  77. /* The "const" storage-class-modifier is valid. */
  78. #define YY_USE_CONST
  79. #else /* ! __cplusplus */
  80. /* C99 requires __STDC__ to be defined as 1. */
  81. #if defined (__STDC__)
  82. #define YY_USE_CONST
  83. #endif /* defined (__STDC__) */
  84. #endif /* ! __cplusplus */
  85. #ifdef YY_USE_CONST
  86. #define yyconst const
  87. #else
  88. #define yyconst
  89. #endif
  90. /* Returned upon end-of-file. */
  91. #define YY_NULL 0
  92. /* Promotes a possibly negative, possibly signed char to an unsigned
  93. * integer for use as an array index. If the signed char is negative,
  94. * we want to instead treat it as an 8-bit unsigned char, hence the
  95. * double cast.
  96. */
  97. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  98. /* An opaque pointer. */
  99. #ifndef YY_TYPEDEF_YY_SCANNER_T
  100. #define YY_TYPEDEF_YY_SCANNER_T
  101. typedef void* yyscan_t;
  102. #endif
  103. /* For convenience, these vars (plus the bison vars far below)
  104. are macros in the reentrant scanner. */
  105. #define yyin yyg->yyin_r
  106. #define yyout yyg->yyout_r
  107. #define yyextra yyg->yyextra_r
  108. #define yyleng yyg->yyleng_r
  109. #define yytext yyg->yytext_r
  110. #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
  111. #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
  112. #define yy_flex_debug yyg->yy_flex_debug_r
  113. /* Enter a start condition. This macro really ought to take a parameter,
  114. * but we do it the disgusting crufty way forced on us by the ()-less
  115. * definition of BEGIN.
  116. */
  117. #define BEGIN yyg->yy_start = 1 + 2 *
  118. /* Translate the current start state into a value that can be later handed
  119. * to BEGIN to return to the state. The YYSTATE alias is for lex
  120. * compatibility.
  121. */
  122. #define YY_START ((yyg->yy_start - 1) / 2)
  123. #define YYSTATE YY_START
  124. /* Action number for EOF rule of a given start state. */
  125. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  126. /* Special action meaning "start processing a new file". */
  127. #define YY_NEW_FILE ael_yyrestart(yyin ,yyscanner )
  128. #define YY_END_OF_BUFFER_CHAR 0
  129. /* Size of default input buffer. */
  130. #ifndef YY_BUF_SIZE
  131. #define YY_BUF_SIZE 16384
  132. #endif
  133. /* The state buf must be large enough to hold one state per character in the main buffer.
  134. */
  135. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  136. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  137. #define YY_TYPEDEF_YY_BUFFER_STATE
  138. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  139. #endif
  140. #define EOB_ACT_CONTINUE_SCAN 0
  141. #define EOB_ACT_END_OF_FILE 1
  142. #define EOB_ACT_LAST_MATCH 2
  143. #define YY_LESS_LINENO(n)
  144. /* Return all but the first "n" matched characters back to the input stream. */
  145. #define yyless(n) \
  146. do \
  147. { \
  148. /* Undo effects of setting up yytext. */ \
  149. int yyless_macro_arg = (n); \
  150. YY_LESS_LINENO(yyless_macro_arg);\
  151. *yy_cp = yyg->yy_hold_char; \
  152. YY_RESTORE_YY_MORE_OFFSET \
  153. yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  154. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  155. } \
  156. while ( 0 )
  157. #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
  158. #ifndef YY_TYPEDEF_YY_SIZE_T
  159. #define YY_TYPEDEF_YY_SIZE_T
  160. typedef size_t yy_size_t;
  161. #endif
  162. #ifndef YY_STRUCT_YY_BUFFER_STATE
  163. #define YY_STRUCT_YY_BUFFER_STATE
  164. struct yy_buffer_state
  165. {
  166. FILE *yy_input_file;
  167. char *yy_ch_buf; /* input buffer */
  168. char *yy_buf_pos; /* current position in input buffer */
  169. /* Size of input buffer in bytes, not including room for EOB
  170. * characters.
  171. */
  172. yy_size_t yy_buf_size;
  173. /* Number of characters read into yy_ch_buf, not including EOB
  174. * characters.
  175. */
  176. int yy_n_chars;
  177. /* Whether we "own" the buffer - i.e., we know we created it,
  178. * and can realloc() it to grow it, and should free() it to
  179. * delete it.
  180. */
  181. int yy_is_our_buffer;
  182. /* Whether this is an "interactive" input source; if so, and
  183. * if we're using stdio for input, then we want to use getc()
  184. * instead of fread(), to make sure we stop fetching input after
  185. * each newline.
  186. */
  187. int yy_is_interactive;
  188. /* Whether we're considered to be at the beginning of a line.
  189. * If so, '^' rules will be active on the next match, otherwise
  190. * not.
  191. */
  192. int yy_at_bol;
  193. int yy_bs_lineno; /**< The line count. */
  194. int yy_bs_column; /**< The column count. */
  195. /* Whether to try to fill the input buffer when we reach the
  196. * end of it.
  197. */
  198. int yy_fill_buffer;
  199. int yy_buffer_status;
  200. #define YY_BUFFER_NEW 0
  201. #define YY_BUFFER_NORMAL 1
  202. /* When an EOF's been seen but there's still some text to process
  203. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  204. * shouldn't try reading from the input source any more. We might
  205. * still have a bunch of tokens to match, though, because of
  206. * possible backing-up.
  207. *
  208. * When we actually see the EOF, we change the status to "new"
  209. * (via ael_yyrestart()), so that the user can continue scanning by
  210. * just pointing yyin at a new input file.
  211. */
  212. #define YY_BUFFER_EOF_PENDING 2
  213. };
  214. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  215. /* We provide macros for accessing buffer states in case in the
  216. * future we want to put the buffer states in a more general
  217. * "scanner state".
  218. *
  219. * Returns the top of the stack, or NULL.
  220. */
  221. #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
  222. ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
  223. : NULL)
  224. /* Same as previous macro, but useful when we know that the buffer stack is not
  225. * NULL or when we need an lvalue. For internal use only.
  226. */
  227. #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
  228. void ael_yyrestart (FILE *input_file ,yyscan_t yyscanner );
  229. void ael_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
  230. YY_BUFFER_STATE ael_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
  231. void ael_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
  232. void ael_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
  233. void ael_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
  234. void ael_yypop_buffer_state (yyscan_t yyscanner );
  235. static void ael_yyensure_buffer_stack (yyscan_t yyscanner );
  236. static void ael_yy_load_buffer_state (yyscan_t yyscanner );
  237. static void ael_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
  238. #define YY_FLUSH_BUFFER ael_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
  239. YY_BUFFER_STATE ael_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
  240. YY_BUFFER_STATE ael_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
  241. YY_BUFFER_STATE ael_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
  242. void *ael_yyalloc (yy_size_t ,yyscan_t yyscanner );
  243. void *ael_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
  244. void ael_yyfree (void * ,yyscan_t yyscanner );
  245. #define yy_new_buffer ael_yy_create_buffer
  246. #define yy_set_interactive(is_interactive) \
  247. { \
  248. if ( ! YY_CURRENT_BUFFER ){ \
  249. ael_yyensure_buffer_stack (yyscanner); \
  250. YY_CURRENT_BUFFER_LVALUE = \
  251. ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  252. } \
  253. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  254. }
  255. #define yy_set_bol(at_bol) \
  256. { \
  257. if ( ! YY_CURRENT_BUFFER ){\
  258. ael_yyensure_buffer_stack (yyscanner); \
  259. YY_CURRENT_BUFFER_LVALUE = \
  260. ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  261. } \
  262. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  263. }
  264. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  265. /* Begin user sect3 */
  266. #define ael_yywrap(n) 1
  267. #define YY_SKIP_YYWRAP
  268. typedef unsigned char YY_CHAR;
  269. typedef int yy_state_type;
  270. #define yytext_ptr yytext_r
  271. static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
  272. static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
  273. static int yy_get_next_buffer (yyscan_t yyscanner );
  274. static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
  275. /* Done after the current pattern has been matched and before the
  276. * corresponding action - sets up yytext.
  277. */
  278. #define YY_DO_BEFORE_ACTION \
  279. yyg->yytext_ptr = yy_bp; \
  280. yyg->yytext_ptr -= yyg->yy_more_len; \
  281. yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
  282. yyg->yy_hold_char = *yy_cp; \
  283. *yy_cp = '\0'; \
  284. yyg->yy_c_buf_p = yy_cp;
  285. #define YY_NUM_RULES 76
  286. #define YY_END_OF_BUFFER 77
  287. /* This struct is not used in this scanner,
  288. but its presence is necessary. */
  289. struct yy_trans_info
  290. {
  291. flex_int32_t yy_verify;
  292. flex_int32_t yy_nxt;
  293. };
  294. static yyconst flex_int16_t yy_accept[285] =
  295. { 0,
  296. 0, 0, 0, 0, 0, 0, 0, 0, 43, 43,
  297. 0, 0, 0, 0, 0, 0, 77, 75, 50, 48,
  298. 49, 51, 51, 51, 9, 3, 4, 7, 51, 8,
  299. 5, 6, 12, 75, 51, 51, 51, 51, 51, 51,
  300. 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
  301. 1, 10, 2, 75, 65, 64, 75, 66, 75, 71,
  302. 72, 73, 75, 75, 67, 68, 69, 75, 70, 43,
  303. 44, 45, 75, 59, 60, 75, 58, 57, 52, 52,
  304. 57, 53, 75, 62, 63, 75, 61, 50, 49, 0,
  305. 51, 42, 13, 11, 0, 0, 0, 0, 0, 0,
  306. 0, 0, 0, 0, 0, 0, 22, 0, 0, 0,
  307. 0, 0, 0, 0, 0, 0, 0, 0, 65, 64,
  308. 0, 66, 65, 64, 66, 0, 71, 72, 73, 0,
  309. 71, 72, 73, 0, 67, 68, 69, 0, 70, 67,
  310. 68, 69, 70, 43, 44, 45, 46, 45, 47, 0,
  311. 59, 60, 0, 58, 59, 60, 58, 56, 55, 54,
  312. 0, 62, 63, 0, 61, 62, 63, 61, 0, 13,
  313. 0, 0, 0, 0, 0, 0, 0, 0, 0, 33,
  314. 0, 0, 0, 51, 0, 0, 0, 0, 0, 0,
  315. 0, 0, 0, 0, 0, 0, 0, 0, 35, 0,
  316. 0, 0, 27, 0, 0, 0, 28, 26, 0, 0,
  317. 0, 29, 0, 0, 0, 0, 0, 0, 0, 0,
  318. 0, 0, 31, 38, 0, 0, 0, 0, 0, 0,
  319. 0, 0, 0, 19, 17, 0, 0, 0, 0, 0,
  320. 34, 0, 0, 0, 0, 0, 0, 16, 0, 23,
  321. 0, 0, 0, 24, 0, 30, 21, 0, 0, 14,
  322. 0, 36, 0, 18, 0, 0, 37, 0, 51, 0,
  323. 15, 32, 0, 0, 41, 25, 39, 0, 40, 20,
  324. 0, 0, 74, 0
  325. } ;
  326. static yyconst flex_int32_t yy_ec[256] =
  327. { 0,
  328. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  329. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  330. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  331. 1, 4, 5, 6, 7, 8, 1, 9, 5, 10,
  332. 11, 12, 5, 13, 5, 5, 14, 5, 5, 5,
  333. 5, 5, 5, 5, 5, 5, 5, 15, 16, 5,
  334. 17, 18, 1, 19, 5, 5, 5, 5, 5, 5,
  335. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
  336. 5, 5, 5, 20, 5, 5, 5, 5, 5, 5,
  337. 21, 22, 23, 1, 5, 1, 24, 25, 26, 27,
  338. 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
  339. 38, 39, 5, 40, 41, 42, 43, 5, 44, 45,
  340. 5, 5, 46, 47, 48, 1, 1, 49, 49, 49,
  341. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  342. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  343. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  344. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  345. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  346. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  347. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  348. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  349. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  350. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  351. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  352. 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
  353. 49, 49, 49, 49, 49
  354. } ;
  355. static yyconst flex_int32_t yy_meta[50] =
  356. { 0,
  357. 1, 1, 2, 1, 3, 4, 3, 3, 1, 1,
  358. 1, 5, 1, 3, 1, 1, 1, 3, 1, 3,
  359. 3, 1, 3, 3, 3, 3, 3, 3, 3, 3,
  360. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  361. 3, 3, 3, 3, 3, 1, 1, 1, 1
  362. } ;
  363. static yyconst flex_int16_t yy_base[304] =
  364. { 0,
  365. 0, 0, 40, 43, 82, 121, 160, 199, 55, 56,
  366. 60, 74, 247, 296, 90, 104, 432, 1023, 429, 1023,
  367. 426, 1023, 397, 31, 1023, 1023, 1023, 1023, 43, 1023,
  368. 1023, 410, 1023, 0, 401, 382, 36, 389, 34, 378,
  369. 38, 380, 80, 368, 372, 385, 381, 66, 357, 369,
  370. 1023, 1023, 1023, 138, 1023, 1023, 143, 1023, 336, 1023,
  371. 1023, 1023, 375, 414, 1023, 1023, 1023, 453, 1023, 396,
  372. 1023, 104, 177, 1023, 1023, 182, 1023, 1023, 1023, 78,
  373. 0, 1023, 231, 1023, 1023, 262, 1023, 393, 390, 356,
  374. 1023, 1023, 0, 1023, 348, 360, 92, 350, 354, 337,
  375. 333, 333, 333, 334, 329, 333, 344, 326, 335, 320,
  376. 327, 322, 299, 303, 93, 302, 301, 280, 1023, 1023,
  377. 314, 1023, 328, 344, 358, 492, 1023, 1023, 1023, 531,
  378. 570, 609, 648, 687, 1023, 1023, 1023, 726, 1023, 765,
  379. 804, 843, 882, 329, 1023, 143, 1023, 144, 1023, 392,
  380. 1023, 1023, 397, 1023, 431, 436, 470, 1023, 1023, 1023,
  381. 475, 1023, 1023, 484, 1023, 514, 523, 553, 305, 0,
  382. 288, 305, 299, 297, 280, 297, 292, 287, 289, 0,
  383. 291, 276, 250, 257, 250, 252, 247, 258, 241, 238,
  384. 251, 248, 232, 232, 236, 235, 228, 233, 0, 234,
  385. 113, 218, 0, 217, 209, 220, 0, 0, 207, 200,
  386. 196, 0, 203, 199, 208, 197, 189, 193, 206, 203,
  387. 186, 203, 0, 0, 181, 187, 184, 192, 190, 181,
  388. 187, 186, 186, 0, 0, 171, 171, 160, 164, 166,
  389. 0, 169, 169, 152, 147, 143, 149, 0, 138, 0,
  390. 139, 149, 138, 0, 140, 0, 135, 134, 109, 0,
  391. 112, 0, 111, 0, 105, 80, 0, 82, 61, 76,
  392. 0, 0, 46, 30, 0, 0, 0, 170, 0, 0,
  393. 0, 50, 1023, 1023, 930, 935, 940, 945, 950, 955,
  394. 960, 965, 970, 975, 980, 985, 989, 994, 999, 1004,
  395. 1009, 1012, 1017
  396. } ;
  397. static yyconst flex_int16_t yy_def[304] =
  398. { 0,
  399. 284, 1, 285, 285, 286, 286, 287, 287, 288, 288,
  400. 289, 289, 290, 290, 291, 291, 284, 284, 284, 284,
  401. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  402. 284, 284, 284, 292, 284, 284, 284, 284, 284, 284,
  403. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  404. 284, 284, 284, 293, 284, 284, 293, 284, 294, 284,
  405. 284, 284, 294, 295, 284, 284, 284, 295, 284, 296,
  406. 284, 297, 298, 284, 284, 298, 284, 284, 284, 284,
  407. 299, 284, 300, 284, 284, 300, 284, 284, 284, 284,
  408. 284, 284, 301, 284, 284, 284, 284, 284, 284, 284,
  409. 284, 284, 284, 284, 284, 284, 302, 284, 284, 284,
  410. 284, 284, 284, 284, 284, 284, 284, 293, 284, 284,
  411. 293, 284, 293, 293, 293, 294, 284, 284, 284, 294,
  412. 294, 294, 294, 295, 284, 284, 284, 295, 284, 295,
  413. 295, 295, 295, 296, 284, 297, 284, 297, 284, 298,
  414. 284, 284, 298, 284, 298, 298, 298, 284, 284, 284,
  415. 300, 284, 284, 300, 284, 300, 300, 300, 284, 301,
  416. 284, 284, 284, 284, 284, 284, 284, 284, 284, 302,
  417. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  418. 284, 284, 284, 284, 284, 284, 284, 284, 302, 284,
  419. 284, 284, 302, 284, 284, 284, 302, 302, 284, 284,
  420. 284, 302, 284, 284, 284, 284, 284, 284, 284, 284,
  421. 284, 284, 302, 302, 284, 284, 284, 284, 284, 284,
  422. 284, 284, 284, 302, 302, 284, 284, 284, 284, 284,
  423. 302, 284, 284, 284, 284, 284, 284, 302, 284, 302,
  424. 284, 284, 284, 302, 284, 302, 302, 284, 284, 302,
  425. 284, 302, 284, 302, 284, 284, 302, 284, 284, 284,
  426. 302, 302, 284, 284, 302, 302, 302, 284, 302, 302,
  427. 303, 303, 284, 0, 284, 284, 284, 284, 284, 284,
  428. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  429. 284, 284, 284
  430. } ;
  431. static yyconst flex_int16_t yy_nxt[1073] =
  432. { 0,
  433. 18, 19, 20, 21, 22, 22, 23, 24, 25, 26,
  434. 27, 22, 28, 29, 30, 31, 32, 22, 33, 22,
  435. 22, 34, 22, 35, 36, 37, 38, 39, 40, 41,
  436. 42, 43, 44, 22, 45, 46, 22, 22, 47, 48,
  437. 49, 22, 22, 50, 22, 51, 52, 53, 22, 55,
  438. 56, 91, 55, 56, 92, 283, 93, 71, 71, 97,
  439. 55, 57, 58, 55, 57, 58, 72, 72, 100, 74,
  440. 75, 280, 104, 98, 101, 105, 91, 278, 102, 278,
  441. 74, 76, 75, 74, 75, 55, 279, 58, 55, 114,
  442. 58, 60, 61, 115, 74, 76, 75, 62, 158, 84,
  443. 85, 277, 60, 63, 61, 74, 147, 77, 107, 108,
  444. 84, 86, 87, 84, 85, 148, 109, 149, 276, 74,
  445. 275, 77, 192, 159, 84, 86, 87, 60, 274, 61,
  446. 60, 61, 173, 174, 193, 84, 62, 85, 273, 272,
  447. 225, 60, 63, 61, 226, 147, 147, 119, 120, 84,
  448. 271, 85, 123, 124, 284, 148, 284, 284, 119, 121,
  449. 122, 270, 269, 123, 121, 125, 60, 268, 61, 65,
  450. 66, 278, 67, 278, 267, 281, 266, 265, 264, 263,
  451. 65, 68, 69, 119, 262, 122, 151, 152, 123, 261,
  452. 125, 155, 156, 260, 259, 258, 257, 151, 153, 152,
  453. 256, 255, 155, 153, 156, 65, 254, 69, 65, 66,
  454. 253, 67, 252, 251, 250, 249, 248, 247, 246, 65,
  455. 68, 69, 151, 245, 154, 244, 243, 155, 242, 157,
  456. 241, 240, 239, 238, 237, 236, 235, 234, 233, 232,
  457. 162, 163, 231, 230, 65, 229, 69, 78, 78, 78,
  458. 78, 162, 164, 165, 80, 78, 78, 78, 228, 78,
  459. 227, 78, 78, 78, 224, 78, 223, 222, 81, 221,
  460. 220, 166, 167, 219, 218, 217, 162, 216, 163, 215,
  461. 214, 213, 166, 164, 168, 212, 211, 210, 209, 119,
  462. 120, 208, 78, 78, 78, 82, 78, 78, 78, 78,
  463. 119, 121, 122, 80, 78, 78, 78, 166, 78, 167,
  464. 78, 78, 78, 207, 78, 206, 205, 81, 204, 203,
  465. 202, 201, 200, 123, 124, 119, 199, 122, 198, 197,
  466. 196, 145, 195, 194, 123, 121, 125, 119, 120, 191,
  467. 190, 78, 78, 78, 82, 127, 128, 189, 119, 121,
  468. 122, 129, 188, 119, 120, 187, 127, 130, 128, 123,
  469. 186, 125, 185, 184, 119, 121, 122, 119, 120, 183,
  470. 182, 181, 180, 119, 179, 122, 178, 177, 119, 121,
  471. 122, 127, 176, 128, 131, 132, 175, 172, 171, 119,
  472. 133, 122, 169, 89, 88, 131, 130, 132, 145, 117,
  473. 116, 151, 152, 119, 113, 122, 155, 156, 112, 111,
  474. 110, 106, 151, 153, 152, 103, 99, 155, 153, 156,
  475. 131, 96, 132, 135, 136, 95, 137, 94, 90, 89,
  476. 88, 284, 284, 284, 135, 138, 139, 151, 284, 154,
  477. 151, 152, 155, 284, 157, 151, 152, 284, 284, 284,
  478. 284, 151, 153, 152, 284, 284, 151, 153, 152, 135,
  479. 284, 139, 140, 141, 284, 142, 284, 284, 284, 284,
  480. 284, 284, 284, 140, 138, 143, 151, 284, 154, 151,
  481. 152, 151, 284, 154, 162, 163, 284, 284, 284, 284,
  482. 151, 153, 152, 166, 167, 162, 164, 165, 140, 284,
  483. 143, 127, 128, 284, 166, 164, 168, 129, 284, 284,
  484. 284, 284, 127, 130, 128, 151, 284, 154, 284, 284,
  485. 162, 284, 163, 162, 163, 284, 284, 284, 284, 166,
  486. 284, 167, 162, 163, 162, 164, 165, 127, 284, 128,
  487. 131, 132, 284, 162, 164, 165, 133, 284, 284, 284,
  488. 284, 131, 130, 132, 284, 284, 284, 284, 284, 162,
  489. 284, 163, 162, 163, 284, 284, 284, 284, 162, 284,
  490. 163, 284, 284, 162, 164, 165, 131, 284, 132, 127,
  491. 128, 284, 284, 284, 284, 129, 284, 284, 284, 284,
  492. 127, 130, 128, 284, 284, 284, 284, 284, 162, 284,
  493. 163, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  494. 284, 284, 284, 284, 284, 127, 284, 128, 127, 128,
  495. 284, 284, 284, 284, 129, 284, 284, 284, 284, 127,
  496. 130, 128, 284, 284, 284, 284, 284, 284, 284, 284,
  497. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  498. 284, 284, 284, 284, 127, 284, 128, 127, 128, 284,
  499. 284, 284, 284, 129, 284, 284, 284, 284, 127, 130,
  500. 128, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  501. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  502. 284, 284, 284, 127, 284, 128, 135, 136, 284, 137,
  503. 284, 284, 284, 284, 284, 284, 284, 135, 138, 139,
  504. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  505. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  506. 284, 284, 135, 284, 139, 140, 141, 284, 142, 284,
  507. 284, 284, 284, 284, 284, 284, 140, 138, 143, 284,
  508. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  509. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  510. 284, 140, 284, 143, 135, 136, 284, 137, 284, 284,
  511. 284, 284, 284, 284, 284, 135, 138, 139, 284, 284,
  512. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  513. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  514. 135, 284, 139, 135, 136, 284, 137, 284, 284, 284,
  515. 284, 284, 284, 284, 135, 138, 139, 284, 284, 284,
  516. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  517. 284, 284, 284, 284, 284, 284, 284, 284, 284, 135,
  518. 284, 139, 135, 136, 284, 137, 284, 284, 284, 284,
  519. 284, 284, 284, 135, 138, 139, 284, 284, 284, 284,
  520. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  521. 284, 284, 284, 284, 284, 284, 284, 284, 135, 284,
  522. 139, 135, 136, 284, 137, 284, 284, 284, 284, 284,
  523. 284, 284, 135, 138, 139, 284, 284, 284, 284, 284,
  524. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  525. 284, 284, 284, 284, 284, 284, 284, 135, 284, 139,
  526. 54, 54, 54, 54, 54, 59, 59, 59, 59, 59,
  527. 64, 64, 64, 64, 64, 70, 70, 70, 70, 70,
  528. 73, 73, 73, 73, 73, 79, 79, 79, 79, 79,
  529. 83, 83, 83, 83, 83, 91, 284, 91, 91, 91,
  530. 118, 118, 118, 118, 118, 126, 126, 126, 126, 126,
  531. 134, 134, 134, 134, 134, 144, 144, 144, 144, 146,
  532. 146, 146, 146, 146, 150, 150, 150, 150, 150, 160,
  533. 284, 160, 160, 160, 161, 161, 161, 161, 161, 170,
  534. 284, 170, 170, 170, 91, 91, 91, 282, 282, 282,
  535. 284, 282, 17, 284, 284, 284, 284, 284, 284, 284,
  536. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  537. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  538. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  539. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  540. 284, 284
  541. } ;
  542. static yyconst flex_int16_t yy_chk[1073] =
  543. { 0,
  544. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  545. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  546. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  547. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  548. 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
  549. 3, 24, 4, 4, 29, 282, 29, 9, 10, 37,
  550. 3, 3, 3, 4, 4, 4, 9, 10, 39, 11,
  551. 11, 274, 41, 37, 39, 41, 24, 270, 39, 270,
  552. 11, 11, 11, 12, 12, 3, 273, 3, 4, 48,
  553. 4, 5, 5, 48, 12, 12, 12, 5, 80, 15,
  554. 15, 269, 5, 5, 5, 11, 72, 11, 43, 43,
  555. 15, 15, 15, 16, 16, 72, 43, 72, 268, 12,
  556. 266, 12, 115, 80, 16, 16, 16, 5, 265, 5,
  557. 6, 6, 97, 97, 115, 15, 6, 15, 263, 261,
  558. 201, 6, 6, 6, 201, 146, 148, 54, 54, 16,
  559. 259, 16, 57, 57, 146, 148, 146, 148, 54, 54,
  560. 54, 258, 257, 57, 57, 57, 6, 255, 6, 7,
  561. 7, 278, 7, 278, 253, 278, 252, 251, 249, 247,
  562. 7, 7, 7, 54, 246, 54, 73, 73, 57, 245,
  563. 57, 76, 76, 244, 243, 242, 240, 73, 73, 73,
  564. 239, 238, 76, 76, 76, 7, 237, 7, 8, 8,
  565. 236, 8, 233, 232, 231, 230, 229, 228, 227, 8,
  566. 8, 8, 73, 226, 73, 225, 222, 76, 221, 76,
  567. 220, 219, 218, 217, 216, 215, 214, 213, 211, 210,
  568. 83, 83, 209, 206, 8, 205, 8, 13, 13, 13,
  569. 13, 83, 83, 83, 13, 13, 13, 13, 204, 13,
  570. 202, 13, 13, 13, 200, 13, 198, 197, 13, 196,
  571. 195, 86, 86, 194, 193, 192, 83, 191, 83, 190,
  572. 189, 188, 86, 86, 86, 187, 186, 185, 184, 118,
  573. 118, 183, 13, 13, 13, 13, 14, 14, 14, 14,
  574. 118, 118, 118, 14, 14, 14, 14, 86, 14, 86,
  575. 14, 14, 14, 182, 14, 181, 179, 14, 178, 177,
  576. 176, 175, 174, 121, 121, 118, 173, 118, 172, 171,
  577. 169, 144, 117, 116, 121, 121, 121, 123, 123, 114,
  578. 113, 14, 14, 14, 14, 59, 59, 112, 123, 123,
  579. 123, 59, 111, 124, 124, 110, 59, 59, 59, 121,
  580. 109, 121, 108, 107, 124, 124, 124, 125, 125, 106,
  581. 105, 104, 103, 123, 102, 123, 101, 100, 125, 125,
  582. 125, 59, 99, 59, 63, 63, 98, 96, 95, 124,
  583. 63, 124, 90, 89, 88, 63, 63, 63, 70, 50,
  584. 49, 150, 150, 125, 47, 125, 153, 153, 46, 45,
  585. 44, 42, 150, 150, 150, 40, 38, 153, 153, 153,
  586. 63, 36, 63, 64, 64, 35, 64, 32, 23, 21,
  587. 19, 17, 0, 0, 64, 64, 64, 150, 0, 150,
  588. 155, 155, 153, 0, 153, 156, 156, 0, 0, 0,
  589. 0, 155, 155, 155, 0, 0, 156, 156, 156, 64,
  590. 0, 64, 68, 68, 0, 68, 0, 0, 0, 0,
  591. 0, 0, 0, 68, 68, 68, 155, 0, 155, 157,
  592. 157, 156, 0, 156, 161, 161, 0, 0, 0, 0,
  593. 157, 157, 157, 164, 164, 161, 161, 161, 68, 0,
  594. 68, 126, 126, 0, 164, 164, 164, 126, 0, 0,
  595. 0, 0, 126, 126, 126, 157, 0, 157, 0, 0,
  596. 161, 0, 161, 166, 166, 0, 0, 0, 0, 164,
  597. 0, 164, 167, 167, 166, 166, 166, 126, 0, 126,
  598. 130, 130, 0, 167, 167, 167, 130, 0, 0, 0,
  599. 0, 130, 130, 130, 0, 0, 0, 0, 0, 166,
  600. 0, 166, 168, 168, 0, 0, 0, 0, 167, 0,
  601. 167, 0, 0, 168, 168, 168, 130, 0, 130, 131,
  602. 131, 0, 0, 0, 0, 131, 0, 0, 0, 0,
  603. 131, 131, 131, 0, 0, 0, 0, 0, 168, 0,
  604. 168, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  605. 0, 0, 0, 0, 0, 131, 0, 131, 132, 132,
  606. 0, 0, 0, 0, 132, 0, 0, 0, 0, 132,
  607. 132, 132, 0, 0, 0, 0, 0, 0, 0, 0,
  608. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  609. 0, 0, 0, 0, 132, 0, 132, 133, 133, 0,
  610. 0, 0, 0, 133, 0, 0, 0, 0, 133, 133,
  611. 133, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  612. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  613. 0, 0, 0, 133, 0, 133, 134, 134, 0, 134,
  614. 0, 0, 0, 0, 0, 0, 0, 134, 134, 134,
  615. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  616. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  617. 0, 0, 134, 0, 134, 138, 138, 0, 138, 0,
  618. 0, 0, 0, 0, 0, 0, 138, 138, 138, 0,
  619. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  620. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  621. 0, 138, 0, 138, 140, 140, 0, 140, 0, 0,
  622. 0, 0, 0, 0, 0, 140, 140, 140, 0, 0,
  623. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  624. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  625. 140, 0, 140, 141, 141, 0, 141, 0, 0, 0,
  626. 0, 0, 0, 0, 141, 141, 141, 0, 0, 0,
  627. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  628. 0, 0, 0, 0, 0, 0, 0, 0, 0, 141,
  629. 0, 141, 142, 142, 0, 142, 0, 0, 0, 0,
  630. 0, 0, 0, 142, 142, 142, 0, 0, 0, 0,
  631. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  632. 0, 0, 0, 0, 0, 0, 0, 0, 142, 0,
  633. 142, 143, 143, 0, 143, 0, 0, 0, 0, 0,
  634. 0, 0, 143, 143, 143, 0, 0, 0, 0, 0,
  635. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  636. 0, 0, 0, 0, 0, 0, 0, 143, 0, 143,
  637. 285, 285, 285, 285, 285, 286, 286, 286, 286, 286,
  638. 287, 287, 287, 287, 287, 288, 288, 288, 288, 288,
  639. 289, 289, 289, 289, 289, 290, 290, 290, 290, 290,
  640. 291, 291, 291, 291, 291, 292, 0, 292, 292, 292,
  641. 293, 293, 293, 293, 293, 294, 294, 294, 294, 294,
  642. 295, 295, 295, 295, 295, 296, 296, 296, 296, 297,
  643. 297, 297, 297, 297, 298, 298, 298, 298, 298, 299,
  644. 0, 299, 299, 299, 300, 300, 300, 300, 300, 301,
  645. 0, 301, 301, 301, 302, 302, 302, 303, 303, 303,
  646. 0, 303, 284, 284, 284, 284, 284, 284, 284, 284,
  647. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  648. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  649. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  650. 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
  651. 284, 284
  652. } ;
  653. /* The intent behind this definition is that it'll catch
  654. * any uses of REJECT which flex missed.
  655. */
  656. #define REJECT reject_used_but_not_detected
  657. #define yymore() (yyg->yy_more_flag = 1)
  658. #define YY_MORE_ADJ yyg->yy_more_len
  659. #define YY_RESTORE_YY_MORE_OFFSET
  660. #line 1 "ael.flex"
  661. /*
  662. * Asterisk -- An open source telephony toolkit.
  663. *
  664. * Copyright (C) 2006, Digium, Inc.
  665. *
  666. * Steve Murphy <murf@parsetree.com>
  667. *
  668. * See http://www.asterisk.org for more information about
  669. * the Asterisk project. Please do not directly contact
  670. * any of the maintainers of this project for assistance;
  671. * the project provides a web site, mailing lists and IRC
  672. * channels for your use.
  673. *
  674. * This program is free software, distributed under the terms of
  675. * the GNU General Public License Version 2. See the LICENSE file
  676. * at the top of the source tree.
  677. */
  678. /*! \file
  679. *
  680. * \brief Flex scanner description of tokens used in AEL2 .
  681. *
  682. */
  683. /*
  684. * Start with flex options:
  685. *
  686. * %x describes the contexts we have: paren, semic and argg, plus INITIAL
  687. */
  688. /* prefix used for various globally-visible functions and variables.
  689. * This renames also ael_yywrap, but since we do not use it, we just
  690. * add option noyywrap to remove it.
  691. */
  692. /* I specify this option to suppress flex generating code with ECHO
  693. in it. This generates compiler warnings in some systems; We've
  694. seen the fwrite generate Unused variable warnings with 4.1.2 gcc.
  695. Some systems have tweaked flex ECHO macro to keep the compiler
  696. happy. To keep the warning message from getting output, I added
  697. a default rule at the end of the patterns section */
  698. /* ael_yyfree normally just frees its arg. It can be null sometimes,
  699. which some systems will complain about, so, we'll define our own version */
  700. /* batch gives a bit more performance if we are using it in
  701. * a non-interactive mode. We probably don't care much.
  702. */
  703. /* outfile is the filename to be used instead of lex.yy.c */
  704. /*
  705. * These are not supported in flex 2.5.4, but we need them
  706. * at the moment:
  707. * reentrant produces a thread-safe parser. Not 100% sure that
  708. * we require it, though.
  709. * bison-bridge passes an additional yylval argument to ael_yylex().
  710. * bison-locations is probably not needed.
  711. */
  712. #line 71 "ael.flex"
  713. #include <sys/types.h>
  714. #include <sys/stat.h>
  715. #include <unistd.h>
  716. #include <glob.h>
  717. #if !defined(GLOB_ABORTED)
  718. #define GLOB_ABORTED GLOB_ABEND
  719. #endif
  720. #if !defined(GLOB_BRACE)
  721. #define GLOB_BRACE 0
  722. #endif
  723. #if !defined(GLOB_NOMAGIC)
  724. #define GLOB_NOMAGIC 0
  725. #endif
  726. #include "asterisk/logger.h"
  727. #include "asterisk/utils.h"
  728. #include "asterisk/lock.h"
  729. #include "asterisk/hashtab.h"
  730. #include "ael/ael.tab.h"
  731. #include "asterisk/ael_structs.h"
  732. /*
  733. * A stack to keep track of matching brackets ( [ { } ] )
  734. */
  735. static char pbcstack[400]; /* XXX missing size checks */
  736. static int pbcpos = 0;
  737. static void pbcpush(char x);
  738. static int pbcpop(char x);
  739. static int parencount = 0;
  740. /*
  741. * A similar stack to keep track of matching brackets ( [ { } ] ) in word tokens surrounded by ${ ... }
  742. */
  743. static char pbcstack2[400]; /* XXX missing size checks */
  744. static int pbcpos2 = 0;
  745. static void pbcpush2(char x);
  746. static int pbcpop2(char x);
  747. static int parencount2 = 0;
  748. /*
  749. * A similar stack to keep track of matching brackets ( [ { } ] ) in word tokens surrounded by $[ ... ]
  750. */
  751. static char pbcstack3[400]; /* XXX missing size checks */
  752. static int pbcpos3 = 0;
  753. static void pbcpush3(char x);
  754. static int pbcpop3(char x);
  755. static int parencount3 = 0;
  756. /*
  757. * current line, column and filename, updated as we read the input.
  758. */
  759. static int my_lineno = 1; /* current line in the source */
  760. static int my_col = 1; /* current column in the source */
  761. char *my_file = 0; /* used also in the bison code */
  762. char *prev_word; /* XXX document it */
  763. #define MAX_INCLUDE_DEPTH 50
  764. /*
  765. * flex is not too smart, and generates global functions
  766. * without prototypes so the compiler may complain.
  767. * To avoid that, we declare the prototypes here,
  768. * even though these functions are not used.
  769. */
  770. int ael_yyget_column (yyscan_t yyscanner);
  771. void ael_yyset_column (int column_no , yyscan_t yyscanner);
  772. int ael_yyparse (struct parse_io *);
  773. /*
  774. * A stack to process include files.
  775. * As we switch into the new file we need to store the previous
  776. * state to restore it later.
  777. */
  778. struct stackelement {
  779. char *fname;
  780. int lineno;
  781. int colno;
  782. glob_t globbuf; /* the current globbuf */
  783. int globbuf_pos; /* where we are in the current globbuf */
  784. YY_BUFFER_STATE bufstate;
  785. };
  786. static struct stackelement include_stack[MAX_INCLUDE_DEPTH];
  787. static int include_stack_index = 0;
  788. static void setup_filestack(char *fnamebuf, int fnamebuf_siz, glob_t *globbuf, int globpos, yyscan_t xscan, int create);
  789. /*
  790. * if we use the @n feature of bison, we must supply the start/end
  791. * location of tokens in the structure pointed by yylloc.
  792. * Simple tokens are just assumed to be on the same line, so
  793. * the line number is constant, and the column is incremented
  794. * by the length of the token.
  795. */
  796. #ifdef FLEX_BETA /* set for 2.5.33 */
  797. /* compute the total number of lines and columns in the text
  798. * passed as argument.
  799. */
  800. static void pbcwhere(const char *text, int *line, int *col )
  801. {
  802. int loc_line = *line;
  803. int loc_col = *col;
  804. char c;
  805. while ( (c = *text++) ) {
  806. if ( c == '\t' ) {
  807. loc_col += 8 - (loc_col % 8);
  808. } else if ( c == '\n' ) {
  809. loc_line++;
  810. loc_col = 1;
  811. } else
  812. loc_col++;
  813. }
  814. *line = loc_line;
  815. *col = loc_col;
  816. }
  817. #define STORE_POS do { \
  818. yylloc->first_line = yylloc->last_line = my_lineno; \
  819. yylloc->first_column=my_col; \
  820. yylloc->last_column=my_col+yyleng-1; \
  821. my_col+=yyleng; \
  822. } while (0)
  823. #define STORE_LOC do { \
  824. yylloc->first_line = my_lineno; \
  825. yylloc->first_column=my_col; \
  826. pbcwhere(yytext, &my_lineno, &my_col); \
  827. yylloc->last_line = my_lineno; \
  828. yylloc->last_column = my_col - 1; \
  829. } while (0)
  830. #else
  831. #define STORE_POS
  832. #define STORE_LOC
  833. #endif
  834. #line 957 "ael_lex.c"
  835. #define INITIAL 0
  836. #define paren 1
  837. #define semic 2
  838. #define argg 3
  839. #define comment 4
  840. #define curlystate 5
  841. #define wordstate 6
  842. #define brackstate 7
  843. #ifndef YY_NO_UNISTD_H
  844. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  845. * down here because we want the user's section 1 to have been scanned first.
  846. * The user has a chance to override it with an option.
  847. */
  848. #include <unistd.h>
  849. #endif
  850. #ifndef YY_EXTRA_TYPE
  851. #define YY_EXTRA_TYPE void *
  852. #endif
  853. /* Holds the entire state of the reentrant scanner. */
  854. struct yyguts_t
  855. {
  856. /* User-defined. Not touched by flex. */
  857. YY_EXTRA_TYPE yyextra_r;
  858. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  859. FILE *yyin_r, *yyout_r;
  860. size_t yy_buffer_stack_top; /**< index of top of stack. */
  861. size_t yy_buffer_stack_max; /**< capacity of stack. */
  862. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  863. char yy_hold_char;
  864. int yy_n_chars;
  865. int yyleng_r;
  866. char *yy_c_buf_p;
  867. int yy_init;
  868. int yy_start;
  869. int yy_did_buffer_switch_on_eof;
  870. int yy_start_stack_ptr;
  871. int yy_start_stack_depth;
  872. int *yy_start_stack;
  873. yy_state_type yy_last_accepting_state;
  874. char* yy_last_accepting_cpos;
  875. int yylineno_r;
  876. int yy_flex_debug_r;
  877. char *yytext_r;
  878. int yy_more_flag;
  879. int yy_more_len;
  880. YYSTYPE * yylval_r;
  881. YYLTYPE * yylloc_r;
  882. }; /* end struct yyguts_t */
  883. static int yy_init_globals (yyscan_t yyscanner );
  884. /* This must go here because YYSTYPE and YYLTYPE are included
  885. * from bison output in section 1.*/
  886. # define yylval yyg->yylval_r
  887. # define yylloc yyg->yylloc_r
  888. int ael_yylex_init (yyscan_t* scanner);
  889. int ael_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
  890. /* Accessor methods to globals.
  891. These are made visible to non-reentrant scanners for convenience. */
  892. int ael_yylex_destroy (yyscan_t yyscanner );
  893. int ael_yyget_debug (yyscan_t yyscanner );
  894. void ael_yyset_debug (int debug_flag ,yyscan_t yyscanner );
  895. YY_EXTRA_TYPE ael_yyget_extra (yyscan_t yyscanner );
  896. void ael_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
  897. FILE *ael_yyget_in (yyscan_t yyscanner );
  898. void ael_yyset_in (FILE * in_str ,yyscan_t yyscanner );
  899. FILE *ael_yyget_out (yyscan_t yyscanner );
  900. void ael_yyset_out (FILE * out_str ,yyscan_t yyscanner );
  901. int ael_yyget_leng (yyscan_t yyscanner );
  902. char *ael_yyget_text (yyscan_t yyscanner );
  903. int ael_yyget_lineno (yyscan_t yyscanner );
  904. void ael_yyset_lineno (int line_number ,yyscan_t yyscanner );
  905. YYSTYPE * ael_yyget_lval (yyscan_t yyscanner );
  906. void ael_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
  907. YYLTYPE *ael_yyget_lloc (yyscan_t yyscanner );
  908. void ael_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
  909. /* Macros after this point can all be overridden by user definitions in
  910. * section 1.
  911. */
  912. #ifndef YY_SKIP_YYWRAP
  913. #ifdef __cplusplus
  914. extern "C" int ael_yywrap (yyscan_t yyscanner );
  915. #else
  916. extern int ael_yywrap (yyscan_t yyscanner );
  917. #endif
  918. #endif
  919. static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
  920. #ifndef yytext_ptr
  921. static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
  922. #endif
  923. #ifdef YY_NEED_STRLEN
  924. static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
  925. #endif
  926. #ifndef YY_NO_INPUT
  927. #ifdef __cplusplus
  928. static int yyinput (yyscan_t yyscanner );
  929. #else
  930. static int input (yyscan_t yyscanner );
  931. #endif
  932. #endif
  933. /* Amount of stuff to slurp up with each read. */
  934. #ifndef YY_READ_BUF_SIZE
  935. #define YY_READ_BUF_SIZE 8192
  936. #endif
  937. /* Copy whatever the last rule matched to the standard output. */
  938. #ifndef ECHO
  939. /* This used to be an fputs(), but since the string might contain NUL's,
  940. * we now use fwrite().
  941. */
  942. #define ECHO fwrite( yytext, yyleng, 1, yyout )
  943. #endif
  944. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  945. * is returned in "result".
  946. */
  947. #ifndef YY_INPUT
  948. #define YY_INPUT(buf,result,max_size) \
  949. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  950. { \
  951. int c = '*'; \
  952. int n; \
  953. for ( n = 0; n < max_size && \
  954. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  955. buf[n] = (char) c; \
  956. if ( c == '\n' ) \
  957. buf[n++] = (char) c; \
  958. if ( c == EOF && ferror( yyin ) ) \
  959. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  960. result = n; \
  961. } \
  962. else \
  963. { \
  964. errno=0; \
  965. while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  966. { \
  967. if( errno != EINTR) \
  968. { \
  969. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  970. break; \
  971. } \
  972. errno=0; \
  973. clearerr(yyin); \
  974. } \
  975. }\
  976. \
  977. #endif
  978. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  979. * we don't want an extra ';' after the "return" because that will cause
  980. * some compilers to complain about unreachable statements.
  981. */
  982. #ifndef yyterminate
  983. #define yyterminate() return YY_NULL
  984. #endif
  985. /* Number of entries by which start-condition stack grows. */
  986. #ifndef YY_START_STACK_INCR
  987. #define YY_START_STACK_INCR 25
  988. #endif
  989. /* Report a fatal error. */
  990. #ifndef YY_FATAL_ERROR
  991. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  992. #endif
  993. /* end tables serialization structures and prototypes */
  994. /* Default declaration of generated scanner - a define so the user can
  995. * easily add parameters.
  996. */
  997. #ifndef YY_DECL
  998. #define YY_DECL_IS_OURS 1
  999. extern int ael_yylex \
  1000. (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
  1001. #define YY_DECL int ael_yylex \
  1002. (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
  1003. #endif /* !YY_DECL */
  1004. /* Code executed at the beginning of each rule, after yytext and yyleng
  1005. * have been set up.
  1006. */
  1007. #ifndef YY_USER_ACTION
  1008. #define YY_USER_ACTION
  1009. #endif
  1010. /* Code executed at the end of each rule. */
  1011. #ifndef YY_BREAK
  1012. #define YY_BREAK break;
  1013. #endif
  1014. #define YY_RULE_SETUP \
  1015. YY_USER_ACTION
  1016. /** The main scanner function which does all the work.
  1017. */
  1018. YY_DECL
  1019. {
  1020. register yy_state_type yy_current_state;
  1021. register char *yy_cp, *yy_bp;
  1022. register int yy_act;
  1023. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1024. #line 220 "ael.flex"
  1025. #line 1208 "ael_lex.c"
  1026. yylval = yylval_param;
  1027. yylloc = yylloc_param;
  1028. if ( !yyg->yy_init )
  1029. {
  1030. yyg->yy_init = 1;
  1031. #ifdef YY_USER_INIT
  1032. YY_USER_INIT;
  1033. #endif
  1034. if ( ! yyg->yy_start )
  1035. yyg->yy_start = 1; /* first start state */
  1036. if ( ! yyin )
  1037. yyin = stdin;
  1038. if ( ! yyout )
  1039. yyout = stdout;
  1040. if ( ! YY_CURRENT_BUFFER ) {
  1041. ael_yyensure_buffer_stack (yyscanner);
  1042. YY_CURRENT_BUFFER_LVALUE =
  1043. ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  1044. }
  1045. ael_yy_load_buffer_state(yyscanner );
  1046. }
  1047. while ( 1 ) /* loops until end-of-file is reached */
  1048. {
  1049. yyg->yy_more_len = 0;
  1050. if ( yyg->yy_more_flag )
  1051. {
  1052. yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
  1053. yyg->yy_more_flag = 0;
  1054. }
  1055. yy_cp = yyg->yy_c_buf_p;
  1056. /* Support of yytext. */
  1057. *yy_cp = yyg->yy_hold_char;
  1058. /* yy_bp points to the position in yy_ch_buf of the start of
  1059. * the current run.
  1060. */
  1061. yy_bp = yy_cp;
  1062. yy_current_state = yyg->yy_start;
  1063. yy_match:
  1064. do
  1065. {
  1066. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  1067. if ( yy_accept[yy_current_state] )
  1068. {
  1069. yyg->yy_last_accepting_state = yy_current_state;
  1070. yyg->yy_last_accepting_cpos = yy_cp;
  1071. }
  1072. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1073. {
  1074. yy_current_state = (int) yy_def[yy_current_state];
  1075. if ( yy_current_state >= 285 )
  1076. yy_c = yy_meta[(unsigned int) yy_c];
  1077. }
  1078. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1079. ++yy_cp;
  1080. }
  1081. while ( yy_current_state != 284 );
  1082. yy_cp = yyg->yy_last_accepting_cpos;
  1083. yy_current_state = yyg->yy_last_accepting_state;
  1084. yy_find_action:
  1085. yy_act = yy_accept[yy_current_state];
  1086. YY_DO_BEFORE_ACTION;
  1087. do_action: /* This label is used only to access EOF actions. */
  1088. switch ( yy_act )
  1089. { /* beginning of action switch */
  1090. case 0: /* must back up */
  1091. /* undo the effects of YY_DO_BEFORE_ACTION */
  1092. *yy_cp = yyg->yy_hold_char;
  1093. yy_cp = yyg->yy_last_accepting_cpos;
  1094. yy_current_state = yyg->yy_last_accepting_state;
  1095. goto yy_find_action;
  1096. case 1:
  1097. YY_RULE_SETUP
  1098. #line 222 "ael.flex"
  1099. { STORE_POS; return LC;}
  1100. YY_BREAK
  1101. case 2:
  1102. YY_RULE_SETUP
  1103. #line 223 "ael.flex"
  1104. { STORE_POS; return RC;}
  1105. YY_BREAK
  1106. case 3:
  1107. YY_RULE_SETUP
  1108. #line 224 "ael.flex"
  1109. { STORE_POS; return LP;}
  1110. YY_BREAK
  1111. case 4:
  1112. YY_RULE_SETUP
  1113. #line 225 "ael.flex"
  1114. { STORE_POS; return RP;}
  1115. YY_BREAK
  1116. case 5:
  1117. YY_RULE_SETUP
  1118. #line 226 "ael.flex"
  1119. { STORE_POS; return SEMI;}
  1120. YY_BREAK
  1121. case 6:
  1122. YY_RULE_SETUP
  1123. #line 227 "ael.flex"
  1124. { STORE_POS; return EQ;}
  1125. YY_BREAK
  1126. case 7:
  1127. YY_RULE_SETUP
  1128. #line 228 "ael.flex"
  1129. { STORE_POS; return COMMA;}
  1130. YY_BREAK
  1131. case 8:
  1132. YY_RULE_SETUP
  1133. #line 229 "ael.flex"
  1134. { STORE_POS; return COLON;}
  1135. YY_BREAK
  1136. case 9:
  1137. YY_RULE_SETUP
  1138. #line 230 "ael.flex"
  1139. { STORE_POS; return AMPER;}
  1140. YY_BREAK
  1141. case 10:
  1142. YY_RULE_SETUP
  1143. #line 231 "ael.flex"
  1144. { STORE_POS; return BAR;}
  1145. YY_BREAK
  1146. case 11:
  1147. YY_RULE_SETUP
  1148. #line 232 "ael.flex"
  1149. { STORE_POS; return EXTENMARK;}
  1150. YY_BREAK
  1151. case 12:
  1152. YY_RULE_SETUP
  1153. #line 233 "ael.flex"
  1154. { STORE_POS; return AT;}
  1155. YY_BREAK
  1156. case 13:
  1157. YY_RULE_SETUP
  1158. #line 234 "ael.flex"
  1159. {/*comment*/}
  1160. YY_BREAK
  1161. case 14:
  1162. YY_RULE_SETUP
  1163. #line 235 "ael.flex"
  1164. { STORE_POS; return KW_CONTEXT;}
  1165. YY_BREAK
  1166. case 15:
  1167. YY_RULE_SETUP
  1168. #line 236 "ael.flex"
  1169. { STORE_POS; return KW_ABSTRACT;}
  1170. YY_BREAK
  1171. case 16:
  1172. YY_RULE_SETUP
  1173. #line 237 "ael.flex"
  1174. { STORE_POS; return KW_EXTEND;}
  1175. YY_BREAK
  1176. case 17:
  1177. YY_RULE_SETUP
  1178. #line 238 "ael.flex"
  1179. { STORE_POS; return KW_MACRO;};
  1180. YY_BREAK
  1181. case 18:
  1182. YY_RULE_SETUP
  1183. #line 239 "ael.flex"
  1184. { STORE_POS; return KW_GLOBALS;}
  1185. YY_BREAK
  1186. case 19:
  1187. YY_RULE_SETUP
  1188. #line 240 "ael.flex"
  1189. { STORE_POS; return KW_LOCAL;}
  1190. YY_BREAK
  1191. case 20:
  1192. YY_RULE_SETUP
  1193. #line 241 "ael.flex"
  1194. { STORE_POS; return KW_IGNOREPAT;}
  1195. YY_BREAK
  1196. case 21:
  1197. YY_RULE_SETUP
  1198. #line 242 "ael.flex"
  1199. { STORE_POS; return KW_SWITCH;}
  1200. YY_BREAK
  1201. case 22:
  1202. YY_RULE_SETUP
  1203. #line 243 "ael.flex"
  1204. { STORE_POS; return KW_IF;}
  1205. YY_BREAK
  1206. case 23:
  1207. YY_RULE_SETUP
  1208. #line 244 "ael.flex"
  1209. { STORE_POS; return KW_IFTIME;}
  1210. YY_BREAK
  1211. case 24:
  1212. YY_RULE_SETUP
  1213. #line 245 "ael.flex"
  1214. { STORE_POS; return KW_RANDOM;}
  1215. YY_BREAK
  1216. case 25:
  1217. YY_RULE_SETUP
  1218. #line 246 "ael.flex"
  1219. { STORE_POS; return KW_REGEXTEN;}
  1220. YY_BREAK
  1221. case 26:
  1222. YY_RULE_SETUP
  1223. #line 247 "ael.flex"
  1224. { STORE_POS; return KW_HINT;}
  1225. YY_BREAK
  1226. case 27:
  1227. YY_RULE_SETUP
  1228. #line 248 "ael.flex"
  1229. { STORE_POS; return KW_ELSE;}
  1230. YY_BREAK
  1231. case 28:
  1232. YY_RULE_SETUP
  1233. #line 249 "ael.flex"
  1234. { STORE_POS; return KW_GOTO;}
  1235. YY_BREAK
  1236. case 29:
  1237. YY_RULE_SETUP
  1238. #line 250 "ael.flex"
  1239. { STORE_POS; return KW_JUMP;}
  1240. YY_BREAK
  1241. case 30:
  1242. YY_RULE_SETUP
  1243. #line 251 "ael.flex"
  1244. { STORE_POS; return KW_RETURN;}
  1245. YY_BREAK
  1246. case 31:
  1247. YY_RULE_SETUP
  1248. #line 252 "ael.flex"
  1249. { STORE_POS; return KW_BREAK;}
  1250. YY_BREAK
  1251. case 32:
  1252. YY_RULE_SETUP
  1253. #line 253 "ael.flex"
  1254. { STORE_POS; return KW_CONTINUE;}
  1255. YY_BREAK
  1256. case 33:
  1257. YY_RULE_SETUP
  1258. #line 254 "ael.flex"
  1259. { STORE_POS; return KW_FOR;}
  1260. YY_BREAK
  1261. case 34:
  1262. YY_RULE_SETUP
  1263. #line 255 "ael.flex"
  1264. { STORE_POS; return KW_WHILE;}
  1265. YY_BREAK
  1266. case 35:
  1267. YY_RULE_SETUP
  1268. #line 256 "ael.flex"
  1269. { STORE_POS; return KW_CASE;}
  1270. YY_BREAK
  1271. case 36:
  1272. YY_RULE_SETUP
  1273. #line 257 "ael.flex"
  1274. { STORE_POS; return KW_DEFAULT;}
  1275. YY_BREAK
  1276. case 37:
  1277. YY_RULE_SETUP
  1278. #line 258 "ael.flex"
  1279. { STORE_POS; return KW_PATTERN;}
  1280. YY_BREAK
  1281. case 38:
  1282. YY_RULE_SETUP
  1283. #line 259 "ael.flex"
  1284. { STORE_POS; return KW_CATCH;}
  1285. YY_BREAK
  1286. case 39:
  1287. YY_RULE_SETUP
  1288. #line 260 "ael.flex"
  1289. { STORE_POS; return KW_SWITCHES;}
  1290. YY_BREAK
  1291. case 40:
  1292. YY_RULE_SETUP
  1293. #line 261 "ael.flex"
  1294. { STORE_POS; return KW_ESWITCHES;}
  1295. YY_BREAK
  1296. case 41:
  1297. YY_RULE_SETUP
  1298. #line 262 "ael.flex"
  1299. { STORE_POS; return KW_INCLUDES;}
  1300. YY_BREAK
  1301. case 42:
  1302. YY_RULE_SETUP
  1303. #line 263 "ael.flex"
  1304. { BEGIN(comment); my_col += 2; }
  1305. YY_BREAK
  1306. case 43:
  1307. YY_RULE_SETUP
  1308. #line 265 "ael.flex"
  1309. { my_col += yyleng; }
  1310. YY_BREAK
  1311. case 44:
  1312. /* rule 44 can match eol */
  1313. YY_RULE_SETUP
  1314. #line 266 "ael.flex"
  1315. { ++my_lineno; my_col=1;}
  1316. YY_BREAK
  1317. case 45:
  1318. YY_RULE_SETUP
  1319. #line 267 "ael.flex"
  1320. { my_col += yyleng; }
  1321. YY_BREAK
  1322. case 46:
  1323. /* rule 46 can match eol */
  1324. YY_RULE_SETUP
  1325. #line 268 "ael.flex"
  1326. { ++my_lineno; my_col=1;}
  1327. YY_BREAK
  1328. case 47:
  1329. YY_RULE_SETUP
  1330. #line 269 "ael.flex"
  1331. { my_col += 2; BEGIN(INITIAL); } /* the nice thing about comments is that you know exactly what ends them */
  1332. YY_BREAK
  1333. case 48:
  1334. /* rule 48 can match eol */
  1335. YY_RULE_SETUP
  1336. #line 271 "ael.flex"
  1337. { my_lineno++; my_col = 1; }
  1338. YY_BREAK
  1339. case 49:
  1340. YY_RULE_SETUP
  1341. #line 272 "ael.flex"
  1342. { my_col += yyleng; }
  1343. YY_BREAK
  1344. case 50:
  1345. YY_RULE_SETUP
  1346. #line 273 "ael.flex"
  1347. { my_col += (yyleng*8)-(my_col%8); }
  1348. YY_BREAK
  1349. case 51:
  1350. YY_RULE_SETUP
  1351. #line 275 "ael.flex"
  1352. {
  1353. /* boy did I open a can of worms when I changed the lexical token "word".
  1354. all the above keywords can be used as a beginning to a "word".-
  1355. before, a "word" would match a longer sequence than the above
  1356. keywords, and all would be well. But now "word" is a single char
  1357. and feeds into a statemachine sort of sequence from there on. So...
  1358. I added the {KEYWORD}? to the beginning of the word match sequence */
  1359. if (!strcmp(yytext,"${")) {
  1360. parencount2 = 0;
  1361. pbcpos2 = 0;
  1362. pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */
  1363. BEGIN(curlystate);
  1364. yymore();
  1365. } else if (!strcmp(yytext,"$[")) {
  1366. parencount3 = 0;
  1367. pbcpos3 = 0;
  1368. pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */
  1369. BEGIN(brackstate);
  1370. yymore();
  1371. } else {
  1372. BEGIN(wordstate);
  1373. yymore();
  1374. }
  1375. }
  1376. YY_BREAK
  1377. case 52:
  1378. YY_RULE_SETUP
  1379. #line 301 "ael.flex"
  1380. { yymore(); /* Keep going */ }
  1381. YY_BREAK
  1382. case 53:
  1383. YY_RULE_SETUP
  1384. #line 302 "ael.flex"
  1385. { yymore(); /* Keep going */ }
  1386. YY_BREAK
  1387. case 54:
  1388. YY_RULE_SETUP
  1389. #line 303 "ael.flex"
  1390. { yymore(); /* Keep Going */ }
  1391. YY_BREAK
  1392. case 55:
  1393. YY_RULE_SETUP
  1394. #line 304 "ael.flex"
  1395. { /* the beginning of a ${} construct. prepare and pop into curlystate */
  1396. parencount2 = 0;
  1397. pbcpos2 = 0;
  1398. pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */
  1399. BEGIN(curlystate);
  1400. yymore();
  1401. }
  1402. YY_BREAK
  1403. case 56:
  1404. YY_RULE_SETUP
  1405. #line 311 "ael.flex"
  1406. { /* the beginning of a $[] construct. prepare and pop into brackstate */
  1407. parencount3 = 0;
  1408. pbcpos3 = 0;
  1409. pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */
  1410. BEGIN(brackstate);
  1411. yymore();
  1412. }
  1413. YY_BREAK
  1414. case 57:
  1415. /* rule 57 can match eol */
  1416. YY_RULE_SETUP
  1417. #line 318 "ael.flex"
  1418. {
  1419. /* a non-word constituent char, like a space, tab, curly, paren, etc */
  1420. char c = yytext[yyleng-1];
  1421. STORE_POS;
  1422. yylval->str = malloc(yyleng);
  1423. strncpy(yylval->str, yytext, yyleng);
  1424. yylval->str[yyleng-1] = 0;
  1425. unput(c); /* put this ending char back in the stream */
  1426. BEGIN(0);
  1427. return word;
  1428. }
  1429. YY_BREAK
  1430. case 58:
  1431. /* rule 58 can match eol */
  1432. YY_RULE_SETUP
  1433. #line 331 "ael.flex"
  1434. {
  1435. if ( pbcpop2('}') ) { /* error */
  1436. STORE_LOC;
  1437. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
  1438. BEGIN(0);
  1439. yylval->str = malloc(yyleng+1);
  1440. strncpy(yylval->str, yytext, yyleng);
  1441. yylval->str[yyleng] = 0;
  1442. return word;
  1443. }
  1444. parencount2--;
  1445. if ( parencount2 >= 0) {
  1446. yymore();
  1447. } else {
  1448. BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */
  1449. yymore();
  1450. }
  1451. }
  1452. YY_BREAK
  1453. case 59:
  1454. /* rule 59 can match eol */
  1455. YY_RULE_SETUP
  1456. #line 350 "ael.flex"
  1457. {
  1458. char c = yytext[yyleng-1];
  1459. if (c == '{')
  1460. parencount2++;
  1461. pbcpush2(c);
  1462. yymore();
  1463. }
  1464. YY_BREAK
  1465. case 60:
  1466. /* rule 60 can match eol */
  1467. YY_RULE_SETUP
  1468. #line 358 "ael.flex"
  1469. {
  1470. char c = yytext[yyleng-1];
  1471. if ( pbcpop2(c)) { /* error */
  1472. STORE_LOC;
  1473. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
  1474. my_file, my_lineno, my_col, c);
  1475. BEGIN(0);
  1476. yylval->str = malloc(yyleng+1);
  1477. strncpy(yylval->str, yytext, yyleng);
  1478. yylval->str[yyleng] = 0;
  1479. return word;
  1480. }
  1481. yymore();
  1482. }
  1483. YY_BREAK
  1484. case 61:
  1485. /* rule 61 can match eol */
  1486. YY_RULE_SETUP
  1487. #line 374 "ael.flex"
  1488. {
  1489. if ( pbcpop3(']') ) { /* error */
  1490. STORE_LOC;
  1491. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
  1492. BEGIN(0);
  1493. yylval->str = malloc(yyleng+1);
  1494. strncpy(yylval->str, yytext, yyleng);
  1495. yylval->str[yyleng] = 0;
  1496. return word;
  1497. }
  1498. parencount3--;
  1499. if ( parencount3 >= 0) {
  1500. yymore();
  1501. } else {
  1502. BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */
  1503. yymore();
  1504. }
  1505. }
  1506. YY_BREAK
  1507. case 62:
  1508. /* rule 62 can match eol */
  1509. YY_RULE_SETUP
  1510. #line 393 "ael.flex"
  1511. {
  1512. char c = yytext[yyleng-1];
  1513. if (c == '[')
  1514. parencount3++;
  1515. pbcpush3(c);
  1516. yymore();
  1517. }
  1518. YY_BREAK
  1519. case 63:
  1520. /* rule 63 can match eol */
  1521. YY_RULE_SETUP
  1522. #line 401 "ael.flex"
  1523. {
  1524. char c = yytext[yyleng-1];
  1525. if ( pbcpop3(c)) { /* error */
  1526. STORE_LOC;
  1527. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
  1528. my_file, my_lineno, my_col, c);
  1529. BEGIN(0);
  1530. yylval->str = malloc(yyleng+1);
  1531. strncpy(yylval->str, yytext, yyleng);
  1532. yylval->str[yyleng] = 0;
  1533. return word;
  1534. }
  1535. yymore();
  1536. }
  1537. YY_BREAK
  1538. /*
  1539. * context used for arguments of if_head, random_head, switch_head,
  1540. * for (last statement), while (XXX why not iftime_head ?).
  1541. * End with the matching parentheses.
  1542. * A comma at the top level is valid here, unlike in argg where it
  1543. * is an argument separator so it must be returned as a token.
  1544. */
  1545. case 64:
  1546. /* rule 64 can match eol */
  1547. YY_RULE_SETUP
  1548. #line 424 "ael.flex"
  1549. {
  1550. if ( pbcpop(')') ) { /* error */
  1551. STORE_LOC;
  1552. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
  1553. BEGIN(0);
  1554. yylval->str = malloc(yyleng+1);
  1555. strncpy(yylval->str, yytext, yyleng);
  1556. yylval->str[yyleng] = 0;
  1557. prev_word = 0;
  1558. return word;
  1559. }
  1560. parencount--;
  1561. if ( parencount >= 0) {
  1562. yymore();
  1563. } else {
  1564. STORE_LOC;
  1565. yylval->str = malloc(yyleng);
  1566. strncpy(yylval->str, yytext, yyleng);
  1567. yylval->str[yyleng-1] = 0;
  1568. unput(')');
  1569. BEGIN(0);
  1570. return word;
  1571. }
  1572. }
  1573. YY_BREAK
  1574. case 65:
  1575. /* rule 65 can match eol */
  1576. YY_RULE_SETUP
  1577. #line 449 "ael.flex"
  1578. {
  1579. char c = yytext[yyleng-1];
  1580. if (c == '(')
  1581. parencount++;
  1582. pbcpush(c);
  1583. yymore();
  1584. }
  1585. YY_BREAK
  1586. case 66:
  1587. /* rule 66 can match eol */
  1588. YY_RULE_SETUP
  1589. #line 457 "ael.flex"
  1590. {
  1591. char c = yytext[yyleng-1];
  1592. if ( pbcpop(c)) { /* error */
  1593. STORE_LOC;
  1594. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
  1595. my_file, my_lineno, my_col, c);
  1596. BEGIN(0);
  1597. yylval->str = malloc(yyleng+1);
  1598. strncpy(yylval->str, yytext, yyleng);
  1599. yylval->str[yyleng] = 0;
  1600. return word;
  1601. }
  1602. yymore();
  1603. }
  1604. YY_BREAK
  1605. /*
  1606. * handlers for arguments to a macro or application calls.
  1607. * We enter this context when we find the initial '(' and
  1608. * stay here until we close all matching parentheses,
  1609. * and find the comma (argument separator) or the closing ')'
  1610. * of the (external) call, which happens when parencount == 0
  1611. * before the decrement.
  1612. */
  1613. case 67:
  1614. /* rule 67 can match eol */
  1615. YY_RULE_SETUP
  1616. #line 481 "ael.flex"
  1617. {
  1618. char c = yytext[yyleng-1];
  1619. if (c == '(')
  1620. parencount++;
  1621. pbcpush(c);
  1622. yymore();
  1623. }
  1624. YY_BREAK
  1625. case 68:
  1626. /* rule 68 can match eol */
  1627. YY_RULE_SETUP
  1628. #line 489 "ael.flex"
  1629. {
  1630. if ( pbcpop(')') ) { /* error */
  1631. STORE_LOC;
  1632. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
  1633. BEGIN(0);
  1634. yylval->str = malloc(yyleng+1);
  1635. strncpy(yylval->str, yytext, yyleng);
  1636. yylval->str[yyleng] = 0;
  1637. return word;
  1638. }
  1639. parencount--;
  1640. if( parencount >= 0){
  1641. yymore();
  1642. } else {
  1643. STORE_LOC;
  1644. BEGIN(0);
  1645. if ( !strcmp(yytext, ")") )
  1646. return RP;
  1647. yylval->str = malloc(yyleng);
  1648. strncpy(yylval->str, yytext, yyleng);
  1649. yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
  1650. unput(')');
  1651. return word;
  1652. }
  1653. }
  1654. YY_BREAK
  1655. case 69:
  1656. /* rule 69 can match eol */
  1657. YY_RULE_SETUP
  1658. #line 516 "ael.flex"
  1659. {
  1660. if( parencount != 0) { /* ast_log(LOG_NOTICE,"Folding in a comma!\n"); */
  1661. yymore();
  1662. } else {
  1663. STORE_LOC;
  1664. if( !strcmp(yytext,"," ) )
  1665. return COMMA;
  1666. yylval->str = malloc(yyleng);
  1667. strncpy(yylval->str, yytext, yyleng);
  1668. yylval->str[yyleng-1] = '\0'; /* trim trailing ',' */
  1669. unput(',');
  1670. return word;
  1671. }
  1672. }
  1673. YY_BREAK
  1674. case 70:
  1675. /* rule 70 can match eol */
  1676. YY_RULE_SETUP
  1677. #line 531 "ael.flex"
  1678. {
  1679. char c = yytext[yyleng-1];
  1680. if ( pbcpop(c) ) { /* error */
  1681. STORE_LOC;
  1682. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
  1683. BEGIN(0);
  1684. yylval->str = malloc(yyleng+1);
  1685. strncpy(yylval->str, yytext, yyleng);
  1686. yylval->str[yyleng] = '\0';
  1687. return word;
  1688. }
  1689. yymore();
  1690. }
  1691. YY_BREAK
  1692. /*
  1693. * context used to find tokens in the right hand side of assignments,
  1694. * or in the first and second operand of a 'for'. As above, match
  1695. * commas and use ';' as a separator (hence return it as a separate token).
  1696. */
  1697. case 71:
  1698. /* rule 71 can match eol */
  1699. YY_RULE_SETUP
  1700. #line 550 "ael.flex"
  1701. {
  1702. char c = yytext[yyleng-1];
  1703. yymore();
  1704. pbcpush(c);
  1705. }
  1706. YY_BREAK
  1707. case 72:
  1708. /* rule 72 can match eol */
  1709. YY_RULE_SETUP
  1710. #line 556 "ael.flex"
  1711. {
  1712. char c = yytext[yyleng-1];
  1713. if ( pbcpop(c) ) { /* error */
  1714. STORE_LOC;
  1715. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
  1716. BEGIN(0);
  1717. yylval->str = malloc(yyleng+1);
  1718. strncpy(yylval->str, yytext, yyleng);
  1719. yylval->str[yyleng] = '\0';
  1720. return word;
  1721. }
  1722. yymore();
  1723. }
  1724. YY_BREAK
  1725. case 73:
  1726. /* rule 73 can match eol */
  1727. YY_RULE_SETUP
  1728. #line 570 "ael.flex"
  1729. {
  1730. STORE_LOC;
  1731. yylval->str = malloc(yyleng);
  1732. strncpy(yylval->str, yytext, yyleng);
  1733. yylval->str[yyleng-1] = '\0'; /* trim trailing ';' */
  1734. unput(';');
  1735. BEGIN(0);
  1736. return word;
  1737. }
  1738. YY_BREAK
  1739. case 74:
  1740. /* rule 74 can match eol */
  1741. YY_RULE_SETUP
  1742. #line 580 "ael.flex"
  1743. {
  1744. char fnamebuf[1024],*p1,*p2;
  1745. int glob_ret;
  1746. glob_t globbuf; /* the current globbuf */
  1747. int globbuf_pos = -1; /* where we are in the current globbuf */
  1748. globbuf.gl_offs = 0; /* initialize it to silence gcc */
  1749. p1 = strchr(yytext,'"');
  1750. p2 = strrchr(yytext,'"');
  1751. if ( include_stack_index >= MAX_INCLUDE_DEPTH ) {
  1752. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Includes nested too deeply! Wow!!! How did you do that?\n", my_file, my_lineno, my_col);
  1753. } else if ( (int)(p2-p1) > sizeof(fnamebuf) - 1 ) {
  1754. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Filename is incredibly way too long (%d chars!). Inclusion ignored!\n", my_file, my_lineno, my_col, yyleng - 10);
  1755. } else {
  1756. strncpy(fnamebuf, p1+1, p2-p1-1);
  1757. fnamebuf[p2-p1-1] = 0;
  1758. if (fnamebuf[0] != '/') {
  1759. char fnamebuf2[1024];
  1760. snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
  1761. ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
  1762. }
  1763. #ifdef SOLARIS
  1764. glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
  1765. #else
  1766. glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
  1767. #endif
  1768. if (glob_ret == GLOB_NOSPACE) {
  1769. ast_log(LOG_WARNING,
  1770. "Glob Expansion of pattern '%s' failed: Not enough memory\n", fnamebuf);
  1771. } else if (glob_ret == GLOB_ABORTED) {
  1772. ast_log(LOG_WARNING,
  1773. "Glob Expansion of pattern '%s' failed: Read error\n", fnamebuf);
  1774. } else if (glob_ret == GLOB_NOMATCH) {
  1775. ast_log(LOG_WARNING,
  1776. "Glob Expansion of pattern '%s' failed: No matches!\n", fnamebuf);
  1777. } else {
  1778. globbuf_pos = 0;
  1779. }
  1780. }
  1781. if (globbuf_pos > -1) {
  1782. setup_filestack(fnamebuf, sizeof(fnamebuf), &globbuf, 0, yyscanner, 1);
  1783. }
  1784. }
  1785. YY_BREAK
  1786. case YY_STATE_EOF(INITIAL):
  1787. case YY_STATE_EOF(paren):
  1788. case YY_STATE_EOF(semic):
  1789. case YY_STATE_EOF(argg):
  1790. case YY_STATE_EOF(comment):
  1791. case YY_STATE_EOF(curlystate):
  1792. case YY_STATE_EOF(wordstate):
  1793. case YY_STATE_EOF(brackstate):
  1794. #line 625 "ael.flex"
  1795. {
  1796. char fnamebuf[2048];
  1797. if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
  1798. ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner );
  1799. include_stack[include_stack_index-1].globbuf_pos++;
  1800. setup_filestack(fnamebuf, sizeof(fnamebuf), &include_stack[include_stack_index-1].globbuf, include_stack[include_stack_index-1].globbuf_pos, yyscanner, 0);
  1801. /* finish this */
  1802. } else {
  1803. if (include_stack[include_stack_index].fname) {
  1804. free(include_stack[include_stack_index].fname);
  1805. include_stack[include_stack_index].fname = 0;
  1806. }
  1807. if (my_file) {
  1808. free(my_file);
  1809. my_file = 0;
  1810. }
  1811. if ( --include_stack_index < 0 ) {
  1812. yyterminate();
  1813. } else {
  1814. globfree(&include_stack[include_stack_index].globbuf);
  1815. include_stack[include_stack_index].globbuf_pos = -1;
  1816. ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner );
  1817. ael_yy_switch_to_buffer(include_stack[include_stack_index].bufstate,yyscanner );
  1818. my_lineno = include_stack[include_stack_index].lineno;
  1819. my_col = include_stack[include_stack_index].colno;
  1820. my_file = strdup(include_stack[include_stack_index].fname);
  1821. }
  1822. }
  1823. }
  1824. YY_BREAK
  1825. case 75:
  1826. /* rule 75 can match eol */
  1827. YY_RULE_SETUP
  1828. #line 657 "ael.flex"
  1829. { /* default rule */ ast_log(LOG_ERROR,"Unhandled char(s): %s\n", yytext); }
  1830. YY_BREAK
  1831. case 76:
  1832. YY_RULE_SETUP
  1833. #line 659 "ael.flex"
  1834. YY_FATAL_ERROR( "flex scanner jammed" );
  1835. YY_BREAK
  1836. #line 2042 "ael_lex.c"
  1837. case YY_END_OF_BUFFER:
  1838. {
  1839. /* Amount of text matched not including the EOB char. */
  1840. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  1841. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1842. *yy_cp = yyg->yy_hold_char;
  1843. YY_RESTORE_YY_MORE_OFFSET
  1844. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  1845. {
  1846. /* We're scanning a new file or input source. It's
  1847. * possible that this happened because the user
  1848. * just pointed yyin at a new source and called
  1849. * ael_yylex(). If so, then we have to assure
  1850. * consistency between YY_CURRENT_BUFFER and our
  1851. * globals. Here is the right place to do so, because
  1852. * this is the first action (other than possibly a
  1853. * back-up) that will match for the new input source.
  1854. */
  1855. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1856. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  1857. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  1858. }
  1859. /* Note that here we test for yy_c_buf_p "<=" to the position
  1860. * of the first EOB in the buffer, since yy_c_buf_p will
  1861. * already have been incremented past the NUL character
  1862. * (since all states make transitions on EOB to the
  1863. * end-of-buffer state). Contrast this with the test
  1864. * in input().
  1865. */
  1866. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1867. { /* This was really a NUL. */
  1868. yy_state_type yy_next_state;
  1869. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  1870. yy_current_state = yy_get_previous_state( yyscanner );
  1871. /* Okay, we're now positioned to make the NUL
  1872. * transition. We couldn't have
  1873. * yy_get_previous_state() go ahead and do it
  1874. * for us because it doesn't know how to deal
  1875. * with the possibility of jamming (and we don't
  1876. * want to build jamming into it because then it
  1877. * will run more slowly).
  1878. */
  1879. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  1880. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1881. if ( yy_next_state )
  1882. {
  1883. /* Consume the NUL. */
  1884. yy_cp = ++yyg->yy_c_buf_p;
  1885. yy_current_state = yy_next_state;
  1886. goto yy_match;
  1887. }
  1888. else
  1889. {
  1890. yy_cp = yyg->yy_last_accepting_cpos;
  1891. yy_current_state = yyg->yy_last_accepting_state;
  1892. goto yy_find_action;
  1893. }
  1894. }
  1895. else switch ( yy_get_next_buffer( yyscanner ) )
  1896. {
  1897. case EOB_ACT_END_OF_FILE:
  1898. {
  1899. yyg->yy_did_buffer_switch_on_eof = 0;
  1900. if ( ael_yywrap(yyscanner ) )
  1901. {
  1902. /* Note: because we've taken care in
  1903. * yy_get_next_buffer() to have set up
  1904. * yytext, we can now set up
  1905. * yy_c_buf_p so that if some total
  1906. * hoser (like flex itself) wants to
  1907. * call the scanner after we return the
  1908. * YY_NULL, it'll still work - another
  1909. * YY_NULL will get returned.
  1910. */
  1911. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  1912. yy_act = YY_STATE_EOF(YY_START);
  1913. goto do_action;
  1914. }
  1915. else
  1916. {
  1917. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1918. YY_NEW_FILE;
  1919. }
  1920. break;
  1921. }
  1922. case EOB_ACT_CONTINUE_SCAN:
  1923. yyg->yy_c_buf_p =
  1924. yyg->yytext_ptr + yy_amount_of_matched_text;
  1925. yy_current_state = yy_get_previous_state( yyscanner );
  1926. yy_cp = yyg->yy_c_buf_p;
  1927. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1928. goto yy_match;
  1929. case EOB_ACT_LAST_MATCH:
  1930. yyg->yy_c_buf_p =
  1931. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  1932. yy_current_state = yy_get_previous_state( yyscanner );
  1933. yy_cp = yyg->yy_c_buf_p;
  1934. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1935. goto yy_find_action;
  1936. }
  1937. break;
  1938. }
  1939. default:
  1940. YY_FATAL_ERROR(
  1941. "fatal flex scanner internal error--no action found" );
  1942. } /* end of action switch */
  1943. } /* end of scanning one token */
  1944. } /* end of ael_yylex */
  1945. /* yy_get_next_buffer - try to read in a new buffer
  1946. *
  1947. * Returns a code representing an action:
  1948. * EOB_ACT_LAST_MATCH -
  1949. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1950. * EOB_ACT_END_OF_FILE - end of file
  1951. */
  1952. static int yy_get_next_buffer (yyscan_t yyscanner)
  1953. {
  1954. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1955. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1956. register char *source = yyg->yytext_ptr;
  1957. register int number_to_move, i;
  1958. int ret_val;
  1959. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  1960. YY_FATAL_ERROR(
  1961. "fatal flex scanner internal error--end of buffer missed" );
  1962. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1963. { /* Don't try to fill the buffer, so this is an EOF. */
  1964. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  1965. {
  1966. /* We matched a single character, the EOB, so
  1967. * treat this as a final EOF.
  1968. */
  1969. return EOB_ACT_END_OF_FILE;
  1970. }
  1971. else
  1972. {
  1973. /* We matched some text prior to the EOB, first
  1974. * process it.
  1975. */
  1976. return EOB_ACT_LAST_MATCH;
  1977. }
  1978. }
  1979. /* Try to read more data. */
  1980. /* First move last chars to start of buffer. */
  1981. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
  1982. for ( i = 0; i < number_to_move; ++i )
  1983. *(dest++) = *(source++);
  1984. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1985. /* don't do the read, it's not guaranteed to return an EOF,
  1986. * just force an EOF
  1987. */
  1988. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  1989. else
  1990. {
  1991. int num_to_read =
  1992. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1993. while ( num_to_read <= 0 )
  1994. { /* Not enough room in the buffer - grow it. */
  1995. /* just a shorter name for the current buffer */
  1996. YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  1997. int yy_c_buf_p_offset =
  1998. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  1999. if ( b->yy_is_our_buffer )
  2000. {
  2001. int new_size = b->yy_buf_size * 2;
  2002. if ( new_size <= 0 )
  2003. b->yy_buf_size += b->yy_buf_size / 8;
  2004. else
  2005. b->yy_buf_size *= 2;
  2006. b->yy_ch_buf = (char *)
  2007. /* Include room in for 2 EOB chars. */
  2008. ael_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
  2009. }
  2010. else
  2011. /* Can't grow it, we don't own it. */
  2012. b->yy_ch_buf = 0;
  2013. if ( ! b->yy_ch_buf )
  2014. YY_FATAL_ERROR(
  2015. "fatal error - scanner input buffer overflow" );
  2016. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  2017. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  2018. number_to_move - 1;
  2019. }
  2020. if ( num_to_read > YY_READ_BUF_SIZE )
  2021. num_to_read = YY_READ_BUF_SIZE;
  2022. /* Read in more data. */
  2023. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  2024. yyg->yy_n_chars, (size_t) num_to_read );
  2025. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  2026. }
  2027. if ( yyg->yy_n_chars == 0 )
  2028. {
  2029. if ( number_to_move == YY_MORE_ADJ )
  2030. {
  2031. ret_val = EOB_ACT_END_OF_FILE;
  2032. ael_yyrestart(yyin ,yyscanner);
  2033. }
  2034. else
  2035. {
  2036. ret_val = EOB_ACT_LAST_MATCH;
  2037. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  2038. YY_BUFFER_EOF_PENDING;
  2039. }
  2040. }
  2041. else
  2042. ret_val = EOB_ACT_CONTINUE_SCAN;
  2043. if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  2044. /* Extend the array by 50%, plus the number we really need. */
  2045. yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
  2046. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ael_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
  2047. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  2048. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  2049. }
  2050. yyg->yy_n_chars += number_to_move;
  2051. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  2052. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  2053. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  2054. return ret_val;
  2055. }
  2056. /* yy_get_previous_state - get the state just before the EOB char was reached */
  2057. static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  2058. {
  2059. register yy_state_type yy_current_state;
  2060. register char *yy_cp;
  2061. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2062. yy_current_state = yyg->yy_start;
  2063. for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  2064. {
  2065. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  2066. if ( yy_accept[yy_current_state] )
  2067. {
  2068. yyg->yy_last_accepting_state = yy_current_state;
  2069. yyg->yy_last_accepting_cpos = yy_cp;
  2070. }
  2071. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  2072. {
  2073. yy_current_state = (int) yy_def[yy_current_state];
  2074. if ( yy_current_state >= 285 )
  2075. yy_c = yy_meta[(unsigned int) yy_c];
  2076. }
  2077. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  2078. }
  2079. return yy_current_state;
  2080. }
  2081. /* yy_try_NUL_trans - try to make a transition on the NUL character
  2082. *
  2083. * synopsis
  2084. * next_state = yy_try_NUL_trans( current_state );
  2085. */
  2086. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
  2087. {
  2088. register int yy_is_jam;
  2089. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
  2090. register char *yy_cp = yyg->yy_c_buf_p;
  2091. register YY_CHAR yy_c = 1;
  2092. if ( yy_accept[yy_current_state] )
  2093. {
  2094. yyg->yy_last_accepting_state = yy_current_state;
  2095. yyg->yy_last_accepting_cpos = yy_cp;
  2096. }
  2097. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  2098. {
  2099. yy_current_state = (int) yy_def[yy_current_state];
  2100. if ( yy_current_state >= 285 )
  2101. yy_c = yy_meta[(unsigned int) yy_c];
  2102. }
  2103. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  2104. yy_is_jam = (yy_current_state == 284);
  2105. return yy_is_jam ? 0 : yy_current_state;
  2106. }
  2107. static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
  2108. {
  2109. register char *yy_cp;
  2110. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2111. yy_cp = yyg->yy_c_buf_p;
  2112. /* undo effects of setting up yytext */
  2113. *yy_cp = yyg->yy_hold_char;
  2114. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  2115. { /* need to shift things up to make room */
  2116. /* +2 for EOB chars. */
  2117. register int number_to_move = yyg->yy_n_chars + 2;
  2118. register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  2119. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  2120. register char *source =
  2121. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  2122. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  2123. *--dest = *--source;
  2124. yy_cp += (int) (dest - source);
  2125. yy_bp += (int) (dest - source);
  2126. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  2127. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  2128. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  2129. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  2130. }
  2131. *--yy_cp = (char) c;
  2132. yyg->yytext_ptr = yy_bp;
  2133. yyg->yy_hold_char = *yy_cp;
  2134. yyg->yy_c_buf_p = yy_cp;
  2135. }
  2136. #ifndef YY_NO_INPUT
  2137. #ifdef __cplusplus
  2138. static int yyinput (yyscan_t yyscanner)
  2139. #else
  2140. static int input (yyscan_t yyscanner)
  2141. #endif
  2142. {
  2143. int c;
  2144. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2145. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  2146. if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  2147. {
  2148. /* yy_c_buf_p now points to the character we want to return.
  2149. * If this occurs *before* the EOB characters, then it's a
  2150. * valid NUL; if not, then we've hit the end of the buffer.
  2151. */
  2152. if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  2153. /* This was really a NUL. */
  2154. *yyg->yy_c_buf_p = '\0';
  2155. else
  2156. { /* need more input */
  2157. int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
  2158. ++yyg->yy_c_buf_p;
  2159. switch ( yy_get_next_buffer( yyscanner ) )
  2160. {
  2161. case EOB_ACT_LAST_MATCH:
  2162. /* This happens because yy_g_n_b()
  2163. * sees that we've accumulated a
  2164. * token and flags that we need to
  2165. * try matching the token before
  2166. * proceeding. But for input(),
  2167. * there's no matching to consider.
  2168. * So convert the EOB_ACT_LAST_MATCH
  2169. * to EOB_ACT_END_OF_FILE.
  2170. */
  2171. /* Reset buffer status. */
  2172. ael_yyrestart(yyin ,yyscanner);
  2173. /*FALLTHROUGH*/
  2174. case EOB_ACT_END_OF_FILE:
  2175. {
  2176. if ( ael_yywrap(yyscanner ) )
  2177. return EOF;
  2178. if ( ! yyg->yy_did_buffer_switch_on_eof )
  2179. YY_NEW_FILE;
  2180. #ifdef __cplusplus
  2181. return yyinput(yyscanner);
  2182. #else
  2183. return input(yyscanner);
  2184. #endif
  2185. }
  2186. case EOB_ACT_CONTINUE_SCAN:
  2187. yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  2188. break;
  2189. }
  2190. }
  2191. }
  2192. c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  2193. *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
  2194. yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  2195. return c;
  2196. }
  2197. #endif /* ifndef YY_NO_INPUT */
  2198. /** Immediately switch to a different input stream.
  2199. * @param input_file A readable stream.
  2200. * @param yyscanner The scanner object.
  2201. * @note This function does not reset the start condition to @c INITIAL .
  2202. */
  2203. void ael_yyrestart (FILE * input_file , yyscan_t yyscanner)
  2204. {
  2205. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2206. if ( ! YY_CURRENT_BUFFER ){
  2207. ael_yyensure_buffer_stack (yyscanner);
  2208. YY_CURRENT_BUFFER_LVALUE =
  2209. ael_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  2210. }
  2211. ael_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
  2212. ael_yy_load_buffer_state(yyscanner );
  2213. }
  2214. /** Switch to a different input buffer.
  2215. * @param new_buffer The new input buffer.
  2216. * @param yyscanner The scanner object.
  2217. */
  2218. void ael_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  2219. {
  2220. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2221. /* TODO. We should be able to replace this entire function body
  2222. * with
  2223. * ael_yypop_buffer_state();
  2224. * ael_yypush_buffer_state(new_buffer);
  2225. */
  2226. ael_yyensure_buffer_stack (yyscanner);
  2227. if ( YY_CURRENT_BUFFER == new_buffer )
  2228. return;
  2229. if ( YY_CURRENT_BUFFER )
  2230. {
  2231. /* Flush out information for old buffer. */
  2232. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  2233. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  2234. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  2235. }
  2236. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  2237. ael_yy_load_buffer_state(yyscanner );
  2238. /* We don't actually know whether we did this switch during
  2239. * EOF (ael_yywrap()) processing, but the only time this flag
  2240. * is looked at is after ael_yywrap() is called, so it's safe
  2241. * to go ahead and always set it.
  2242. */
  2243. yyg->yy_did_buffer_switch_on_eof = 1;
  2244. }
  2245. static void ael_yy_load_buffer_state (yyscan_t yyscanner)
  2246. {
  2247. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2248. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  2249. yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  2250. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  2251. yyg->yy_hold_char = *yyg->yy_c_buf_p;
  2252. }
  2253. /** Allocate and initialize an input buffer state.
  2254. * @param file A readable stream.
  2255. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  2256. * @param yyscanner The scanner object.
  2257. * @return the allocated buffer state.
  2258. */
  2259. YY_BUFFER_STATE ael_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  2260. {
  2261. YY_BUFFER_STATE b;
  2262. b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  2263. if ( ! b )
  2264. YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" );
  2265. b->yy_buf_size = size;
  2266. /* yy_ch_buf has to be 2 characters longer than the size given because
  2267. * we need to put in 2 end-of-buffer characters.
  2268. */
  2269. b->yy_ch_buf = (char *) ael_yyalloc(b->yy_buf_size + 2 ,yyscanner );
  2270. if ( ! b->yy_ch_buf )
  2271. YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" );
  2272. b->yy_is_our_buffer = 1;
  2273. ael_yy_init_buffer(b,file ,yyscanner);
  2274. return b;
  2275. }
  2276. /** Destroy the buffer.
  2277. * @param b a buffer created with ael_yy_create_buffer()
  2278. * @param yyscanner The scanner object.
  2279. */
  2280. void ael_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  2281. {
  2282. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2283. if ( ! b )
  2284. return;
  2285. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  2286. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  2287. if ( b->yy_is_our_buffer )
  2288. ael_yyfree((void *) b->yy_ch_buf ,yyscanner );
  2289. ael_yyfree((void *) b ,yyscanner );
  2290. }
  2291. #ifndef __cplusplus
  2292. extern int isatty (int );
  2293. #endif /* __cplusplus */
  2294. /* Initializes or reinitializes a buffer.
  2295. * This function is sometimes called more than once on the same buffer,
  2296. * such as during a ael_yyrestart() or at EOF.
  2297. */
  2298. static void ael_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  2299. {
  2300. int oerrno = errno;
  2301. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2302. ael_yy_flush_buffer(b ,yyscanner);
  2303. b->yy_input_file = file;
  2304. b->yy_fill_buffer = 1;
  2305. /* If b is the current buffer, then ael_yy_init_buffer was _probably_
  2306. * called from ael_yyrestart() or through yy_get_next_buffer.
  2307. * In that case, we don't want to reset the lineno or column.
  2308. */
  2309. if (b != YY_CURRENT_BUFFER){
  2310. b->yy_bs_lineno = 1;
  2311. b->yy_bs_column = 0;
  2312. }
  2313. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  2314. errno = oerrno;
  2315. }
  2316. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  2317. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  2318. * @param yyscanner The scanner object.
  2319. */
  2320. void ael_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  2321. {
  2322. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2323. if ( ! b )
  2324. return;
  2325. b->yy_n_chars = 0;
  2326. /* We always need two end-of-buffer characters. The first causes
  2327. * a transition to the end-of-buffer state. The second causes
  2328. * a jam in that state.
  2329. */
  2330. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  2331. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  2332. b->yy_buf_pos = &b->yy_ch_buf[0];
  2333. b->yy_at_bol = 1;
  2334. b->yy_buffer_status = YY_BUFFER_NEW;
  2335. if ( b == YY_CURRENT_BUFFER )
  2336. ael_yy_load_buffer_state(yyscanner );
  2337. }
  2338. /** Pushes the new state onto the stack. The new state becomes
  2339. * the current state. This function will allocate the stack
  2340. * if necessary.
  2341. * @param new_buffer The new state.
  2342. * @param yyscanner The scanner object.
  2343. */
  2344. void ael_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  2345. {
  2346. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2347. if (new_buffer == NULL)
  2348. return;
  2349. ael_yyensure_buffer_stack(yyscanner);
  2350. /* This block is copied from ael_yy_switch_to_buffer. */
  2351. if ( YY_CURRENT_BUFFER )
  2352. {
  2353. /* Flush out information for old buffer. */
  2354. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  2355. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  2356. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  2357. }
  2358. /* Only push if top exists. Otherwise, replace top. */
  2359. if (YY_CURRENT_BUFFER)
  2360. yyg->yy_buffer_stack_top++;
  2361. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  2362. /* copied from ael_yy_switch_to_buffer. */
  2363. ael_yy_load_buffer_state(yyscanner );
  2364. yyg->yy_did_buffer_switch_on_eof = 1;
  2365. }
  2366. /** Removes and deletes the top of the stack, if present.
  2367. * The next element becomes the new top.
  2368. * @param yyscanner The scanner object.
  2369. */
  2370. void ael_yypop_buffer_state (yyscan_t yyscanner)
  2371. {
  2372. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2373. if (!YY_CURRENT_BUFFER)
  2374. return;
  2375. ael_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
  2376. YY_CURRENT_BUFFER_LVALUE = NULL;
  2377. if (yyg->yy_buffer_stack_top > 0)
  2378. --yyg->yy_buffer_stack_top;
  2379. if (YY_CURRENT_BUFFER) {
  2380. ael_yy_load_buffer_state(yyscanner );
  2381. yyg->yy_did_buffer_switch_on_eof = 1;
  2382. }
  2383. }
  2384. /* Allocates the stack if it does not exist.
  2385. * Guarantees space for at least one push.
  2386. */
  2387. static void ael_yyensure_buffer_stack (yyscan_t yyscanner)
  2388. {
  2389. int num_to_alloc;
  2390. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2391. if (!yyg->yy_buffer_stack) {
  2392. /* First allocation is just for 2 elements, since we don't know if this
  2393. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  2394. * immediate realloc on the next call.
  2395. */
  2396. num_to_alloc = 1;
  2397. yyg->yy_buffer_stack = (struct yy_buffer_state**)ael_yyalloc
  2398. (num_to_alloc * sizeof(struct yy_buffer_state*)
  2399. , yyscanner);
  2400. if ( ! yyg->yy_buffer_stack )
  2401. YY_FATAL_ERROR( "out of dynamic memory in ael_yyensure_buffer_stack()" );
  2402. memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  2403. yyg->yy_buffer_stack_max = num_to_alloc;
  2404. yyg->yy_buffer_stack_top = 0;
  2405. return;
  2406. }
  2407. if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  2408. /* Increase the buffer to prepare for a possible push. */
  2409. int grow_size = 8 /* arbitrary grow size */;
  2410. num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
  2411. yyg->yy_buffer_stack = (struct yy_buffer_state**)ael_yyrealloc
  2412. (yyg->yy_buffer_stack,
  2413. num_to_alloc * sizeof(struct yy_buffer_state*)
  2414. , yyscanner);
  2415. if ( ! yyg->yy_buffer_stack )
  2416. YY_FATAL_ERROR( "out of dynamic memory in ael_yyensure_buffer_stack()" );
  2417. /* zero only the new slots.*/
  2418. memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  2419. yyg->yy_buffer_stack_max = num_to_alloc;
  2420. }
  2421. }
  2422. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  2423. * @param base the character buffer
  2424. * @param size the size in bytes of the character buffer
  2425. * @param yyscanner The scanner object.
  2426. * @return the newly allocated buffer state object.
  2427. */
  2428. YY_BUFFER_STATE ael_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  2429. {
  2430. YY_BUFFER_STATE b;
  2431. if ( size < 2 ||
  2432. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  2433. base[size-1] != YY_END_OF_BUFFER_CHAR )
  2434. /* They forgot to leave room for the EOB's. */
  2435. return 0;
  2436. b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  2437. if ( ! b )
  2438. YY_FATAL_ERROR( "out of dynamic memory in ael_yy_scan_buffer()" );
  2439. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  2440. b->yy_buf_pos = b->yy_ch_buf = base;
  2441. b->yy_is_our_buffer = 0;
  2442. b->yy_input_file = 0;
  2443. b->yy_n_chars = b->yy_buf_size;
  2444. b->yy_is_interactive = 0;
  2445. b->yy_at_bol = 1;
  2446. b->yy_fill_buffer = 0;
  2447. b->yy_buffer_status = YY_BUFFER_NEW;
  2448. ael_yy_switch_to_buffer(b ,yyscanner );
  2449. return b;
  2450. }
  2451. /** Setup the input buffer state to scan a string. The next call to ael_yylex() will
  2452. * scan from a @e copy of @a str.
  2453. * @param yystr a NUL-terminated string to scan
  2454. * @param yyscanner The scanner object.
  2455. * @return the newly allocated buffer state object.
  2456. * @note If you want to scan bytes that may contain NUL values, then use
  2457. * ael_yy_scan_bytes() instead.
  2458. */
  2459. YY_BUFFER_STATE ael_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
  2460. {
  2461. return ael_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
  2462. }
  2463. /** Setup the input buffer state to scan the given bytes. The next call to ael_yylex() will
  2464. * scan from a @e copy of @a bytes.
  2465. * @param bytes the byte buffer to scan
  2466. * @param len the number of bytes in the buffer pointed to by @a bytes.
  2467. * @param yyscanner The scanner object.
  2468. * @return the newly allocated buffer state object.
  2469. */
  2470. YY_BUFFER_STATE ael_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
  2471. {
  2472. YY_BUFFER_STATE b;
  2473. char *buf;
  2474. yy_size_t n;
  2475. int i;
  2476. /* Get memory for full buffer, including space for trailing EOB's. */
  2477. n = _yybytes_len + 2;
  2478. buf = (char *) ael_yyalloc(n ,yyscanner );
  2479. if ( ! buf )
  2480. YY_FATAL_ERROR( "out of dynamic memory in ael_yy_scan_bytes()" );
  2481. for ( i = 0; i < _yybytes_len; ++i )
  2482. buf[i] = yybytes[i];
  2483. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  2484. b = ael_yy_scan_buffer(buf,n ,yyscanner);
  2485. if ( ! b )
  2486. YY_FATAL_ERROR( "bad buffer in ael_yy_scan_bytes()" );
  2487. /* It's okay to grow etc. this buffer, and we should throw it
  2488. * away when we're done.
  2489. */
  2490. b->yy_is_our_buffer = 1;
  2491. return b;
  2492. }
  2493. #ifndef YY_EXIT_FAILURE
  2494. #define YY_EXIT_FAILURE 2
  2495. #endif
  2496. static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
  2497. {
  2498. (void) fprintf( stderr, "%s\n", msg );
  2499. exit( YY_EXIT_FAILURE );
  2500. }
  2501. /* Redefine yyless() so it works in section 3 code. */
  2502. #undef yyless
  2503. #define yyless(n) \
  2504. do \
  2505. { \
  2506. /* Undo effects of setting up yytext. */ \
  2507. int yyless_macro_arg = (n); \
  2508. YY_LESS_LINENO(yyless_macro_arg);\
  2509. yytext[yyleng] = yyg->yy_hold_char; \
  2510. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  2511. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  2512. *yyg->yy_c_buf_p = '\0'; \
  2513. yyleng = yyless_macro_arg; \
  2514. } \
  2515. while ( 0 )
  2516. /* Accessor methods (get/set functions) to struct members. */
  2517. /** Get the user-defined data for this scanner.
  2518. * @param yyscanner The scanner object.
  2519. */
  2520. YY_EXTRA_TYPE ael_yyget_extra (yyscan_t yyscanner)
  2521. {
  2522. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2523. return yyextra;
  2524. }
  2525. /** Get the current line number.
  2526. * @param yyscanner The scanner object.
  2527. */
  2528. int ael_yyget_lineno (yyscan_t yyscanner)
  2529. {
  2530. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2531. if (! YY_CURRENT_BUFFER)
  2532. return 0;
  2533. return yylineno;
  2534. }
  2535. /** Get the current column number.
  2536. * @param yyscanner The scanner object.
  2537. */
  2538. int ael_yyget_column (yyscan_t yyscanner)
  2539. {
  2540. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2541. if (! YY_CURRENT_BUFFER)
  2542. return 0;
  2543. return yycolumn;
  2544. }
  2545. /** Get the input stream.
  2546. * @param yyscanner The scanner object.
  2547. */
  2548. FILE *ael_yyget_in (yyscan_t yyscanner)
  2549. {
  2550. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2551. return yyin;
  2552. }
  2553. /** Get the output stream.
  2554. * @param yyscanner The scanner object.
  2555. */
  2556. FILE *ael_yyget_out (yyscan_t yyscanner)
  2557. {
  2558. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2559. return yyout;
  2560. }
  2561. /** Get the length of the current token.
  2562. * @param yyscanner The scanner object.
  2563. */
  2564. int ael_yyget_leng (yyscan_t yyscanner)
  2565. {
  2566. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2567. return yyleng;
  2568. }
  2569. /** Get the current token.
  2570. * @param yyscanner The scanner object.
  2571. */
  2572. char *ael_yyget_text (yyscan_t yyscanner)
  2573. {
  2574. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2575. return yytext;
  2576. }
  2577. /** Set the user-defined data. This data is never touched by the scanner.
  2578. * @param user_defined The data to be associated with this scanner.
  2579. * @param yyscanner The scanner object.
  2580. */
  2581. void ael_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  2582. {
  2583. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2584. yyextra = user_defined ;
  2585. }
  2586. /** Set the current line number.
  2587. * @param line_number
  2588. * @param yyscanner The scanner object.
  2589. */
  2590. void ael_yyset_lineno (int line_number , yyscan_t yyscanner)
  2591. {
  2592. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2593. /* lineno is only valid if an input buffer exists. */
  2594. if (! YY_CURRENT_BUFFER )
  2595. yy_fatal_error( "ael_yyset_lineno called with no buffer" , yyscanner);
  2596. yylineno = line_number;
  2597. }
  2598. /** Set the current column.
  2599. * @param line_number
  2600. * @param yyscanner The scanner object.
  2601. */
  2602. void ael_yyset_column (int column_no , yyscan_t yyscanner)
  2603. {
  2604. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2605. /* column is only valid if an input buffer exists. */
  2606. if (! YY_CURRENT_BUFFER )
  2607. yy_fatal_error( "ael_yyset_column called with no buffer" , yyscanner);
  2608. yycolumn = column_no;
  2609. }
  2610. /** Set the input stream. This does not discard the current
  2611. * input buffer.
  2612. * @param in_str A readable stream.
  2613. * @param yyscanner The scanner object.
  2614. * @see ael_yy_switch_to_buffer
  2615. */
  2616. void ael_yyset_in (FILE * in_str , yyscan_t yyscanner)
  2617. {
  2618. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2619. yyin = in_str ;
  2620. }
  2621. void ael_yyset_out (FILE * out_str , yyscan_t yyscanner)
  2622. {
  2623. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2624. yyout = out_str ;
  2625. }
  2626. int ael_yyget_debug (yyscan_t yyscanner)
  2627. {
  2628. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2629. return yy_flex_debug;
  2630. }
  2631. void ael_yyset_debug (int bdebug , yyscan_t yyscanner)
  2632. {
  2633. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2634. yy_flex_debug = bdebug ;
  2635. }
  2636. /* Accessor methods for yylval and yylloc */
  2637. YYSTYPE * ael_yyget_lval (yyscan_t yyscanner)
  2638. {
  2639. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2640. return yylval;
  2641. }
  2642. void ael_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
  2643. {
  2644. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2645. yylval = yylval_param;
  2646. }
  2647. YYLTYPE *ael_yyget_lloc (yyscan_t yyscanner)
  2648. {
  2649. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2650. return yylloc;
  2651. }
  2652. void ael_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
  2653. {
  2654. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2655. yylloc = yylloc_param;
  2656. }
  2657. /* User-visible API */
  2658. /* ael_yylex_init is special because it creates the scanner itself, so it is
  2659. * the ONLY reentrant function that doesn't take the scanner as the last argument.
  2660. * That's why we explicitly handle the declaration, instead of using our macros.
  2661. */
  2662. int ael_yylex_init(yyscan_t* ptr_yy_globals)
  2663. {
  2664. if (ptr_yy_globals == NULL){
  2665. errno = EINVAL;
  2666. return 1;
  2667. }
  2668. *ptr_yy_globals = (yyscan_t) ael_yyalloc ( sizeof( struct yyguts_t ), NULL );
  2669. if (*ptr_yy_globals == NULL){
  2670. errno = ENOMEM;
  2671. return 1;
  2672. }
  2673. /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
  2674. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  2675. return yy_init_globals ( *ptr_yy_globals );
  2676. }
  2677. /* ael_yylex_init_extra has the same functionality as ael_yylex_init, but follows the
  2678. * convention of taking the scanner as the last argument. Note however, that
  2679. * this is a *pointer* to a scanner, as it will be allocated by this call (and
  2680. * is the reason, too, why this function also must handle its own declaration).
  2681. * The user defined value in the first argument will be available to ael_yyalloc in
  2682. * the yyextra field.
  2683. */
  2684. int ael_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
  2685. {
  2686. struct yyguts_t dummy_yyguts;
  2687. ael_yyset_extra (yy_user_defined, &dummy_yyguts);
  2688. if (ptr_yy_globals == NULL){
  2689. errno = EINVAL;
  2690. return 1;
  2691. }
  2692. *ptr_yy_globals = (yyscan_t) ael_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
  2693. if (*ptr_yy_globals == NULL){
  2694. errno = ENOMEM;
  2695. return 1;
  2696. }
  2697. /* By setting to 0xAA, we expose bugs in
  2698. yy_init_globals. Leave at 0x00 for releases. */
  2699. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  2700. ael_yyset_extra (yy_user_defined, *ptr_yy_globals);
  2701. return yy_init_globals ( *ptr_yy_globals );
  2702. }
  2703. static int yy_init_globals (yyscan_t yyscanner)
  2704. {
  2705. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2706. /* Initialization is the same as for the non-reentrant scanner.
  2707. * This function is called from ael_yylex_destroy(), so don't allocate here.
  2708. */
  2709. yyg->yy_buffer_stack = 0;
  2710. yyg->yy_buffer_stack_top = 0;
  2711. yyg->yy_buffer_stack_max = 0;
  2712. yyg->yy_c_buf_p = (char *) 0;
  2713. yyg->yy_init = 0;
  2714. yyg->yy_start = 0;
  2715. yyg->yy_start_stack_ptr = 0;
  2716. yyg->yy_start_stack_depth = 0;
  2717. yyg->yy_start_stack = NULL;
  2718. /* Defined in main.c */
  2719. #ifdef YY_STDINIT
  2720. yyin = stdin;
  2721. yyout = stdout;
  2722. #else
  2723. yyin = (FILE *) 0;
  2724. yyout = (FILE *) 0;
  2725. #endif
  2726. /* For future reference: Set errno on error, since we are called by
  2727. * ael_yylex_init()
  2728. */
  2729. return 0;
  2730. }
  2731. /* ael_yylex_destroy is for both reentrant and non-reentrant scanners. */
  2732. int ael_yylex_destroy (yyscan_t yyscanner)
  2733. {
  2734. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2735. /* Pop the buffer stack, destroying each element. */
  2736. while(YY_CURRENT_BUFFER){
  2737. ael_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
  2738. YY_CURRENT_BUFFER_LVALUE = NULL;
  2739. ael_yypop_buffer_state(yyscanner);
  2740. }
  2741. /* Destroy the stack itself. */
  2742. ael_yyfree(yyg->yy_buffer_stack ,yyscanner);
  2743. yyg->yy_buffer_stack = NULL;
  2744. /* Destroy the start condition stack. */
  2745. ael_yyfree(yyg->yy_start_stack ,yyscanner );
  2746. yyg->yy_start_stack = NULL;
  2747. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  2748. * ael_yylex() is called, initialization will occur. */
  2749. yy_init_globals( yyscanner);
  2750. /* Destroy the main struct (reentrant only). */
  2751. ael_yyfree ( yyscanner , yyscanner );
  2752. yyscanner = NULL;
  2753. return 0;
  2754. }
  2755. /*
  2756. * Internal utility routines.
  2757. */
  2758. #ifndef yytext_ptr
  2759. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
  2760. {
  2761. register int i;
  2762. for ( i = 0; i < n; ++i )
  2763. s1[i] = s2[i];
  2764. }
  2765. #endif
  2766. #ifdef YY_NEED_STRLEN
  2767. static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
  2768. {
  2769. register int n;
  2770. for ( n = 0; s[n]; ++n )
  2771. ;
  2772. return n;
  2773. }
  2774. #endif
  2775. void *ael_yyalloc (yy_size_t size , yyscan_t yyscanner)
  2776. {
  2777. return (void *) malloc( size );
  2778. }
  2779. void *ael_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
  2780. {
  2781. /* The cast to (char *) in the following accommodates both
  2782. * implementations that use char* generic pointers, and those
  2783. * that use void* generic pointers. It works with the latter
  2784. * because both ANSI C and C++ allow castless assignment from
  2785. * any pointer type to void*, and deal with argument conversions
  2786. * as though doing an assignment.
  2787. */
  2788. return (void *) realloc( (char *) ptr, size );
  2789. }
  2790. #define YYTABLES_NAME "yytables"
  2791. #line 659 "ael.flex"
  2792. static void pbcpush(char x)
  2793. {
  2794. pbcstack[pbcpos++] = x;
  2795. }
  2796. void ael_yyfree(void *ptr, yyscan_t yyscanner)
  2797. {
  2798. if (ptr)
  2799. free( (char*) ptr );
  2800. }
  2801. static int pbcpop(char x)
  2802. {
  2803. if ( ( x == ')' && pbcstack[pbcpos-1] == '(' )
  2804. || ( x == ']' && pbcstack[pbcpos-1] == '[' )
  2805. || ( x == '}' && pbcstack[pbcpos-1] == '{' )) {
  2806. pbcpos--;
  2807. return 0;
  2808. }
  2809. return 1; /* error */
  2810. }
  2811. static void pbcpush2(char x)
  2812. {
  2813. pbcstack2[pbcpos2++] = x;
  2814. }
  2815. static int pbcpop2(char x)
  2816. {
  2817. if ( ( x == ')' && pbcstack2[pbcpos2-1] == '(' )
  2818. || ( x == ']' && pbcstack2[pbcpos2-1] == '[' )
  2819. || ( x == '}' && pbcstack2[pbcpos2-1] == '{' )) {
  2820. pbcpos2--;
  2821. return 0;
  2822. }
  2823. return 1; /* error */
  2824. }
  2825. static void pbcpush3(char x)
  2826. {
  2827. pbcstack3[pbcpos3++] = x;
  2828. }
  2829. static int pbcpop3(char x)
  2830. {
  2831. if ( ( x == ')' && pbcstack3[pbcpos3-1] == '(' )
  2832. || ( x == ']' && pbcstack3[pbcpos3-1] == '[' )
  2833. || ( x == '}' && pbcstack3[pbcpos3-1] == '{' )) {
  2834. pbcpos3--;
  2835. return 0;
  2836. }
  2837. return 1; /* error */
  2838. }
  2839. static int c_prevword(void)
  2840. {
  2841. char *c = prev_word;
  2842. if (c == NULL)
  2843. return 0;
  2844. while ( *c ) {
  2845. switch (*c) {
  2846. case '{':
  2847. case '[':
  2848. case '(':
  2849. pbcpush(*c);
  2850. break;
  2851. case '}':
  2852. case ']':
  2853. case ')':
  2854. if (pbcpop(*c))
  2855. return 1;
  2856. break;
  2857. }
  2858. c++;
  2859. }
  2860. return 0;
  2861. }
  2862. /*
  2863. * The following three functions, reset_*, are used in the bison
  2864. * code to switch context. As a consequence, we need to
  2865. * declare them global and add a prototype so that the
  2866. * compiler does not complain.
  2867. *
  2868. * NOTE: yyg is declared because it is used in the BEGIN macros,
  2869. * though that should be hidden as the macro changes
  2870. * depending on the flex options that we use - in particular,
  2871. * %reentrant changes the way the macro is declared;
  2872. * without %reentrant, BEGIN uses yystart instead of yyg
  2873. */
  2874. void reset_parencount(yyscan_t yyscanner );
  2875. void reset_parencount(yyscan_t yyscanner )
  2876. {
  2877. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2878. parencount = 0;
  2879. pbcpos = 0;
  2880. pbcpush('('); /* push '(' so the last pcbpop (parencount= -1) will succeed */
  2881. c_prevword();
  2882. BEGIN(paren);
  2883. }
  2884. void reset_semicount(yyscan_t yyscanner );
  2885. void reset_semicount(yyscan_t yyscanner )
  2886. {
  2887. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2888. pbcpos = 0;
  2889. BEGIN(semic);
  2890. }
  2891. void reset_argcount(yyscan_t yyscanner );
  2892. void reset_argcount(yyscan_t yyscanner )
  2893. {
  2894. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2895. parencount = 0;
  2896. pbcpos = 0;
  2897. pbcpush('('); /* push '(' so the last pcbpop (parencount= -1) will succeed */
  2898. c_prevword();
  2899. BEGIN(argg);
  2900. }
  2901. /* used elsewhere, but some local vars */
  2902. struct pval *ael2_parse(char *filename, int *errors)
  2903. {
  2904. struct pval *pvalue;
  2905. struct parse_io *io;
  2906. char *buffer;
  2907. struct stat stats;
  2908. FILE *fin;
  2909. /* extern int ael_yydebug; */
  2910. io = calloc(sizeof(struct parse_io),1);
  2911. /* reset the global counters */
  2912. prev_word = 0;
  2913. my_lineno = 1;
  2914. include_stack_index=0;
  2915. my_col = 0;
  2916. /* ael_yydebug = 1; */
  2917. ael_yylex_init(&io->scanner);
  2918. fin = fopen(filename,"r");
  2919. if ( !fin ) {
  2920. ast_log(LOG_ERROR,"File %s could not be opened\n", filename);
  2921. *errors = 1;
  2922. return 0;
  2923. }
  2924. if (my_file)
  2925. free(my_file);
  2926. my_file = strdup(filename);
  2927. if (stat(filename, &stats)) {
  2928. ast_log(LOG_WARNING, "failed to populate stats from file '%s'\n", filename);
  2929. }
  2930. buffer = (char*)malloc(stats.st_size+2);
  2931. if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) {
  2932. ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
  2933. }
  2934. buffer[stats.st_size]=0;
  2935. fclose(fin);
  2936. ael_yy_scan_string (buffer ,io->scanner);
  2937. ael_yyset_lineno(1 , io->scanner);
  2938. /* ael_yyset_in (fin , io->scanner); OLD WAY */
  2939. ael_yyparse(io);
  2940. pvalue = io->pval;
  2941. *errors = io->syntax_error_count;
  2942. ael_yylex_destroy(io->scanner);
  2943. free(buffer);
  2944. free(io);
  2945. return pvalue;
  2946. }
  2947. static void setup_filestack(char *fnamebuf2, int fnamebuf_siz, glob_t *globbuf, int globpos, yyscan_t yyscanner, int create)
  2948. {
  2949. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2950. int error, i;
  2951. FILE *in1;
  2952. char fnamebuf[2048];
  2953. if (globbuf && globbuf->gl_pathv && globbuf->gl_pathc > 0)
  2954. #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
  2955. strncpy(fnamebuf, globbuf->gl_pathv[globpos], fnamebuf_siz);
  2956. #else
  2957. ast_copy_string(fnamebuf, globbuf->gl_pathv[globpos], fnamebuf_siz);
  2958. #endif
  2959. else {
  2960. ast_log(LOG_ERROR,"Include file name not present!\n");
  2961. return;
  2962. }
  2963. for (i=0; i<include_stack_index; i++) {
  2964. if ( !strcmp(fnamebuf,include_stack[i].fname )) {
  2965. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Nice Try!!! But %s has already been included (perhaps by another file), and would cause an infinite loop of file inclusions!!! Include directive ignored\n",
  2966. my_file, my_lineno, my_col, fnamebuf);
  2967. break;
  2968. }
  2969. }
  2970. error = 1;
  2971. if (i == include_stack_index)
  2972. error = 0; /* we can use this file */
  2973. if ( !error ) { /* valid file name */
  2974. /* relative vs. absolute */
  2975. if (fnamebuf[0] != '/')
  2976. snprintf(fnamebuf2, fnamebuf_siz, "%s/%s", ast_config_AST_CONFIG_DIR, fnamebuf);
  2977. else
  2978. #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
  2979. strncpy(fnamebuf2, fnamebuf, fnamebuf_siz);
  2980. #else
  2981. ast_copy_string(fnamebuf2, fnamebuf, fnamebuf_siz);
  2982. #endif
  2983. in1 = fopen( fnamebuf2, "r" );
  2984. if ( ! in1 ) {
  2985. ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Couldn't find the include file: %s; ignoring the Include directive!\n", my_file, my_lineno, my_col, fnamebuf2);
  2986. } else {
  2987. char *buffer;
  2988. struct stat stats;
  2989. if (stat(fnamebuf2, &stats)) {
  2990. ast_log(LOG_WARNING, "Failed to populate stats from file '%s'\n", fnamebuf2);
  2991. }
  2992. buffer = (char*)malloc(stats.st_size+1);
  2993. if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) {
  2994. ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
  2995. }
  2996. buffer[stats.st_size] = 0;
  2997. ast_debug(1, " --Read in included file %s, %d chars\n",fnamebuf2, (int)stats.st_size);
  2998. fclose(in1);
  2999. if (include_stack[include_stack_index].fname) {
  3000. free(include_stack[include_stack_index].fname);
  3001. include_stack[include_stack_index].fname = 0;
  3002. }
  3003. include_stack[include_stack_index].fname = strdup(S_OR(my_file, "<none>"));
  3004. include_stack[include_stack_index].lineno = my_lineno;
  3005. include_stack[include_stack_index].colno = my_col+yyleng;
  3006. if (my_file)
  3007. free(my_file);
  3008. my_file = strdup(fnamebuf2);
  3009. if (create)
  3010. include_stack[include_stack_index].globbuf = *globbuf;
  3011. include_stack[include_stack_index].globbuf_pos = 0;
  3012. include_stack[include_stack_index].bufstate = YY_CURRENT_BUFFER;
  3013. if (create)
  3014. include_stack_index++;
  3015. ael_yy_switch_to_buffer(ael_yy_scan_string (buffer ,yyscanner),yyscanner);
  3016. free(buffer);
  3017. my_lineno = 1;
  3018. my_col = 1;
  3019. BEGIN(INITIAL);
  3020. }
  3021. }
  3022. }