main.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. /* flex - tool to generate fast lexical analyzers */
  2. /*-
  3. * Copyright (c) 1990 The Regents of the University of California.
  4. * All rights reserved.
  5. *
  6. * This code is derived from software contributed to Berkeley by
  7. * Vern Paxson.
  8. *
  9. * The United States Government has rights in this work pursuant
  10. * to contract no. DE-AC03-76SF00098 between the United States
  11. * Department of Energy and the University of California.
  12. *
  13. * Redistribution and use in source and binary forms are permitted provided
  14. * that: (1) source distributions retain this entire copyright notice and
  15. * comment, and (2) distributions including binaries display the following
  16. * acknowledgement: ``This product includes software developed by the
  17. * University of California, Berkeley and its contributors'' in the
  18. * documentation or other materials provided with the distribution and in
  19. * all advertising materials mentioning features or use of this software.
  20. * Neither the name of the University nor the names of its contributors may
  21. * be used to endorse or promote products derived from this software without
  22. * specific prior written permission.
  23. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  24. * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  25. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  26. */
  27. #ifndef lint
  28. char copyright[] =
  29. "@(#) Copyright (c) 1990 The Regents of the University of California.\n\
  30. All rights reserved.\n";
  31. #endif /* not lint */
  32. #ifndef lint
  33. static char rcsid[] =
  34. "@(#) $Id$ (LBL)";
  35. #endif
  36. #include "flexdef.h"
  37. static char flex_version[] = "2.3";
  38. /* declare functions that have forward references */
  39. void flexinit PROTO((int, char**));
  40. void readin PROTO(());
  41. void set_up_initial_allocations PROTO(());
  42. /* these globals are all defined and commented in flexdef.h */
  43. int printstats, syntaxerror, eofseen, ddebug, trace, spprdflt;
  44. int interactive, caseins, useecs, fulltbl, usemecs;
  45. int fullspd, gen_line_dirs, performance_report, backtrack_report, csize;
  46. int yymore_used, reject, real_reject, continued_action;
  47. int yymore_really_used, reject_really_used;
  48. int datapos, dataline, linenum;
  49. FILE *skelfile = NULL;
  50. char *infilename = NULL;
  51. int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
  52. int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
  53. int current_mns, num_rules, current_max_rules, lastnfa;
  54. int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
  55. int *accptnum, *assoc_rule, *state_type, *rule_type, *rule_linenum;
  56. int current_state_type;
  57. int variable_trailing_context_rules;
  58. int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
  59. int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
  60. int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs, tecfwd[CSIZE + 1];
  61. int tecbck[CSIZE + 1];
  62. int *xlation = (int *) 0;
  63. int num_xlations;
  64. int lastsc, current_max_scs, *scset, *scbol, *scxclu, *sceof, *actvsc;
  65. char **scname;
  66. int current_max_dfa_size, current_max_xpairs;
  67. int current_max_template_xpairs, current_max_dfas;
  68. int lastdfa, *nxt, *chk, *tnxt;
  69. int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
  70. union dfaacc_union *dfaacc;
  71. int *accsiz, *dhash, numas;
  72. int numsnpairs, jambase, jamstate;
  73. int lastccl, current_maxccls, *cclmap, *ccllen, *cclng, cclreuse;
  74. int current_max_ccl_tbl_size;
  75. Char *ccltbl;
  76. char *starttime, *endtime, nmstr[MAXLINE];
  77. int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
  78. int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
  79. int num_backtracking, bol_needed;
  80. FILE *temp_action_file;
  81. FILE *backtrack_file;
  82. int end_of_buffer_state;
  83. char *action_file_name = NULL;
  84. char **input_files;
  85. int num_input_files;
  86. char *program_name;
  87. #ifndef SHORT_FILE_NAMES
  88. static char *outfile = "lex.yy.c";
  89. #else
  90. static char *outfile = "lexyy.c";
  91. #endif
  92. static int outfile_created = 0;
  93. static int use_stdout;
  94. static char *skelname = NULL;
  95. int main( argc, argv )
  96. int argc;
  97. char **argv;
  98. {
  99. flexinit( argc, argv );
  100. readin();
  101. if ( syntaxerror )
  102. flexend( 1 );
  103. if ( yymore_really_used == REALLY_USED )
  104. yymore_used = true;
  105. else if ( yymore_really_used == REALLY_NOT_USED )
  106. yymore_used = false;
  107. if ( reject_really_used == REALLY_USED )
  108. reject = true;
  109. else if ( reject_really_used == REALLY_NOT_USED )
  110. reject = false;
  111. if ( performance_report )
  112. {
  113. if ( interactive )
  114. fprintf( stderr,
  115. "-I (interactive) entails a minor performance penalty\n" );
  116. if ( yymore_used )
  117. fprintf( stderr, "yymore() entails a minor performance penalty\n" );
  118. if ( reject )
  119. fprintf( stderr, "REJECT entails a large performance penalty\n" );
  120. if ( variable_trailing_context_rules )
  121. fprintf( stderr,
  122. "Variable trailing context rules entail a large performance penalty\n" );
  123. }
  124. if ( reject )
  125. real_reject = true;
  126. if ( variable_trailing_context_rules )
  127. reject = true;
  128. if ( (fulltbl || fullspd) && reject )
  129. {
  130. if ( real_reject )
  131. flexerror( "REJECT cannot be used with -f or -F" );
  132. else
  133. flexerror(
  134. "variable trailing context rules cannot be used with -f or -F" );
  135. }
  136. ntod();
  137. /* generate the C state transition tables from the DFA */
  138. make_tables();
  139. /* note, flexend does not return. It exits with its argument as status. */
  140. flexend( 0 );
  141. /*NOTREACHED*/
  142. }
  143. /* flexend - terminate flex
  144. *
  145. * synopsis
  146. * int status;
  147. * flexend( status );
  148. *
  149. * status is exit status.
  150. *
  151. * note
  152. * This routine does not return.
  153. */
  154. void flexend( status )
  155. int status;
  156. {
  157. int tblsiz;
  158. char *flex_gettime();
  159. if ( skelfile != NULL )
  160. {
  161. if ( ferror( skelfile ) )
  162. flexfatal( "error occurred when writing skeleton file" );
  163. else if ( fclose( skelfile ) )
  164. flexfatal( "error occurred when closing skeleton file" );
  165. }
  166. if ( temp_action_file )
  167. {
  168. if ( ferror( temp_action_file ) )
  169. flexfatal( "error occurred when writing temporary action file" );
  170. else if ( fclose( temp_action_file ) )
  171. flexfatal( "error occurred when closing temporary action file" );
  172. else if ( unlink( action_file_name ) )
  173. flexfatal( "error occurred when deleting temporary action file" );
  174. }
  175. if ( status != 0 && outfile_created )
  176. {
  177. if ( ferror( stdout ) )
  178. flexfatal( "error occurred when writing output file" );
  179. else if ( fclose( stdout ) )
  180. flexfatal( "error occurred when closing output file" );
  181. else if ( unlink( outfile ) )
  182. flexfatal( "error occurred when deleting output file" );
  183. }
  184. if ( backtrack_report && backtrack_file )
  185. {
  186. if ( num_backtracking == 0 )
  187. fprintf( backtrack_file, "No backtracking.\n" );
  188. else if ( fullspd || fulltbl )
  189. fprintf( backtrack_file,
  190. "%d backtracking (non-accepting) states.\n",
  191. num_backtracking );
  192. else
  193. fprintf( backtrack_file, "Compressed tables always backtrack.\n" );
  194. if ( ferror( backtrack_file ) )
  195. flexfatal( "error occurred when writing backtracking file" );
  196. else if ( fclose( backtrack_file ) )
  197. flexfatal( "error occurred when closing backtracking file" );
  198. }
  199. if ( printstats )
  200. {
  201. endtime = flex_gettime();
  202. fprintf( stderr, "%s version %s usage statistics:\n", program_name,
  203. flex_version );
  204. fprintf( stderr, " started at %s, finished at %s\n",
  205. starttime, endtime );
  206. fprintf( stderr, " scanner options: -" );
  207. if ( backtrack_report )
  208. putc( 'b', stderr );
  209. if ( ddebug )
  210. putc( 'd', stderr );
  211. if ( interactive )
  212. putc( 'I', stderr );
  213. if ( caseins )
  214. putc( 'i', stderr );
  215. if ( ! gen_line_dirs )
  216. putc( 'L', stderr );
  217. if ( performance_report )
  218. putc( 'p', stderr );
  219. if ( spprdflt )
  220. putc( 's', stderr );
  221. if ( use_stdout )
  222. putc( 't', stderr );
  223. if ( trace )
  224. putc( 'T', stderr );
  225. if ( printstats )
  226. putc( 'v', stderr ); /* always true! */
  227. if ( csize == 256 )
  228. putc( '8', stderr );
  229. fprintf( stderr, " -C" );
  230. if ( fulltbl )
  231. putc( 'f', stderr );
  232. if ( fullspd )
  233. putc( 'F', stderr );
  234. if ( useecs )
  235. putc( 'e', stderr );
  236. if ( usemecs )
  237. putc( 'm', stderr );
  238. if ( strcmp( skelname, DEFAULT_SKELETON_FILE ) )
  239. fprintf( stderr, " -S%s", skelname );
  240. putc( '\n', stderr );
  241. fprintf( stderr, " %d/%d NFA states\n", lastnfa, current_mns );
  242. fprintf( stderr, " %d/%d DFA states (%d words)\n", lastdfa,
  243. current_max_dfas, totnst );
  244. fprintf( stderr,
  245. " %d rules\n", num_rules - 1 /* - 1 for def. rule */ );
  246. if ( num_backtracking == 0 )
  247. fprintf( stderr, " No backtracking\n" );
  248. else if ( fullspd || fulltbl )
  249. fprintf( stderr, " %d backtracking (non-accepting) states\n",
  250. num_backtracking );
  251. else
  252. fprintf( stderr, " compressed tables always backtrack\n" );
  253. if ( bol_needed )
  254. fprintf( stderr, " Beginning-of-line patterns used\n" );
  255. fprintf( stderr, " %d/%d start conditions\n", lastsc,
  256. current_max_scs );
  257. fprintf( stderr, " %d epsilon states, %d double epsilon states\n",
  258. numeps, eps2 );
  259. if ( lastccl == 0 )
  260. fprintf( stderr, " no character classes\n" );
  261. else
  262. fprintf( stderr,
  263. " %d/%d character classes needed %d/%d words of storage, %d reused\n",
  264. lastccl, current_maxccls,
  265. cclmap[lastccl] + ccllen[lastccl],
  266. current_max_ccl_tbl_size, cclreuse );
  267. fprintf( stderr, " %d state/nextstate pairs created\n", numsnpairs );
  268. fprintf( stderr, " %d/%d unique/duplicate transitions\n",
  269. numuniq, numdup );
  270. if ( fulltbl )
  271. {
  272. tblsiz = lastdfa * numecs;
  273. fprintf( stderr, " %d table entries\n", tblsiz );
  274. }
  275. else
  276. {
  277. tblsiz = 2 * (lastdfa + numtemps) + 2 * tblend;
  278. fprintf( stderr, " %d/%d base-def entries created\n",
  279. lastdfa + numtemps, current_max_dfas );
  280. fprintf( stderr, " %d/%d (peak %d) nxt-chk entries created\n",
  281. tblend, current_max_xpairs, peakpairs );
  282. fprintf( stderr,
  283. " %d/%d (peak %d) template nxt-chk entries created\n",
  284. numtemps * nummecs, current_max_template_xpairs,
  285. numtemps * numecs );
  286. fprintf( stderr, " %d empty table entries\n", nummt );
  287. fprintf( stderr, " %d protos created\n", numprots );
  288. fprintf( stderr, " %d templates created, %d uses\n",
  289. numtemps, tmpuses );
  290. }
  291. if ( useecs )
  292. {
  293. tblsiz = tblsiz + csize;
  294. fprintf( stderr, " %d/%d equivalence classes created\n",
  295. numecs, csize );
  296. }
  297. if ( usemecs )
  298. {
  299. tblsiz = tblsiz + numecs;
  300. fprintf( stderr, " %d/%d meta-equivalence classes created\n",
  301. nummecs, csize );
  302. }
  303. fprintf( stderr, " %d (%d saved) hash collisions, %d DFAs equal\n",
  304. hshcol, hshsave, dfaeql );
  305. fprintf( stderr, " %d sets of reallocations needed\n", num_reallocs );
  306. fprintf( stderr, " %d total table entries needed\n", tblsiz );
  307. }
  308. #ifndef VMS
  309. exit( status );
  310. #else
  311. exit( status + 1 );
  312. #endif
  313. }
  314. /* flexinit - initialize flex
  315. *
  316. * synopsis
  317. * int argc;
  318. * char **argv;
  319. * flexinit( argc, argv );
  320. */
  321. void flexinit( argc, argv )
  322. int argc;
  323. char **argv;
  324. {
  325. int i, sawcmpflag;
  326. char *arg, *flex_gettime(), *mktemp();
  327. printstats = syntaxerror = trace = spprdflt = interactive = caseins = false;
  328. backtrack_report = performance_report = ddebug = fulltbl = fullspd = false;
  329. yymore_used = continued_action = reject = false;
  330. yymore_really_used = reject_really_used = false;
  331. gen_line_dirs = usemecs = useecs = true;
  332. sawcmpflag = false;
  333. use_stdout = false;
  334. csize = DEFAULT_CSIZE;
  335. program_name = argv[0];
  336. /* read flags */
  337. for ( --argc, ++argv; argc ; --argc, ++argv )
  338. {
  339. if ( argv[0][0] != '-' || argv[0][1] == '\0' )
  340. break;
  341. arg = argv[0];
  342. for ( i = 1; arg[i] != '\0'; ++i )
  343. switch ( arg[i] )
  344. {
  345. case 'b':
  346. backtrack_report = true;
  347. break;
  348. case 'c':
  349. fprintf( stderr,
  350. "%s: Assuming use of deprecated -c flag is really intended to be -C\n",
  351. program_name );
  352. /* fall through */
  353. case 'C':
  354. if ( i != 1 )
  355. flexerror( "-C flag must be given separately" );
  356. if ( ! sawcmpflag )
  357. {
  358. useecs = false;
  359. usemecs = false;
  360. fulltbl = false;
  361. sawcmpflag = true;
  362. }
  363. for ( ++i; arg[i] != '\0'; ++i )
  364. switch ( arg[i] )
  365. {
  366. case 'e':
  367. useecs = true;
  368. break;
  369. case 'F':
  370. fullspd = true;
  371. break;
  372. case 'f':
  373. fulltbl = true;
  374. break;
  375. case 'm':
  376. usemecs = true;
  377. break;
  378. default:
  379. lerrif( "unknown -C option '%c'",
  380. (int) arg[i] );
  381. break;
  382. }
  383. goto get_next_arg;
  384. case 'd':
  385. ddebug = true;
  386. break;
  387. case 'f':
  388. useecs = usemecs = false;
  389. fulltbl = true;
  390. break;
  391. case 'F':
  392. useecs = usemecs = false;
  393. fullspd = true;
  394. break;
  395. case 'I':
  396. interactive = true;
  397. break;
  398. case 'i':
  399. caseins = true;
  400. break;
  401. case 'L':
  402. gen_line_dirs = false;
  403. break;
  404. case 'n':
  405. /* stupid do-nothing deprecated option */
  406. break;
  407. case 'p':
  408. performance_report = true;
  409. break;
  410. case 'S':
  411. if ( i != 1 )
  412. flexerror( "-S flag must be given separately" );
  413. skelname = arg + i + 1;
  414. goto get_next_arg;
  415. case 's':
  416. spprdflt = true;
  417. break;
  418. case 't':
  419. use_stdout = true;
  420. break;
  421. case 'T':
  422. trace = true;
  423. break;
  424. case 'v':
  425. printstats = true;
  426. break;
  427. case '8':
  428. csize = CSIZE;
  429. break;
  430. default:
  431. lerrif( "unknown flag '%c'", (int) arg[i] );
  432. break;
  433. }
  434. get_next_arg: /* used by -C and -S flags in lieu of a "continue 2" control */
  435. ;
  436. }
  437. if ( (fulltbl || fullspd) && usemecs )
  438. flexerror( "full table and -Cm don't make sense together" );
  439. if ( (fulltbl || fullspd) && interactive )
  440. flexerror( "full table and -I are (currently) incompatible" );
  441. if ( fulltbl && fullspd )
  442. flexerror( "full table and -F are mutually exclusive" );
  443. if ( ! skelname )
  444. {
  445. static char skeleton_name_storage[400];
  446. skelname = skeleton_name_storage;
  447. (void) strcpy( skelname, DEFAULT_SKELETON_FILE );
  448. }
  449. if ( ! use_stdout )
  450. {
  451. FILE *prev_stdout = freopen( outfile, "w", stdout );
  452. if ( prev_stdout == NULL )
  453. lerrsf( "could not create %s", outfile );
  454. outfile_created = 1;
  455. }
  456. num_input_files = argc;
  457. input_files = argv;
  458. set_input_file( num_input_files > 0 ? input_files[0] : NULL );
  459. if ( backtrack_report )
  460. {
  461. #ifndef SHORT_FILE_NAMES
  462. backtrack_file = fopen( "lex.backtrack", "w" );
  463. #else
  464. backtrack_file = fopen( "lex.bck", "w" );
  465. #endif
  466. if ( backtrack_file == NULL )
  467. flexerror( "could not create lex.backtrack" );
  468. }
  469. else
  470. backtrack_file = NULL;
  471. lastccl = 0;
  472. lastsc = 0;
  473. /* initialize the statistics */
  474. starttime = flex_gettime();
  475. if ( (skelfile = fopen( skelname, "r" )) == NULL )
  476. lerrsf( "can't open skeleton file %s", skelname );
  477. #ifndef ACK_MOD
  478. #ifdef SYS_V
  479. action_file_name = tmpnam( NULL );
  480. #endif
  481. #endif
  482. if ( action_file_name == NULL )
  483. {
  484. static char temp_action_file_name[32];
  485. #ifndef SHORT_FILE_NAMES
  486. (void) strcpy( temp_action_file_name, "/tmp/flexXXXXXX" );
  487. #else
  488. (void) strcpy( temp_action_file_name, "flexXXXXXX.tmp" );
  489. #endif
  490. (void) mktemp( temp_action_file_name );
  491. action_file_name = temp_action_file_name;
  492. }
  493. if ( (temp_action_file = fopen( action_file_name, "w" )) == NULL )
  494. lerrsf( "can't open temporary action file %s", action_file_name );
  495. lastdfa = lastnfa = num_rules = numas = numsnpairs = tmpuses = 0;
  496. numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst = 0;
  497. numuniq = numdup = hshsave = eofseen = datapos = dataline = 0;
  498. num_backtracking = onesp = numprots = 0;
  499. variable_trailing_context_rules = bol_needed = false;
  500. linenum = sectnum = 1;
  501. firstprot = NIL;
  502. /* used in mkprot() so that the first proto goes in slot 1
  503. * of the proto queue
  504. */
  505. lastprot = 1;
  506. if ( useecs )
  507. { /* set up doubly-linked equivalence classes */
  508. /* We loop all the way up to csize, since ecgroup[csize] is the
  509. * position used for NUL characters
  510. */
  511. ecgroup[1] = NIL;
  512. for ( i = 2; i <= csize; ++i )
  513. {
  514. ecgroup[i] = i - 1;
  515. nextecm[i - 1] = i;
  516. }
  517. nextecm[csize] = NIL;
  518. }
  519. else
  520. { /* put everything in its own equivalence class */
  521. for ( i = 1; i <= csize; ++i )
  522. {
  523. ecgroup[i] = i;
  524. nextecm[i] = BAD_SUBSCRIPT; /* to catch errors */
  525. }
  526. }
  527. set_up_initial_allocations();
  528. }
  529. /* readin - read in the rules section of the input file(s)
  530. *
  531. * synopsis
  532. * readin();
  533. */
  534. void readin()
  535. {
  536. skelout();
  537. if ( ddebug )
  538. puts( "#define FLEX_DEBUG" );
  539. if ( csize == 256 )
  540. puts( "#define YY_CHAR unsigned char" );
  541. else
  542. puts( "#define YY_CHAR char" );
  543. line_directive_out( stdout );
  544. if ( yyparse() )
  545. {
  546. pinpoint_message( "fatal parse error" );
  547. flexend( 1 );
  548. }
  549. if ( xlation )
  550. {
  551. numecs = ecs_from_xlation( ecgroup );
  552. useecs = true;
  553. }
  554. else if ( useecs )
  555. numecs = cre8ecs( nextecm, ecgroup, csize );
  556. else
  557. numecs = csize;
  558. /* now map the equivalence class for NUL to its expected place */
  559. ecgroup[0] = ecgroup[csize];
  560. NUL_ec = abs( ecgroup[0] );
  561. if ( useecs )
  562. ccl2ecl();
  563. }
  564. /* set_up_initial_allocations - allocate memory for internal tables */
  565. void set_up_initial_allocations()
  566. {
  567. current_mns = INITIAL_MNS;
  568. firstst = allocate_integer_array( current_mns );
  569. lastst = allocate_integer_array( current_mns );
  570. finalst = allocate_integer_array( current_mns );
  571. transchar = allocate_integer_array( current_mns );
  572. trans1 = allocate_integer_array( current_mns );
  573. trans2 = allocate_integer_array( current_mns );
  574. accptnum = allocate_integer_array( current_mns );
  575. assoc_rule = allocate_integer_array( current_mns );
  576. state_type = allocate_integer_array( current_mns );
  577. current_max_rules = INITIAL_MAX_RULES;
  578. rule_type = allocate_integer_array( current_max_rules );
  579. rule_linenum = allocate_integer_array( current_max_rules );
  580. current_max_scs = INITIAL_MAX_SCS;
  581. scset = allocate_integer_array( current_max_scs );
  582. scbol = allocate_integer_array( current_max_scs );
  583. scxclu = allocate_integer_array( current_max_scs );
  584. sceof = allocate_integer_array( current_max_scs );
  585. scname = allocate_char_ptr_array( current_max_scs );
  586. actvsc = allocate_integer_array( current_max_scs );
  587. current_maxccls = INITIAL_MAX_CCLS;
  588. cclmap = allocate_integer_array( current_maxccls );
  589. ccllen = allocate_integer_array( current_maxccls );
  590. cclng = allocate_integer_array( current_maxccls );
  591. current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE;
  592. ccltbl = allocate_character_array( current_max_ccl_tbl_size );
  593. current_max_dfa_size = INITIAL_MAX_DFA_SIZE;
  594. current_max_xpairs = INITIAL_MAX_XPAIRS;
  595. nxt = allocate_integer_array( current_max_xpairs );
  596. chk = allocate_integer_array( current_max_xpairs );
  597. current_max_template_xpairs = INITIAL_MAX_TEMPLATE_XPAIRS;
  598. tnxt = allocate_integer_array( current_max_template_xpairs );
  599. current_max_dfas = INITIAL_MAX_DFAS;
  600. base = allocate_integer_array( current_max_dfas );
  601. def = allocate_integer_array( current_max_dfas );
  602. dfasiz = allocate_integer_array( current_max_dfas );
  603. accsiz = allocate_integer_array( current_max_dfas );
  604. dhash = allocate_integer_array( current_max_dfas );
  605. dss = allocate_int_ptr_array( current_max_dfas );
  606. dfaacc = allocate_dfaacc_union( current_max_dfas );
  607. nultrans = (int *) 0;
  608. }