The Sol Programming Language!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lex.yy.c 55KB

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