lex.c 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147
  1. #line 3 "lex.c"
  2. #define YY_INT_ALIGNED short int
  3. /* A lexical scanner generated by flex */
  4. #define FLEX_SCANNER
  5. #define YY_FLEX_MAJOR_VERSION 2
  6. #define YY_FLEX_MINOR_VERSION 5
  7. #define YY_FLEX_SUBMINOR_VERSION 33
  8. #if YY_FLEX_SUBMINOR_VERSION > 0
  9. #define FLEX_BETA
  10. #endif
  11. /* First, we deal with platform-specific or compiler-specific issues. */
  12. /* begin standard C headers. */
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <errno.h>
  16. #include <stdlib.h>
  17. /* end standard C headers. */
  18. /* flex integer type definitions */
  19. #ifndef FLEXINT_H
  20. #define FLEXINT_H
  21. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  22. #if __STDC_VERSION__ >= 199901L
  23. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  24. * if you want the limit (max/min) macros for int types.
  25. */
  26. #ifndef __STDC_LIMIT_MACROS
  27. #define __STDC_LIMIT_MACROS 1
  28. #endif
  29. #include <inttypes.h>
  30. typedef int8_t flex_int8_t;
  31. typedef uint8_t flex_uint8_t;
  32. typedef int16_t flex_int16_t;
  33. typedef uint16_t flex_uint16_t;
  34. typedef int32_t flex_int32_t;
  35. typedef uint32_t flex_uint32_t;
  36. #else
  37. typedef signed char flex_int8_t;
  38. typedef short int flex_int16_t;
  39. typedef int flex_int32_t;
  40. typedef unsigned char flex_uint8_t;
  41. typedef unsigned short int flex_uint16_t;
  42. typedef unsigned int flex_uint32_t;
  43. #endif /* ! C99 */
  44. /* Limits of integral types. */
  45. #ifndef INT8_MIN
  46. #define INT8_MIN (-128)
  47. #endif
  48. #ifndef INT16_MIN
  49. #define INT16_MIN (-32767-1)
  50. #endif
  51. #ifndef INT32_MIN
  52. #define INT32_MIN (-2147483647-1)
  53. #endif
  54. #ifndef INT8_MAX
  55. #define INT8_MAX (127)
  56. #endif
  57. #ifndef INT16_MAX
  58. #define INT16_MAX (32767)
  59. #endif
  60. #ifndef INT32_MAX
  61. #define INT32_MAX (2147483647)
  62. #endif
  63. #ifndef UINT8_MAX
  64. #define UINT8_MAX (255U)
  65. #endif
  66. #ifndef UINT16_MAX
  67. #define UINT16_MAX (65535U)
  68. #endif
  69. #ifndef UINT32_MAX
  70. #define UINT32_MAX (4294967295U)
  71. #endif
  72. #endif /* ! FLEXINT_H */
  73. #ifdef __cplusplus
  74. /* The "const" storage-class-modifier is valid. */
  75. #define YY_USE_CONST
  76. #else /* ! __cplusplus */
  77. #if __STDC__
  78. #define YY_USE_CONST
  79. #endif /* __STDC__ */
  80. #endif /* ! __cplusplus */
  81. #ifdef YY_USE_CONST
  82. #define yyconst const
  83. #else
  84. #define yyconst
  85. #endif
  86. /* Returned upon end-of-file. */
  87. #define YY_NULL 0
  88. /* Promotes a possibly negative, possibly signed char to an unsigned
  89. * integer for use as an array index. If the signed char is negative,
  90. * we want to instead treat it as an 8-bit unsigned char, hence the
  91. * double cast.
  92. */
  93. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  94. /* Enter a start condition. This macro really ought to take a parameter,
  95. * but we do it the disgusting crufty way forced on us by the ()-less
  96. * definition of BEGIN.
  97. */
  98. #define BEGIN (yy_start) = 1 + 2 *
  99. /* Translate the current start state into a value that can be later handed
  100. * to BEGIN to return to the state. The YYSTATE alias is for lex
  101. * compatibility.
  102. */
  103. #define YY_START (((yy_start) - 1) / 2)
  104. #define YYSTATE YY_START
  105. /* Action number for EOF rule of a given start state. */
  106. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  107. /* Special action meaning "start processing a new file". */
  108. #define YY_NEW_FILE yyrestart(yyin )
  109. #define YY_END_OF_BUFFER_CHAR 0
  110. /* Size of default input buffer. */
  111. #ifndef YY_BUF_SIZE
  112. #define YY_BUF_SIZE 16384
  113. #endif
  114. /* The state buf must be large enough to hold one state per character in the main buffer.
  115. */
  116. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  117. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  118. #define YY_TYPEDEF_YY_BUFFER_STATE
  119. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  120. #endif
  121. extern int yyleng;
  122. extern FILE *yyin, *yyout;
  123. #define EOB_ACT_CONTINUE_SCAN 0
  124. #define EOB_ACT_END_OF_FILE 1
  125. #define EOB_ACT_LAST_MATCH 2
  126. #define YY_LESS_LINENO(n)
  127. /* Return all but the first "n" matched characters back to the input stream. */
  128. #define yyless(n) \
  129. do \
  130. { \
  131. /* Undo effects of setting up yytext. */ \
  132. int yyless_macro_arg = (n); \
  133. YY_LESS_LINENO(yyless_macro_arg);\
  134. *yy_cp = (yy_hold_char); \
  135. YY_RESTORE_YY_MORE_OFFSET \
  136. (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  137. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  138. } \
  139. while ( 0 )
  140. #define unput(c) yyunput( c, (yytext_ptr) )
  141. /* The following is because we cannot portably get our hands on size_t
  142. * (without autoconf's help, which isn't available because we want
  143. * flex-generated scanners to compile on their own).
  144. */
  145. #ifndef YY_TYPEDEF_YY_SIZE_T
  146. #define YY_TYPEDEF_YY_SIZE_T
  147. typedef unsigned int yy_size_t;
  148. #endif
  149. #ifndef YY_STRUCT_YY_BUFFER_STATE
  150. #define YY_STRUCT_YY_BUFFER_STATE
  151. struct yy_buffer_state
  152. {
  153. FILE *yy_input_file;
  154. char *yy_ch_buf; /* input buffer */
  155. char *yy_buf_pos; /* current position in input buffer */
  156. /* Size of input buffer in bytes, not including room for EOB
  157. * characters.
  158. */
  159. yy_size_t yy_buf_size;
  160. /* Number of characters read into yy_ch_buf, not including EOB
  161. * characters.
  162. */
  163. int yy_n_chars;
  164. /* Whether we "own" the buffer - i.e., we know we created it,
  165. * and can realloc() it to grow it, and should free() it to
  166. * delete it.
  167. */
  168. int yy_is_our_buffer;
  169. /* Whether this is an "interactive" input source; if so, and
  170. * if we're using stdio for input, then we want to use getc()
  171. * instead of fread(), to make sure we stop fetching input after
  172. * each newline.
  173. */
  174. int yy_is_interactive;
  175. /* Whether we're considered to be at the beginning of a line.
  176. * If so, '^' rules will be active on the next match, otherwise
  177. * not.
  178. */
  179. int yy_at_bol;
  180. int yy_bs_lineno; /**< The line count. */
  181. int yy_bs_column; /**< The column count. */
  182. /* Whether to try to fill the input buffer when we reach the
  183. * end of it.
  184. */
  185. int yy_fill_buffer;
  186. int yy_buffer_status;
  187. #define YY_BUFFER_NEW 0
  188. #define YY_BUFFER_NORMAL 1
  189. /* When an EOF's been seen but there's still some text to process
  190. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  191. * shouldn't try reading from the input source any more. We might
  192. * still have a bunch of tokens to match, though, because of
  193. * possible backing-up.
  194. *
  195. * When we actually see the EOF, we change the status to "new"
  196. * (via yyrestart()), so that the user can continue scanning by
  197. * just pointing yyin at a new input file.
  198. */
  199. #define YY_BUFFER_EOF_PENDING 2
  200. };
  201. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  202. /* Stack of input buffers. */
  203. static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
  204. static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
  205. static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
  206. /* We provide macros for accessing buffer states in case in the
  207. * future we want to put the buffer states in a more general
  208. * "scanner state".
  209. *
  210. * Returns the top of the stack, or NULL.
  211. */
  212. #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
  213. ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
  214. : NULL)
  215. /* Same as previous macro, but useful when we know that the buffer stack is not
  216. * NULL or when we need an lvalue. For internal use only.
  217. */
  218. #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
  219. /* yy_hold_char holds the character lost when yytext is formed. */
  220. static char yy_hold_char;
  221. static int yy_n_chars; /* number of characters read into yy_ch_buf */
  222. int yyleng;
  223. /* Points to current character in buffer. */
  224. static char *yy_c_buf_p = (char *) 0;
  225. static int yy_init = 0; /* whether we need to initialize */
  226. static int yy_start = 0; /* start state number */
  227. /* Flag which is used to allow yywrap()'s to do buffer switches
  228. * instead of setting up a fresh yyin. A bit of a hack ...
  229. */
  230. static int yy_did_buffer_switch_on_eof;
  231. void yyrestart (FILE *input_file );
  232. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
  233. YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
  234. void yy_delete_buffer (YY_BUFFER_STATE b );
  235. void yy_flush_buffer (YY_BUFFER_STATE b );
  236. void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
  237. void yypop_buffer_state (void );
  238. static void yyensure_buffer_stack (void );
  239. static void yy_load_buffer_state (void );
  240. static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
  241. #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
  242. YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
  243. YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
  244. YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
  245. void *yyalloc (yy_size_t );
  246. void *yyrealloc (void *,yy_size_t );
  247. void yyfree (void * );
  248. #define yy_new_buffer yy_create_buffer
  249. #define yy_set_interactive(is_interactive) \
  250. { \
  251. if ( ! YY_CURRENT_BUFFER ){ \
  252. yyensure_buffer_stack (); \
  253. YY_CURRENT_BUFFER_LVALUE = \
  254. yy_create_buffer(yyin,YY_BUF_SIZE ); \
  255. } \
  256. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  257. }
  258. #define yy_set_bol(at_bol) \
  259. { \
  260. if ( ! YY_CURRENT_BUFFER ){\
  261. yyensure_buffer_stack (); \
  262. YY_CURRENT_BUFFER_LVALUE = \
  263. yy_create_buffer(yyin,YY_BUF_SIZE ); \
  264. } \
  265. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  266. }
  267. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  268. /* Begin user sect3 */
  269. typedef unsigned char YY_CHAR;
  270. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  271. typedef int yy_state_type;
  272. extern int yylineno;
  273. int yylineno = 1;
  274. extern char *yytext;
  275. #define yytext_ptr yytext
  276. static yy_state_type yy_get_previous_state (void );
  277. static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
  278. static int yy_get_next_buffer (void );
  279. static void yy_fatal_error (yyconst char msg[] );
  280. /* Done after the current pattern has been matched and before the
  281. * corresponding action - sets up yytext.
  282. */
  283. #define YY_DO_BEFORE_ACTION \
  284. (yytext_ptr) = yy_bp; \
  285. yyleng = (size_t) (yy_cp - yy_bp); \
  286. (yy_hold_char) = *yy_cp; \
  287. *yy_cp = '\0'; \
  288. (yy_c_buf_p) = yy_cp;
  289. #define YY_NUM_RULES 51
  290. #define YY_END_OF_BUFFER 52
  291. /* This struct is not used in this scanner,
  292. but its presence is necessary. */
  293. struct yy_trans_info
  294. {
  295. flex_int32_t yy_verify;
  296. flex_int32_t yy_nxt;
  297. };
  298. static yyconst flex_int16_t yy_acclist[232] =
  299. { 0,
  300. 52, 50, 51, 3, 50, 51, 4, 51, 49, 50,
  301. 51, 50, 51, 50, 51, 46, 50, 51, 4, 50,
  302. 51, 45, 50, 51, 45, 50, 51, 50, 51, 45,
  303. 50, 51, 45, 50, 51, 45, 50, 51, 45, 50,
  304. 51, 45, 50, 51, 45, 50, 51, 45, 50, 51,
  305. 45, 50, 51, 45, 50, 51, 45, 50, 51, 45,
  306. 50, 51, 45, 50, 51, 50, 51, 1, 48, 47,
  307. 46, 45, 5, 45, 2, 45, 45, 45, 45, 45,
  308. 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
  309. 45, 45, 16, 45, 45, 45, 45, 45, 45, 45,
  310. 45, 6, 47, 48, 46, 12, 45, 45, 45, 45,
  311. 45, 45, 19, 45, 37, 45, 45, 45, 14, 45,
  312. 45, 45, 45, 45, 45, 45, 45, 17, 45, 45,
  313. 45, 18, 45, 45, 45, 20, 45, 48, 47, 46,
  314. 25, 45, 24, 45, 26, 45, 45, 45, 31, 45,
  315. 28, 45, 36, 45, 45, 45, 45, 8, 45, 45,
  316. 45, 45, 45, 45, 45, 45, 41, 45, 45, 27,
  317. 45, 13, 45, 10, 45, 29, 45, 48, 47, 48,
  318. 47, 46, 22, 45, 21, 45, 23, 45, 32, 45,
  319. 33, 45, 34, 45, 35, 45, 7, 45, 45, 30,
  320. 45, 40, 45, 43, 45, 45, 45, 45, 45, 15,
  321. 45, 9, 45, 48, 47, 48, 47, 45, 44, 45,
  322. 38, 45, 45, 39, 45, 47, 48, 11, 45, 42,
  323. 45
  324. } ;
  325. static yyconst flex_int16_t yy_accept[160] =
  326. { 0,
  327. 1, 1, 1, 2, 4, 7, 9, 12, 14, 16,
  328. 19, 22, 25, 28, 30, 33, 36, 39, 42, 45,
  329. 48, 51, 54, 57, 60, 63, 66, 68, 68, 69,
  330. 70, 71, 72, 72, 73, 75, 76, 77, 78, 79,
  331. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
  332. 90, 91, 92, 93, 95, 96, 97, 98, 99, 100,
  333. 101, 102, 103, 103, 105, 105, 105, 106, 108, 109,
  334. 110, 111, 112, 113, 115, 117, 118, 119, 121, 122,
  335. 123, 124, 125, 126, 127, 128, 130, 131, 132, 134,
  336. 135, 136, 138, 138, 139, 139, 139, 140, 141, 143,
  337. 145, 147, 148, 149, 151, 153, 155, 156, 157, 158,
  338. 160, 161, 162, 163, 164, 165, 166, 167, 169, 170,
  339. 172, 174, 176, 178, 179, 179, 181, 182, 183, 185,
  340. 187, 189, 191, 193, 195, 197, 199, 200, 202, 204,
  341. 206, 207, 208, 209, 210, 212, 214, 215, 217, 218,
  342. 219, 221, 223, 224, 226, 228, 230, 232, 232
  343. } ;
  344. static yyconst flex_int32_t yy_ec[256] =
  345. { 0,
  346. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  347. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  348. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  349. 1, 2, 4, 1, 5, 1, 1, 1, 4, 4,
  350. 4, 4, 6, 4, 6, 7, 4, 8, 9, 10,
  351. 10, 10, 10, 10, 10, 10, 10, 1, 11, 1,
  352. 4, 1, 4, 1, 12, 12, 12, 12, 13, 12,
  353. 12, 12, 14, 12, 12, 12, 12, 12, 12, 15,
  354. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  355. 1, 16, 1, 4, 12, 1, 17, 18, 19, 12,
  356. 20, 21, 22, 23, 24, 25, 12, 26, 27, 28,
  357. 29, 30, 31, 32, 33, 34, 12, 35, 12, 36,
  358. 37, 12, 1, 1, 1, 4, 1, 1, 1, 1,
  359. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  360. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  361. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  362. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  363. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  364. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  365. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  366. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  367. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  368. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  369. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  370. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  371. 1, 1, 1, 1, 1
  372. } ;
  373. static yyconst flex_int32_t yy_meta[38] =
  374. { 0,
  375. 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
  376. 1, 2, 2, 2, 2, 1, 2, 2, 2, 2,
  377. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  378. 2, 2, 2, 2, 2, 2, 2
  379. } ;
  380. static yyconst flex_int16_t yy_base[161] =
  381. { 0,
  382. 0, 219, 225, 227, 227, 227, 227, 221, 30, 34,
  383. 227, 0, 209, 219, 27, 201, 28, 17, 24, 203,
  384. 37, 40, 190, 186, 39, 200, 68, 213, 227, 71,
  385. 77, 0, 86, 0, 0, 227, 182, 185, 189, 195,
  386. 178, 186, 176, 187, 187, 34, 177, 176, 177, 183,
  387. 185, 166, 183, 0, 177, 166, 173, 168, 163, 174,
  388. 165, 227, 92, 95, 101, 104, 108, 0, 159, 163,
  389. 162, 94, 163, 165, 168, 154, 158, 0, 155, 156,
  390. 155, 147, 153, 38, 152, 169, 150, 148, 152, 140,
  391. 143, 149, 112, 115, 120, 124, 127, 130, 148, 147,
  392. 146, 66, 74, 0, 0, 0, 131, 143, 134, 0,
  393. 148, 147, 136, 130, 132, 133, 151, 0, 124, 0,
  394. 0, 0, 0, 133, 136, 139, 142, 227, 0, 0,
  395. 0, 0, 0, 0, 0, 0, 99, 0, 0, 0,
  396. 89, 78, 61, 72, 0, 0, 227, 145, 227, 68,
  397. 0, 0, 45, 0, 227, 0, 0, 227, 155, 65
  398. } ;
  399. static yyconst flex_int16_t yy_def[161] =
  400. { 0,
  401. 158, 1, 158, 158, 158, 158, 158, 159, 158, 158,
  402. 158, 160, 160, 158, 160, 160, 160, 160, 160, 160,
  403. 160, 160, 160, 160, 160, 160, 158, 159, 158, 158,
  404. 158, 10, 158, 160, 160, 158, 160, 160, 160, 160,
  405. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  406. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  407. 160, 158, 158, 158, 158, 158, 158, 160, 160, 160,
  408. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  409. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  410. 160, 160, 158, 158, 158, 158, 158, 158, 160, 160,
  411. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  412. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  413. 160, 160, 160, 158, 158, 158, 158, 158, 160, 160,
  414. 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
  415. 160, 160, 160, 160, 160, 160, 158, 158, 158, 160,
  416. 160, 160, 160, 160, 158, 160, 160, 0, 158, 158
  417. } ;
  418. static yyconst flex_int16_t yy_nxt[265] =
  419. { 0,
  420. 4, 5, 6, 7, 8, 7, 9, 10, 10, 10,
  421. 11, 12, 12, 12, 13, 14, 15, 16, 17, 18,
  422. 19, 20, 12, 21, 12, 22, 12, 23, 12, 24,
  423. 12, 12, 25, 26, 12, 12, 12, 30, 30, 30,
  424. 31, 32, 32, 32, 37, 38, 33, 42, 44, 47,
  425. 77, 45, 46, 33, 50, 48, 43, 114, 51, 39,
  426. 40, 53, 58, 78, 52, 115, 34, 54, 55, 59,
  427. 62, 157, 60, 132, 133, 30, 30, 30, 30, 30,
  428. 30, 134, 135, 63, 64, 64, 64, 156, 154, 65,
  429. 63, 66, 153, 67, 67, 67, 65, 93, 152, 94,
  430. 94, 94, 64, 64, 64, 151, 96, 95, 97, 97,
  431. 97, 67, 67, 67, 95, 98, 98, 98, 102, 94,
  432. 94, 94, 124, 124, 124, 125, 150, 126, 126, 126,
  433. 103, 97, 97, 97, 127, 127, 127, 128, 128, 128,
  434. 147, 147, 147, 126, 126, 126, 148, 148, 148, 149,
  435. 149, 149, 155, 155, 155, 28, 28, 146, 145, 144,
  436. 143, 142, 141, 140, 139, 138, 137, 136, 131, 130,
  437. 129, 123, 122, 121, 120, 119, 118, 117, 116, 113,
  438. 112, 111, 110, 109, 108, 107, 106, 105, 104, 101,
  439. 100, 99, 92, 91, 90, 89, 88, 87, 86, 85,
  440. 84, 83, 82, 81, 80, 79, 76, 75, 74, 73,
  441. 72, 71, 70, 69, 68, 29, 61, 57, 56, 49,
  442. 41, 36, 35, 29, 158, 27, 3, 158, 158, 158,
  443. 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
  444. 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
  445. 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
  446. 158, 158, 158, 158
  447. } ;
  448. static yyconst flex_int16_t yy_chk[265] =
  449. { 0,
  450. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  451. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  452. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  453. 1, 1, 1, 1, 1, 1, 1, 9, 9, 9,
  454. 10, 10, 10, 10, 15, 15, 10, 17, 18, 19,
  455. 46, 18, 18, 10, 21, 19, 17, 84, 21, 15,
  456. 15, 22, 25, 46, 21, 84, 160, 22, 22, 25,
  457. 27, 153, 25, 102, 102, 27, 27, 27, 30, 30,
  458. 30, 103, 103, 30, 31, 31, 31, 150, 144, 31,
  459. 30, 33, 143, 33, 33, 33, 31, 63, 142, 63,
  460. 63, 63, 64, 64, 64, 141, 65, 64, 65, 65,
  461. 65, 66, 66, 66, 64, 67, 67, 67, 72, 93,
  462. 93, 93, 94, 94, 94, 95, 137, 95, 95, 95,
  463. 72, 96, 96, 96, 97, 97, 97, 98, 98, 98,
  464. 124, 124, 124, 125, 125, 125, 126, 126, 126, 127,
  465. 127, 127, 148, 148, 148, 159, 159, 119, 117, 116,
  466. 115, 114, 113, 112, 111, 109, 108, 107, 101, 100,
  467. 99, 92, 91, 90, 89, 88, 87, 86, 85, 83,
  468. 82, 81, 80, 79, 77, 76, 75, 74, 73, 71,
  469. 70, 69, 61, 60, 59, 58, 57, 56, 55, 53,
  470. 52, 51, 50, 49, 48, 47, 45, 44, 43, 42,
  471. 41, 40, 39, 38, 37, 28, 26, 24, 23, 20,
  472. 16, 14, 13, 8, 3, 2, 158, 158, 158, 158,
  473. 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
  474. 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
  475. 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
  476. 158, 158, 158, 158
  477. } ;
  478. extern int yy_flex_debug;
  479. int yy_flex_debug = 0;
  480. static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
  481. static char *yy_full_match;
  482. static int yy_lp;
  483. #define REJECT \
  484. { \
  485. *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
  486. yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
  487. ++(yy_lp); \
  488. goto find_rule; \
  489. }
  490. #define yymore() yymore_used_but_not_detected
  491. #define YY_MORE_ADJ 0
  492. #define YY_RESTORE_YY_MORE_OFFSET
  493. char *yytext;
  494. #line 1 "lex.l"
  495. #line 3 "lex.l"
  496. /*
  497. * Copyright Nicholas B. Tufillaro, 1982-1994. All rights reserved.
  498. *
  499. * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999, 2005, 2008, Free
  500. * Software Foundation, Inc.
  501. */
  502. #include "sys-defines.h"
  503. #include "ode.h"
  504. #include "extern.h"
  505. #include "gram.h"
  506. int curline = 1;
  507. #line 607 "lex.c"
  508. #define INITIAL 0
  509. #ifndef YY_NO_UNISTD_H
  510. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  511. * down here because we want the user's section 1 to have been scanned first.
  512. * The user has a chance to override it with an option.
  513. */
  514. #include <unistd.h>
  515. #endif
  516. #ifndef YY_EXTRA_TYPE
  517. #define YY_EXTRA_TYPE void *
  518. #endif
  519. static int yy_init_globals (void );
  520. /* Macros after this point can all be overridden by user definitions in
  521. * section 1.
  522. */
  523. #ifndef YY_SKIP_YYWRAP
  524. #ifdef __cplusplus
  525. extern "C" int yywrap (void );
  526. #else
  527. extern int yywrap (void );
  528. #endif
  529. #endif
  530. static void yyunput (int c,char *buf_ptr );
  531. #ifndef yytext_ptr
  532. static void yy_flex_strncpy (char *,yyconst char *,int );
  533. #endif
  534. #ifdef YY_NEED_STRLEN
  535. static int yy_flex_strlen (yyconst char * );
  536. #endif
  537. #ifndef YY_NO_INPUT
  538. #ifdef __cplusplus
  539. static int yyinput (void );
  540. #else
  541. static int input (void );
  542. #endif
  543. #endif
  544. /* Amount of stuff to slurp up with each read. */
  545. #ifndef YY_READ_BUF_SIZE
  546. #define YY_READ_BUF_SIZE 8192
  547. #endif
  548. /* Copy whatever the last rule matched to the standard output. */
  549. #ifndef ECHO
  550. /* This used to be an fputs(), but since the string might contain NUL's,
  551. * we now use fwrite().
  552. */
  553. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  554. #endif
  555. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  556. * is returned in "result".
  557. */
  558. #ifndef YY_INPUT
  559. #define YY_INPUT(buf,result,max_size) \
  560. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  561. { \
  562. int c = '*'; \
  563. size_t n; \
  564. for ( n = 0; n < max_size && \
  565. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  566. buf[n] = (char) c; \
  567. if ( c == '\n' ) \
  568. buf[n++] = (char) c; \
  569. if ( c == EOF && ferror( yyin ) ) \
  570. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  571. result = n; \
  572. } \
  573. else \
  574. { \
  575. errno=0; \
  576. while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  577. { \
  578. if( errno != EINTR) \
  579. { \
  580. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  581. break; \
  582. } \
  583. errno=0; \
  584. clearerr(yyin); \
  585. } \
  586. }\
  587. \
  588. #endif
  589. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  590. * we don't want an extra ';' after the "return" because that will cause
  591. * some compilers to complain about unreachable statements.
  592. */
  593. #ifndef yyterminate
  594. #define yyterminate() return YY_NULL
  595. #endif
  596. /* Number of entries by which start-condition stack grows. */
  597. #ifndef YY_START_STACK_INCR
  598. #define YY_START_STACK_INCR 25
  599. #endif
  600. /* Report a fatal error. */
  601. #ifndef YY_FATAL_ERROR
  602. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  603. #endif
  604. /* end tables serialization structures and prototypes */
  605. /* Default declaration of generated scanner - a define so the user can
  606. * easily add parameters.
  607. */
  608. #ifndef YY_DECL
  609. #define YY_DECL_IS_OURS 1
  610. extern int yylex (void);
  611. #define YY_DECL int yylex (void)
  612. #endif /* !YY_DECL */
  613. /* Code executed at the beginning of each rule, after yytext and yyleng
  614. * have been set up.
  615. */
  616. #ifndef YY_USER_ACTION
  617. #define YY_USER_ACTION
  618. #endif
  619. /* Code executed at the end of each rule. */
  620. #ifndef YY_BREAK
  621. #define YY_BREAK break;
  622. #endif
  623. #define YY_RULE_SETUP \
  624. if ( yyleng > 0 ) \
  625. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
  626. (yytext[yyleng - 1] == '\n'); \
  627. YY_USER_ACTION
  628. /** The main scanner function which does all the work.
  629. */
  630. YY_DECL
  631. {
  632. register yy_state_type yy_current_state;
  633. register char *yy_cp, *yy_bp;
  634. register int yy_act;
  635. #line 18 "lex.l"
  636. #line 765 "lex.c"
  637. if ( !(yy_init) )
  638. {
  639. (yy_init) = 1;
  640. #ifdef YY_USER_INIT
  641. YY_USER_INIT;
  642. #endif
  643. /* Create the reject buffer large enough to save one state per allowed character. */
  644. if ( ! (yy_state_buf) )
  645. (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE );
  646. if ( ! (yy_start) )
  647. (yy_start) = 1; /* first start state */
  648. if ( ! yyin )
  649. yyin = stdin;
  650. if ( ! yyout )
  651. yyout = stdout;
  652. if ( ! YY_CURRENT_BUFFER ) {
  653. yyensure_buffer_stack ();
  654. YY_CURRENT_BUFFER_LVALUE =
  655. yy_create_buffer(yyin,YY_BUF_SIZE );
  656. }
  657. yy_load_buffer_state( );
  658. }
  659. while ( 1 ) /* loops until end-of-file is reached */
  660. {
  661. yy_cp = (yy_c_buf_p);
  662. /* Support of yytext. */
  663. *yy_cp = (yy_hold_char);
  664. /* yy_bp points to the position in yy_ch_buf of the start of
  665. * the current run.
  666. */
  667. yy_bp = yy_cp;
  668. yy_current_state = (yy_start);
  669. yy_current_state += YY_AT_BOL();
  670. (yy_state_ptr) = (yy_state_buf);
  671. *(yy_state_ptr)++ = yy_current_state;
  672. yy_match:
  673. do
  674. {
  675. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  676. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  677. {
  678. yy_current_state = (int) yy_def[yy_current_state];
  679. if ( yy_current_state >= 159 )
  680. yy_c = yy_meta[(unsigned int) yy_c];
  681. }
  682. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  683. *(yy_state_ptr)++ = yy_current_state;
  684. ++yy_cp;
  685. }
  686. while ( yy_base[yy_current_state] != 227 );
  687. yy_find_action:
  688. yy_current_state = *--(yy_state_ptr);
  689. (yy_lp) = yy_accept[yy_current_state];
  690. find_rule: /* we branch to this label when backing up */
  691. for ( ; ; ) /* until we find what rule we matched */
  692. {
  693. if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
  694. {
  695. yy_act = yy_acclist[(yy_lp)];
  696. {
  697. (yy_full_match) = yy_cp;
  698. break;
  699. }
  700. }
  701. --yy_cp;
  702. yy_current_state = *--(yy_state_ptr);
  703. (yy_lp) = yy_accept[yy_current_state];
  704. }
  705. YY_DO_BEFORE_ACTION;
  706. do_action: /* This label is used only to access EOF actions. */
  707. switch ( yy_act )
  708. { /* beginning of action switch */
  709. case 1:
  710. *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
  711. (yy_c_buf_p) = yy_cp -= 1;
  712. YY_DO_BEFORE_ACTION; /* set up yytext again */
  713. YY_RULE_SETUP
  714. #line 19 "lex.l"
  715. ; /* N.B.: comments can't be continued */
  716. YY_BREAK
  717. case 2:
  718. /* rule 2 can match eol */
  719. YY_RULE_SETUP
  720. #line 20 "lex.l"
  721. {
  722. curline++;
  723. }
  724. YY_BREAK
  725. case 3:
  726. YY_RULE_SETUP
  727. #line 23 "lex.l"
  728. ;
  729. YY_BREAK
  730. case 4:
  731. /* rule 4 can match eol */
  732. YY_RULE_SETUP
  733. #line 24 "lex.l"
  734. {
  735. yylval.lexptr = lalloc();
  736. yylval.lexptr->lx_lino = curline;
  737. if (*yytext == '\n')
  738. curline++;
  739. return SEP;
  740. }
  741. YY_BREAK
  742. case 5:
  743. YY_RULE_SETUP
  744. #line 31 "lex.l"
  745. {
  746. yylval.lexptr = lalloc();
  747. yylval.lexptr->lx_u.lxu_value = M_PI;
  748. return NUMBER;
  749. }
  750. YY_BREAK
  751. case 6:
  752. *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
  753. (yy_c_buf_p) = yy_cp -= 1;
  754. YY_DO_BEFORE_ACTION; /* set up yytext again */
  755. YY_RULE_SETUP
  756. #line 36 "lex.l"
  757. {
  758. /* lonely . isn't EOF in a -f file */
  759. if (yyin == stdin)
  760. return EOF;
  761. REJECT;
  762. }
  763. YY_BREAK
  764. case 7:
  765. YY_RULE_SETUP
  766. #line 42 "lex.l"
  767. { return EVERY; }
  768. YY_BREAK
  769. case 8:
  770. YY_RULE_SETUP
  771. #line 43 "lex.l"
  772. { return FROM; }
  773. YY_BREAK
  774. case 9:
  775. YY_RULE_SETUP
  776. #line 44 "lex.l"
  777. { return PRINT; }
  778. YY_BREAK
  779. case 10:
  780. YY_RULE_SETUP
  781. #line 45 "lex.l"
  782. { return STEP; }
  783. YY_BREAK
  784. case 11:
  785. YY_RULE_SETUP
  786. #line 46 "lex.l"
  787. { return EXAM; }
  788. YY_BREAK
  789. case 12:
  790. YY_RULE_SETUP
  791. #line 47 "lex.l"
  792. { return ABS; }
  793. YY_BREAK
  794. case 13:
  795. YY_RULE_SETUP
  796. #line 48 "lex.l"
  797. { return SQRT; }
  798. YY_BREAK
  799. case 14:
  800. YY_RULE_SETUP
  801. #line 49 "lex.l"
  802. { return EXP; }
  803. YY_BREAK
  804. case 15:
  805. YY_RULE_SETUP
  806. #line 50 "lex.l"
  807. { return LOG10; }
  808. YY_BREAK
  809. case 16:
  810. YY_RULE_SETUP
  811. #line 51 "lex.l"
  812. { return LOG; }
  813. YY_BREAK
  814. case 17:
  815. YY_RULE_SETUP
  816. #line 52 "lex.l"
  817. { return LOG; }
  818. YY_BREAK
  819. case 18:
  820. YY_RULE_SETUP
  821. #line 53 "lex.l"
  822. { return SIN; }
  823. YY_BREAK
  824. case 19:
  825. YY_RULE_SETUP
  826. #line 54 "lex.l"
  827. { return COS; }
  828. YY_BREAK
  829. case 20:
  830. YY_RULE_SETUP
  831. #line 55 "lex.l"
  832. { return TAN; }
  833. YY_BREAK
  834. case 21:
  835. YY_RULE_SETUP
  836. #line 56 "lex.l"
  837. { return ASINH; }
  838. YY_BREAK
  839. case 22:
  840. YY_RULE_SETUP
  841. #line 57 "lex.l"
  842. { return ACOSH; }
  843. YY_BREAK
  844. case 23:
  845. YY_RULE_SETUP
  846. #line 58 "lex.l"
  847. { return ATANH; }
  848. YY_BREAK
  849. case 24:
  850. YY_RULE_SETUP
  851. #line 59 "lex.l"
  852. { return ASIN; }
  853. YY_BREAK
  854. case 25:
  855. YY_RULE_SETUP
  856. #line 60 "lex.l"
  857. { return ACOS; }
  858. YY_BREAK
  859. case 26:
  860. YY_RULE_SETUP
  861. #line 61 "lex.l"
  862. { return ATAN; }
  863. YY_BREAK
  864. case 27:
  865. YY_RULE_SETUP
  866. #line 62 "lex.l"
  867. { return SINH; }
  868. YY_BREAK
  869. case 28:
  870. YY_RULE_SETUP
  871. #line 63 "lex.l"
  872. { return COSH; }
  873. YY_BREAK
  874. case 29:
  875. YY_RULE_SETUP
  876. #line 64 "lex.l"
  877. { return TANH; }
  878. YY_BREAK
  879. case 30:
  880. YY_RULE_SETUP
  881. #line 65 "lex.l"
  882. { return FLOOR; }
  883. YY_BREAK
  884. case 31:
  885. YY_RULE_SETUP
  886. #line 66 "lex.l"
  887. { return CEIL; }
  888. YY_BREAK
  889. case 32:
  890. YY_RULE_SETUP
  891. #line 67 "lex.l"
  892. { return J0; }
  893. YY_BREAK
  894. case 33:
  895. YY_RULE_SETUP
  896. #line 68 "lex.l"
  897. { return J1; }
  898. YY_BREAK
  899. case 34:
  900. YY_RULE_SETUP
  901. #line 69 "lex.l"
  902. { return Y0; }
  903. YY_BREAK
  904. case 35:
  905. YY_RULE_SETUP
  906. #line 70 "lex.l"
  907. { return Y1; }
  908. YY_BREAK
  909. case 36:
  910. YY_RULE_SETUP
  911. #line 71 "lex.l"
  912. { return ERFC; }
  913. YY_BREAK
  914. case 37:
  915. YY_RULE_SETUP
  916. #line 72 "lex.l"
  917. { return ERF; }
  918. YY_BREAK
  919. case 38:
  920. YY_RULE_SETUP
  921. #line 73 "lex.l"
  922. { return INVERF; }
  923. YY_BREAK
  924. case 39:
  925. YY_RULE_SETUP
  926. #line 74 "lex.l"
  927. { return LGAMMA; }
  928. YY_BREAK
  929. case 40:
  930. YY_RULE_SETUP
  931. #line 75 "lex.l"
  932. { return GAMMA; }
  933. YY_BREAK
  934. case 41:
  935. YY_RULE_SETUP
  936. #line 76 "lex.l"
  937. { return NORM; }
  938. YY_BREAK
  939. case 42:
  940. YY_RULE_SETUP
  941. #line 77 "lex.l"
  942. { return INVNORM; }
  943. YY_BREAK
  944. case 43:
  945. YY_RULE_SETUP
  946. #line 78 "lex.l"
  947. { return IBETA; }
  948. YY_BREAK
  949. case 44:
  950. YY_RULE_SETUP
  951. #line 79 "lex.l"
  952. { return IGAMMA; }
  953. YY_BREAK
  954. case 45:
  955. YY_RULE_SETUP
  956. #line 80 "lex.l"
  957. {
  958. yylval.lexptr = lalloc();
  959. strncpy(yylval.lexptr->lx_u.lxu_name,yytext,NAMMAX);
  960. return IDENT;
  961. }
  962. YY_BREAK
  963. case 46:
  964. #line 86 "lex.l"
  965. case 47:
  966. #line 87 "lex.l"
  967. case 48:
  968. YY_RULE_SETUP
  969. #line 87 "lex.l"
  970. {
  971. /*
  972. * restrictions on numbers:
  973. * radix 10 only
  974. * a bare Expo isn't enough (matches IDENT)
  975. */
  976. yylval.lexptr = lalloc();
  977. yylval.lexptr->lx_u.lxu_value = atof(yytext);
  978. return NUMBER;
  979. }
  980. YY_BREAK
  981. case 49:
  982. YY_RULE_SETUP
  983. #line 97 "lex.l"
  984. {
  985. /*
  986. * accept as few as possible so the error
  987. * message can be a smart one
  988. */
  989. return yytext[0];
  990. }
  991. YY_BREAK
  992. case 50:
  993. YY_RULE_SETUP
  994. #line 104 "lex.l"
  995. {
  996. if (*yytext > '~' || *yytext < ' ')
  997. fprintf (stderr,
  998. "%s:%s:%d: bad char '\\%02o'\n",
  999. progname, filename,
  1000. curline, *yytext&0377);
  1001. else
  1002. fprintf (stderr,
  1003. "%s:%s:%d: bad char '%c'\n",
  1004. progname, filename,
  1005. curline, *yytext);
  1006. return *yytext;
  1007. }
  1008. YY_BREAK
  1009. case 51:
  1010. YY_RULE_SETUP
  1011. #line 117 "lex.l"
  1012. ECHO;
  1013. YY_BREAK
  1014. #line 1161 "lex.c"
  1015. case YY_STATE_EOF(INITIAL):
  1016. yyterminate();
  1017. case YY_END_OF_BUFFER:
  1018. {
  1019. /* Amount of text matched not including the EOB char. */
  1020. int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
  1021. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1022. *yy_cp = (yy_hold_char);
  1023. YY_RESTORE_YY_MORE_OFFSET
  1024. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  1025. {
  1026. /* We're scanning a new file or input source. It's
  1027. * possible that this happened because the user
  1028. * just pointed yyin at a new source and called
  1029. * yylex(). If so, then we have to assure
  1030. * consistency between YY_CURRENT_BUFFER and our
  1031. * globals. Here is the right place to do so, because
  1032. * this is the first action (other than possibly a
  1033. * back-up) that will match for the new input source.
  1034. */
  1035. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1036. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  1037. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  1038. }
  1039. /* Note that here we test for yy_c_buf_p "<=" to the position
  1040. * of the first EOB in the buffer, since yy_c_buf_p will
  1041. * already have been incremented past the NUL character
  1042. * (since all states make transitions on EOB to the
  1043. * end-of-buffer state). Contrast this with the test
  1044. * in input().
  1045. */
  1046. if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  1047. { /* This was really a NUL. */
  1048. yy_state_type yy_next_state;
  1049. (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
  1050. yy_current_state = yy_get_previous_state( );
  1051. /* Okay, we're now positioned to make the NUL
  1052. * transition. We couldn't have
  1053. * yy_get_previous_state() go ahead and do it
  1054. * for us because it doesn't know how to deal
  1055. * with the possibility of jamming (and we don't
  1056. * want to build jamming into it because then it
  1057. * will run more slowly).
  1058. */
  1059. yy_next_state = yy_try_NUL_trans( yy_current_state );
  1060. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  1061. if ( yy_next_state )
  1062. {
  1063. /* Consume the NUL. */
  1064. yy_cp = ++(yy_c_buf_p);
  1065. yy_current_state = yy_next_state;
  1066. goto yy_match;
  1067. }
  1068. else
  1069. {
  1070. yy_cp = (yy_c_buf_p);
  1071. goto yy_find_action;
  1072. }
  1073. }
  1074. else switch ( yy_get_next_buffer( ) )
  1075. {
  1076. case EOB_ACT_END_OF_FILE:
  1077. {
  1078. (yy_did_buffer_switch_on_eof) = 0;
  1079. if ( yywrap( ) )
  1080. {
  1081. /* Note: because we've taken care in
  1082. * yy_get_next_buffer() to have set up
  1083. * yytext, we can now set up
  1084. * yy_c_buf_p so that if some total
  1085. * hoser (like flex itself) wants to
  1086. * call the scanner after we return the
  1087. * YY_NULL, it'll still work - another
  1088. * YY_NULL will get returned.
  1089. */
  1090. (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
  1091. yy_act = YY_STATE_EOF(YY_START);
  1092. goto do_action;
  1093. }
  1094. else
  1095. {
  1096. if ( ! (yy_did_buffer_switch_on_eof) )
  1097. YY_NEW_FILE;
  1098. }
  1099. break;
  1100. }
  1101. case EOB_ACT_CONTINUE_SCAN:
  1102. (yy_c_buf_p) =
  1103. (yytext_ptr) + yy_amount_of_matched_text;
  1104. yy_current_state = yy_get_previous_state( );
  1105. yy_cp = (yy_c_buf_p);
  1106. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  1107. goto yy_match;
  1108. case EOB_ACT_LAST_MATCH:
  1109. (yy_c_buf_p) =
  1110. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
  1111. yy_current_state = yy_get_previous_state( );
  1112. yy_cp = (yy_c_buf_p);
  1113. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  1114. goto yy_find_action;
  1115. }
  1116. break;
  1117. }
  1118. default:
  1119. YY_FATAL_ERROR(
  1120. "fatal flex scanner internal error--no action found" );
  1121. } /* end of action switch */
  1122. } /* end of scanning one token */
  1123. } /* end of yylex */
  1124. /* yy_get_next_buffer - try to read in a new buffer
  1125. *
  1126. * Returns a code representing an action:
  1127. * EOB_ACT_LAST_MATCH -
  1128. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1129. * EOB_ACT_END_OF_FILE - end of file
  1130. */
  1131. static int yy_get_next_buffer (void)
  1132. {
  1133. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1134. register char *source = (yytext_ptr);
  1135. register int number_to_move, i;
  1136. int ret_val;
  1137. if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
  1138. YY_FATAL_ERROR(
  1139. "fatal flex scanner internal error--end of buffer missed" );
  1140. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1141. { /* Don't try to fill the buffer, so this is an EOF. */
  1142. if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
  1143. {
  1144. /* We matched a single character, the EOB, so
  1145. * treat this as a final EOF.
  1146. */
  1147. return EOB_ACT_END_OF_FILE;
  1148. }
  1149. else
  1150. {
  1151. /* We matched some text prior to the EOB, first
  1152. * process it.
  1153. */
  1154. return EOB_ACT_LAST_MATCH;
  1155. }
  1156. }
  1157. /* Try to read more data. */
  1158. /* First move last chars to start of buffer. */
  1159. number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
  1160. for ( i = 0; i < number_to_move; ++i )
  1161. *(dest++) = *(source++);
  1162. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1163. /* don't do the read, it's not guaranteed to return an EOF,
  1164. * just force an EOF
  1165. */
  1166. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
  1167. else
  1168. {
  1169. int num_to_read =
  1170. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1171. while ( num_to_read <= 0 )
  1172. { /* Not enough room in the buffer - grow it. */
  1173. YY_FATAL_ERROR(
  1174. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  1175. }
  1176. if ( num_to_read > YY_READ_BUF_SIZE )
  1177. num_to_read = YY_READ_BUF_SIZE;
  1178. /* Read in more data. */
  1179. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1180. (yy_n_chars), (size_t) num_to_read );
  1181. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1182. }
  1183. if ( (yy_n_chars) == 0 )
  1184. {
  1185. if ( number_to_move == YY_MORE_ADJ )
  1186. {
  1187. ret_val = EOB_ACT_END_OF_FILE;
  1188. yyrestart(yyin );
  1189. }
  1190. else
  1191. {
  1192. ret_val = EOB_ACT_LAST_MATCH;
  1193. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1194. YY_BUFFER_EOF_PENDING;
  1195. }
  1196. }
  1197. else
  1198. ret_val = EOB_ACT_CONTINUE_SCAN;
  1199. (yy_n_chars) += number_to_move;
  1200. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
  1201. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
  1202. (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1203. return ret_val;
  1204. }
  1205. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1206. static yy_state_type yy_get_previous_state (void)
  1207. {
  1208. register yy_state_type yy_current_state;
  1209. register char *yy_cp;
  1210. yy_current_state = (yy_start);
  1211. yy_current_state += YY_AT_BOL();
  1212. (yy_state_ptr) = (yy_state_buf);
  1213. *(yy_state_ptr)++ = yy_current_state;
  1214. for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
  1215. {
  1216. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1217. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1218. {
  1219. yy_current_state = (int) yy_def[yy_current_state];
  1220. if ( yy_current_state >= 159 )
  1221. yy_c = yy_meta[(unsigned int) yy_c];
  1222. }
  1223. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1224. *(yy_state_ptr)++ = yy_current_state;
  1225. }
  1226. return yy_current_state;
  1227. }
  1228. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1229. *
  1230. * synopsis
  1231. * next_state = yy_try_NUL_trans( current_state );
  1232. */
  1233. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
  1234. {
  1235. register int yy_is_jam;
  1236. register YY_CHAR yy_c = 1;
  1237. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1238. {
  1239. yy_current_state = (int) yy_def[yy_current_state];
  1240. if ( yy_current_state >= 159 )
  1241. yy_c = yy_meta[(unsigned int) yy_c];
  1242. }
  1243. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1244. yy_is_jam = (yy_current_state == 158);
  1245. if ( ! yy_is_jam )
  1246. *(yy_state_ptr)++ = yy_current_state;
  1247. return yy_is_jam ? 0 : yy_current_state;
  1248. }
  1249. static void yyunput (int c, register char * yy_bp )
  1250. {
  1251. register char *yy_cp;
  1252. yy_cp = (yy_c_buf_p);
  1253. /* undo effects of setting up yytext */
  1254. *yy_cp = (yy_hold_char);
  1255. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1256. { /* need to shift things up to make room */
  1257. /* +2 for EOB chars. */
  1258. register int number_to_move = (yy_n_chars) + 2;
  1259. register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1260. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1261. register char *source =
  1262. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1263. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1264. *--dest = *--source;
  1265. yy_cp += (int) (dest - source);
  1266. yy_bp += (int) (dest - source);
  1267. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1268. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1269. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1270. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1271. }
  1272. *--yy_cp = (char) c;
  1273. (yytext_ptr) = yy_bp;
  1274. (yy_hold_char) = *yy_cp;
  1275. (yy_c_buf_p) = yy_cp;
  1276. }
  1277. #ifndef YY_NO_INPUT
  1278. #ifdef __cplusplus
  1279. static int yyinput (void)
  1280. #else
  1281. static int input (void)
  1282. #endif
  1283. {
  1284. int c;
  1285. *(yy_c_buf_p) = (yy_hold_char);
  1286. if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
  1287. {
  1288. /* yy_c_buf_p now points to the character we want to return.
  1289. * If this occurs *before* the EOB characters, then it's a
  1290. * valid NUL; if not, then we've hit the end of the buffer.
  1291. */
  1292. if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  1293. /* This was really a NUL. */
  1294. *(yy_c_buf_p) = '\0';
  1295. else
  1296. { /* need more input */
  1297. int offset = (yy_c_buf_p) - (yytext_ptr);
  1298. ++(yy_c_buf_p);
  1299. switch ( yy_get_next_buffer( ) )
  1300. {
  1301. case EOB_ACT_LAST_MATCH:
  1302. /* This happens because yy_g_n_b()
  1303. * sees that we've accumulated a
  1304. * token and flags that we need to
  1305. * try matching the token before
  1306. * proceeding. But for input(),
  1307. * there's no matching to consider.
  1308. * So convert the EOB_ACT_LAST_MATCH
  1309. * to EOB_ACT_END_OF_FILE.
  1310. */
  1311. /* Reset buffer status. */
  1312. yyrestart(yyin );
  1313. /*FALLTHROUGH*/
  1314. case EOB_ACT_END_OF_FILE:
  1315. {
  1316. if ( yywrap( ) )
  1317. return EOF;
  1318. if ( ! (yy_did_buffer_switch_on_eof) )
  1319. YY_NEW_FILE;
  1320. #ifdef __cplusplus
  1321. return yyinput();
  1322. #else
  1323. return input();
  1324. #endif
  1325. }
  1326. case EOB_ACT_CONTINUE_SCAN:
  1327. (yy_c_buf_p) = (yytext_ptr) + offset;
  1328. break;
  1329. }
  1330. }
  1331. }
  1332. c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
  1333. *(yy_c_buf_p) = '\0'; /* preserve yytext */
  1334. (yy_hold_char) = *++(yy_c_buf_p);
  1335. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
  1336. return c;
  1337. }
  1338. #endif /* ifndef YY_NO_INPUT */
  1339. /** Immediately switch to a different input stream.
  1340. * @param input_file A readable stream.
  1341. *
  1342. * @note This function does not reset the start condition to @c INITIAL .
  1343. */
  1344. void yyrestart (FILE * input_file )
  1345. {
  1346. if ( ! YY_CURRENT_BUFFER ){
  1347. yyensure_buffer_stack ();
  1348. YY_CURRENT_BUFFER_LVALUE =
  1349. yy_create_buffer(yyin,YY_BUF_SIZE );
  1350. }
  1351. yy_init_buffer(YY_CURRENT_BUFFER,input_file );
  1352. yy_load_buffer_state( );
  1353. }
  1354. /** Switch to a different input buffer.
  1355. * @param new_buffer The new input buffer.
  1356. *
  1357. */
  1358. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
  1359. {
  1360. /* TODO. We should be able to replace this entire function body
  1361. * with
  1362. * yypop_buffer_state();
  1363. * yypush_buffer_state(new_buffer);
  1364. */
  1365. yyensure_buffer_stack ();
  1366. if ( YY_CURRENT_BUFFER == new_buffer )
  1367. return;
  1368. if ( YY_CURRENT_BUFFER )
  1369. {
  1370. /* Flush out information for old buffer. */
  1371. *(yy_c_buf_p) = (yy_hold_char);
  1372. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1373. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1374. }
  1375. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1376. yy_load_buffer_state( );
  1377. /* We don't actually know whether we did this switch during
  1378. * EOF (yywrap()) processing, but the only time this flag
  1379. * is looked at is after yywrap() is called, so it's safe
  1380. * to go ahead and always set it.
  1381. */
  1382. (yy_did_buffer_switch_on_eof) = 1;
  1383. }
  1384. static void yy_load_buffer_state (void)
  1385. {
  1386. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1387. (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1388. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1389. (yy_hold_char) = *(yy_c_buf_p);
  1390. }
  1391. /** Allocate and initialize an input buffer state.
  1392. * @param file A readable stream.
  1393. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1394. *
  1395. * @return the allocated buffer state.
  1396. */
  1397. YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
  1398. {
  1399. YY_BUFFER_STATE b;
  1400. b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
  1401. if ( ! b )
  1402. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1403. b->yy_buf_size = size;
  1404. /* yy_ch_buf has to be 2 characters longer than the size given because
  1405. * we need to put in 2 end-of-buffer characters.
  1406. */
  1407. b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
  1408. if ( ! b->yy_ch_buf )
  1409. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1410. b->yy_is_our_buffer = 1;
  1411. yy_init_buffer(b,file );
  1412. return b;
  1413. }
  1414. /** Destroy the buffer.
  1415. * @param b a buffer created with yy_create_buffer()
  1416. *
  1417. */
  1418. void yy_delete_buffer (YY_BUFFER_STATE b )
  1419. {
  1420. if ( ! b )
  1421. return;
  1422. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1423. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1424. if ( b->yy_is_our_buffer )
  1425. yyfree((void *) b->yy_ch_buf );
  1426. yyfree((void *) b );
  1427. }
  1428. #ifndef __cplusplus
  1429. extern int isatty (int );
  1430. #endif /* __cplusplus */
  1431. /* Initializes or reinitializes a buffer.
  1432. * This function is sometimes called more than once on the same buffer,
  1433. * such as during a yyrestart() or at EOF.
  1434. */
  1435. static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
  1436. {
  1437. int oerrno = errno;
  1438. yy_flush_buffer(b );
  1439. b->yy_input_file = file;
  1440. b->yy_fill_buffer = 1;
  1441. /* If b is the current buffer, then yy_init_buffer was _probably_
  1442. * called from yyrestart() or through yy_get_next_buffer.
  1443. * In that case, we don't want to reset the lineno or column.
  1444. */
  1445. if (b != YY_CURRENT_BUFFER){
  1446. b->yy_bs_lineno = 1;
  1447. b->yy_bs_column = 0;
  1448. }
  1449. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1450. errno = oerrno;
  1451. }
  1452. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1453. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1454. *
  1455. */
  1456. void yy_flush_buffer (YY_BUFFER_STATE b )
  1457. {
  1458. if ( ! b )
  1459. return;
  1460. b->yy_n_chars = 0;
  1461. /* We always need two end-of-buffer characters. The first causes
  1462. * a transition to the end-of-buffer state. The second causes
  1463. * a jam in that state.
  1464. */
  1465. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1466. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1467. b->yy_buf_pos = &b->yy_ch_buf[0];
  1468. b->yy_at_bol = 1;
  1469. b->yy_buffer_status = YY_BUFFER_NEW;
  1470. if ( b == YY_CURRENT_BUFFER )
  1471. yy_load_buffer_state( );
  1472. }
  1473. /** Pushes the new state onto the stack. The new state becomes
  1474. * the current state. This function will allocate the stack
  1475. * if necessary.
  1476. * @param new_buffer The new state.
  1477. *
  1478. */
  1479. void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
  1480. {
  1481. if (new_buffer == NULL)
  1482. return;
  1483. yyensure_buffer_stack();
  1484. /* This block is copied from yy_switch_to_buffer. */
  1485. if ( YY_CURRENT_BUFFER )
  1486. {
  1487. /* Flush out information for old buffer. */
  1488. *(yy_c_buf_p) = (yy_hold_char);
  1489. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1490. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1491. }
  1492. /* Only push if top exists. Otherwise, replace top. */
  1493. if (YY_CURRENT_BUFFER)
  1494. (yy_buffer_stack_top)++;
  1495. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1496. /* copied from yy_switch_to_buffer. */
  1497. yy_load_buffer_state( );
  1498. (yy_did_buffer_switch_on_eof) = 1;
  1499. }
  1500. /** Removes and deletes the top of the stack, if present.
  1501. * The next element becomes the new top.
  1502. *
  1503. */
  1504. void yypop_buffer_state (void)
  1505. {
  1506. if (!YY_CURRENT_BUFFER)
  1507. return;
  1508. yy_delete_buffer(YY_CURRENT_BUFFER );
  1509. YY_CURRENT_BUFFER_LVALUE = NULL;
  1510. if ((yy_buffer_stack_top) > 0)
  1511. --(yy_buffer_stack_top);
  1512. if (YY_CURRENT_BUFFER) {
  1513. yy_load_buffer_state( );
  1514. (yy_did_buffer_switch_on_eof) = 1;
  1515. }
  1516. }
  1517. /* Allocates the stack if it does not exist.
  1518. * Guarantees space for at least one push.
  1519. */
  1520. static void yyensure_buffer_stack (void)
  1521. {
  1522. int num_to_alloc;
  1523. if (!(yy_buffer_stack)) {
  1524. /* First allocation is just for 2 elements, since we don't know if this
  1525. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1526. * immediate realloc on the next call.
  1527. */
  1528. num_to_alloc = 1;
  1529. (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
  1530. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1531. );
  1532. memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1533. (yy_buffer_stack_max) = num_to_alloc;
  1534. (yy_buffer_stack_top) = 0;
  1535. return;
  1536. }
  1537. if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
  1538. /* Increase the buffer to prepare for a possible push. */
  1539. int grow_size = 8 /* arbitrary grow size */;
  1540. num_to_alloc = (yy_buffer_stack_max) + grow_size;
  1541. (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
  1542. ((yy_buffer_stack),
  1543. num_to_alloc * sizeof(struct yy_buffer_state*)
  1544. );
  1545. /* zero only the new slots.*/
  1546. memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
  1547. (yy_buffer_stack_max) = num_to_alloc;
  1548. }
  1549. }
  1550. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1551. * @param base the character buffer
  1552. * @param size the size in bytes of the character buffer
  1553. *
  1554. * @return the newly allocated buffer state object.
  1555. */
  1556. YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
  1557. {
  1558. YY_BUFFER_STATE b;
  1559. if ( size < 2 ||
  1560. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1561. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1562. /* They forgot to leave room for the EOB's. */
  1563. return 0;
  1564. b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
  1565. if ( ! b )
  1566. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1567. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1568. b->yy_buf_pos = b->yy_ch_buf = base;
  1569. b->yy_is_our_buffer = 0;
  1570. b->yy_input_file = 0;
  1571. b->yy_n_chars = b->yy_buf_size;
  1572. b->yy_is_interactive = 0;
  1573. b->yy_at_bol = 1;
  1574. b->yy_fill_buffer = 0;
  1575. b->yy_buffer_status = YY_BUFFER_NEW;
  1576. yy_switch_to_buffer(b );
  1577. return b;
  1578. }
  1579. /** Setup the input buffer state to scan a string. The next call to yylex() will
  1580. * scan from a @e copy of @a str.
  1581. * @param yystr a NUL-terminated string to scan
  1582. *
  1583. * @return the newly allocated buffer state object.
  1584. * @note If you want to scan bytes that may contain NUL values, then use
  1585. * yy_scan_bytes() instead.
  1586. */
  1587. YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
  1588. {
  1589. return yy_scan_bytes(yystr,strlen(yystr) );
  1590. }
  1591. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  1592. * scan from a @e copy of @a bytes.
  1593. * @param bytes the byte buffer to scan
  1594. * @param len the number of bytes in the buffer pointed to by @a bytes.
  1595. *
  1596. * @return the newly allocated buffer state object.
  1597. */
  1598. YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
  1599. {
  1600. YY_BUFFER_STATE b;
  1601. char *buf;
  1602. yy_size_t n;
  1603. int i;
  1604. /* Get memory for full buffer, including space for trailing EOB's. */
  1605. n = _yybytes_len + 2;
  1606. buf = (char *) yyalloc(n );
  1607. if ( ! buf )
  1608. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1609. for ( i = 0; i < _yybytes_len; ++i )
  1610. buf[i] = yybytes[i];
  1611. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1612. b = yy_scan_buffer(buf,n );
  1613. if ( ! b )
  1614. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1615. /* It's okay to grow etc. this buffer, and we should throw it
  1616. * away when we're done.
  1617. */
  1618. b->yy_is_our_buffer = 1;
  1619. return b;
  1620. }
  1621. #ifndef YY_EXIT_FAILURE
  1622. #define YY_EXIT_FAILURE 2
  1623. #endif
  1624. static void yy_fatal_error (yyconst char* msg )
  1625. {
  1626. (void) fprintf( stderr, "%s\n", msg );
  1627. exit( YY_EXIT_FAILURE );
  1628. }
  1629. /* Redefine yyless() so it works in section 3 code. */
  1630. #undef yyless
  1631. #define yyless(n) \
  1632. do \
  1633. { \
  1634. /* Undo effects of setting up yytext. */ \
  1635. int yyless_macro_arg = (n); \
  1636. YY_LESS_LINENO(yyless_macro_arg);\
  1637. yytext[yyleng] = (yy_hold_char); \
  1638. (yy_c_buf_p) = yytext + yyless_macro_arg; \
  1639. (yy_hold_char) = *(yy_c_buf_p); \
  1640. *(yy_c_buf_p) = '\0'; \
  1641. yyleng = yyless_macro_arg; \
  1642. } \
  1643. while ( 0 )
  1644. /* Accessor methods (get/set functions) to struct members. */
  1645. /** Get the current line number.
  1646. *
  1647. */
  1648. int yyget_lineno (void)
  1649. {
  1650. return yylineno;
  1651. }
  1652. /** Get the input stream.
  1653. *
  1654. */
  1655. FILE *yyget_in (void)
  1656. {
  1657. return yyin;
  1658. }
  1659. /** Get the output stream.
  1660. *
  1661. */
  1662. FILE *yyget_out (void)
  1663. {
  1664. return yyout;
  1665. }
  1666. /** Get the length of the current token.
  1667. *
  1668. */
  1669. int yyget_leng (void)
  1670. {
  1671. return yyleng;
  1672. }
  1673. /** Get the current token.
  1674. *
  1675. */
  1676. char *yyget_text (void)
  1677. {
  1678. return yytext;
  1679. }
  1680. /** Set the current line number.
  1681. * @param line_number
  1682. *
  1683. */
  1684. void yyset_lineno (int line_number )
  1685. {
  1686. yylineno = line_number;
  1687. }
  1688. /** Set the input stream. This does not discard the current
  1689. * input buffer.
  1690. * @param in_str A readable stream.
  1691. *
  1692. * @see yy_switch_to_buffer
  1693. */
  1694. void yyset_in (FILE * in_str )
  1695. {
  1696. yyin = in_str ;
  1697. }
  1698. void yyset_out (FILE * out_str )
  1699. {
  1700. yyout = out_str ;
  1701. }
  1702. int yyget_debug (void)
  1703. {
  1704. return yy_flex_debug;
  1705. }
  1706. void yyset_debug (int bdebug )
  1707. {
  1708. yy_flex_debug = bdebug ;
  1709. }
  1710. static int yy_init_globals (void)
  1711. {
  1712. /* Initialization is the same as for the non-reentrant scanner.
  1713. * This function is called from yylex_destroy(), so don't allocate here.
  1714. */
  1715. (yy_buffer_stack) = 0;
  1716. (yy_buffer_stack_top) = 0;
  1717. (yy_buffer_stack_max) = 0;
  1718. (yy_c_buf_p) = (char *) 0;
  1719. (yy_init) = 0;
  1720. (yy_start) = 0;
  1721. (yy_state_buf) = 0;
  1722. (yy_state_ptr) = 0;
  1723. (yy_full_match) = 0;
  1724. (yy_lp) = 0;
  1725. /* Defined in main.c */
  1726. #ifdef YY_STDINIT
  1727. yyin = stdin;
  1728. yyout = stdout;
  1729. #else
  1730. yyin = (FILE *) 0;
  1731. yyout = (FILE *) 0;
  1732. #endif
  1733. /* For future reference: Set errno on error, since we are called by
  1734. * yylex_init()
  1735. */
  1736. return 0;
  1737. }
  1738. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  1739. int yylex_destroy (void)
  1740. {
  1741. /* Pop the buffer stack, destroying each element. */
  1742. while(YY_CURRENT_BUFFER){
  1743. yy_delete_buffer(YY_CURRENT_BUFFER );
  1744. YY_CURRENT_BUFFER_LVALUE = NULL;
  1745. yypop_buffer_state();
  1746. }
  1747. /* Destroy the stack itself. */
  1748. yyfree((yy_buffer_stack) );
  1749. (yy_buffer_stack) = NULL;
  1750. yyfree ( (yy_state_buf) );
  1751. (yy_state_buf) = NULL;
  1752. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  1753. * yylex() is called, initialization will occur. */
  1754. yy_init_globals( );
  1755. return 0;
  1756. }
  1757. /*
  1758. * Internal utility routines.
  1759. */
  1760. #ifndef yytext_ptr
  1761. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
  1762. {
  1763. register int i;
  1764. for ( i = 0; i < n; ++i )
  1765. s1[i] = s2[i];
  1766. }
  1767. #endif
  1768. #ifdef YY_NEED_STRLEN
  1769. static int yy_flex_strlen (yyconst char * s )
  1770. {
  1771. register int n;
  1772. for ( n = 0; s[n]; ++n )
  1773. ;
  1774. return n;
  1775. }
  1776. #endif
  1777. void *yyalloc (yy_size_t size )
  1778. {
  1779. return (void *) malloc( size );
  1780. }
  1781. void *yyrealloc (void * ptr, yy_size_t size )
  1782. {
  1783. /* The cast to (char *) in the following accommodates both
  1784. * implementations that use char* generic pointers, and those
  1785. * that use void* generic pointers. It works with the latter
  1786. * because both ANSI C and C++ allow castless assignment from
  1787. * any pointer type to void*, and deal with argument conversions
  1788. * as though doing an assignment.
  1789. */
  1790. return (void *) realloc( (char *) ptr, size );
  1791. }
  1792. void yyfree (void * ptr )
  1793. {
  1794. free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
  1795. }
  1796. #define YYTABLES_NAME "yytables"
  1797. #line 117 "lex.l"
  1798. /*
  1799. * space management for the lexer
  1800. */
  1801. struct lex *
  1802. lalloc (void)
  1803. {
  1804. struct lex *lp;
  1805. lp = (struct lex *)xmalloc (sizeof(struct lex));
  1806. lp->lx_u.lxu_value = 0.0;
  1807. lp->lx_lino = 0;
  1808. return lp;
  1809. }
  1810. void
  1811. lfree (struct lex *lp)
  1812. {
  1813. if (lp != NULL)
  1814. free ((void *)lp);
  1815. }