home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c100 / 5.ddi / FLEX.ZIP / FLEXDEF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-27  |  20.9 KB  |  583 lines

  1. /*
  2.  *  Definitions for flex.
  3.  *
  4.  * modification history
  5.  * --------------------
  6.  * 02c raw    07May88  .added MSDOS defines for MSC 5.0.
  7.  * 02b kg, vp   30sep87  .added definitions for fast scanner; misc. cleanup
  8.  * 02a vp       27jun86  .translated into C/FTL
  9.  */
  10.  
  11. /*
  12.  * Copyright (c) 1987, the University of California
  13.  * 
  14.  * The United States Government has rights in this work pursuant to
  15.  * contract no. DE-AC03-76SF00098 between the United States Department of
  16.  * Energy and the University of California.
  17.  * 
  18.  * This program may be redistributed.  Enhancements and derivative works
  19.  * may be created provided the new works, if made available to the general
  20.  * public, are made available for use by anyone.
  21.  */
  22.  
  23. #include <stdio.h>
  24.  
  25. #ifdef SV
  26. #include <string.h>
  27. #define bzero(s, n) memset((char *)(s), '\000', (unsigned)(n))
  28. #else
  29. #include <strings.h>
  30. #endif
  31.  
  32. #ifndef MSDOS
  33. char *sprintf(); /* keep lint happy */
  34. #endif
  35.  
  36. /* maximum line length we'll have to deal with */
  37. #define MAXLINE BUFSIZ
  38.  
  39. /* maximum size of file name */
  40. #define FILENAMESIZE 1024
  41.  
  42. #define min(x,y) (x < y ? x : y)
  43. #define max(x,y) (x > y ? x : y)
  44.  
  45. #define true 1
  46. #define false 0
  47.  
  48. #ifndef DEFAULT_SKELETON_FILE
  49.  #ifdef MSDOS
  50.   #define DEFAULT_SKELETON_FILE "/lib/flex.skl"
  51.  #else
  52.   #define DEFAULT_SKELETON_FILE "flex.skel"
  53.  #endif
  54. #endif
  55.  
  56. #ifndef FAST_SKELETON_FILE
  57.  #ifdef MSDOS
  58.   #define FAST_SKELETON_FILE "/lib/flex.fst"
  59.  #else
  60.   #define FAST_SKELETON_FILE "flex.fastskel"
  61.  #endif
  62. #endif
  63.  
  64. /*special nxt[] action number for the "at the end of the input buffer" state*/
  65. /* note: -1 is already taken by YY_NEW_FILE */
  66.  
  67. #define END_OF_BUFFER_ACTION -3
  68. /* action number for default action for fast scanners */
  69. #define DEFAULT_ACTION -2
  70.  
  71. /* special chk[] values marking the slots taking by end-of-buffer and action
  72.  * numbers
  73.  */
  74. #define EOB_POSITION -1
  75. #define ACTION_POSITION -2
  76.  
  77. /* number of data items per line for -f output */
  78. #define NUMDATAITEMS 10
  79.  
  80. /* number of lines of data in -f output before inserting a blank line for
  81.  * readability.
  82.  */
  83. #define NUMDATALINES 10
  84.  
  85. /* transition_struct_out() definitions */
  86. #define TRANS_STRUCT_PRINT_LENGTH 15
  87.  
  88. /* returns true if an nfa state has an epsilon out-transition slot
  89.  * that can be used.  This definition is currently not used.
  90.  */
  91. #define FREE_EPSILON(state) \
  92.     (transchar[state] == SYM_EPSILON && \
  93.      trans2[state] == NO_TRANSITION && \
  94.      finalst[state] != state)
  95.  
  96. /* returns true if an nfa state has an epsilon out-transition character
  97.  * and both slots are free
  98.  */
  99. #define SUPER_FREE_EPSILON(state) \
  100.     (transchar[state] == SYM_EPSILON && \
  101.      trans1[state] == NO_TRANSITION) \
  102.  
  103. /*
  104.  * HACK NOTE:  The following definitions have been rearranged and
  105.  *    centralized here for ease of modification.  "MSDOS",
  106.  *    "M_I86SM", and "M_I86LM" are predefined by the MSC 5.0
  107.  *    compiler.  The default is to assume Xenix/Unix.
  108.  *
  109.  *    Definitions for MSC Large Model are identical to
  110.  *    those for Unix/Xenix.  Haven't tried them yet with MSC under
  111.  *    MSDOS, but they did compile with the DOS compiler on SCO Xenix Sys5.
  112.  *
  113.  *    Definitions for MSC Small Model:  They work, but I pulled the
  114.  *    numbers out of my . . . hat.  Have run into lex code
  115.  *    that required the large model executable.
  116.  *
  117.  *    ... raw
  118.  */      
  119.  
  120. /* ---------------------------------------------------------- */
  121.  
  122. /* maximum number of NFA states that can comprise a DFA state.  It's real
  123.  * big because if there's a lot of rules, the initial state will have a
  124.  * huge epsilon closure.
  125.  */
  126.  
  127. #ifdef MSDOS
  128.   #ifdef M_I86SM    /* MSC Small Model */
  129.    #define INITIAL_MAX_DFA_SIZE 300
  130.    #define MAX_DFA_SIZE_INCREMENT 300
  131.    #define INITIAL_MAXCCLS 100    /* max number of unique character classes */
  132.    #define MAXCCLS_INCREMENT 100
  133.  
  134. /* size of table holding members of character classes */
  135.    #define INITIAL_MAX_CCL_TBL_SIZE 500
  136.    #define MAX_CCL_TBL_SIZE_INCREMENT 250
  137.    #define INITIAL_MNS 500    /* default maximum number of nfa states */
  138.    #define MNS_INCREMENT 250 /* amount to bump above by if it's not enough */
  139.    #define INITIAL_MAX_DFAS 300    /* default maximum number of dfa states */
  140.    #define MAX_DFAS_INCREMENT 300
  141.  
  142. /* maximum number of nxt/chk pairs for non-templates */
  143.    #define INITIAL_MAX_XPAIRS 500
  144.    #define MAX_XPAIRS_INCREMENT 500
  145.  
  146. /* maximum number of nxt/chk pairs needed for templates */
  147.    #define INITIAL_MAX_TEMPLATE_XPAIRS 500
  148.    #define MAX_TEMPLATE_XPAIRS_INCREMENT 500
  149.  
  150. /* size of region set aside to cache the complete transition table of
  151.  * protos on the proto queue to enable quick comparisons
  152.  */
  153.    #define PROT_SAVE_SIZE 1000
  154.  
  155. /* ---------------------------------------------------------- */
  156.  
  157.   #elif M_I86LM        /* MSC Large Model */
  158.    #define INITIAL_MAX_DFA_SIZE 750
  159.    #define MAX_DFA_SIZE_INCREMENT 750
  160.    #define INITIAL_MAXCCLS 100    /* max number of unique character classes */
  161.    #define MAXCCLS_INCREMENT 100
  162.  
  163. /* size of table holding members of character classes */
  164.    #define INITIAL_MAX_CCL_TBL_SIZE 500
  165.    #define MAX_CCL_TBL_SIZE_INCREMENT 250
  166.    #define INITIAL_MNS 2000    /* default maximum number of nfa states */
  167.    #define MNS_INCREMENT 1000 /* amount to bump above by if it's not enough */
  168.    #define INITIAL_MAX_DFAS 1000 /* default maximum number of dfa states */
  169.    #define MAX_DFAS_INCREMENT 1000
  170.  
  171. /* maximum number of nxt/chk pairs for non-templates */
  172.    #define INITIAL_MAX_XPAIRS 2000
  173.    #define MAX_XPAIRS_INCREMENT 2000
  174.  
  175. /* maximum number of nxt/chk pairs needed for templates */
  176.    #define INITIAL_MAX_TEMPLATE_XPAIRS 2500
  177.    #define MAX_TEMPLATE_XPAIRS_INCREMENT 2500
  178.  
  179. /* size of region set aside to cache the complete transition table of
  180.  * protos on the proto queue to enable quick comparisons
  181.  */
  182.    #define PROT_SAVE_SIZE 2000
  183.  
  184.   #endif        /* MSDOS Memory Models*/
  185. /* ---------------------------------------------------------- */
  186. #else    /* Assuming Xenix/Unix */
  187.  
  188.   #define INITIAL_MAX_DFA_SIZE 750
  189.   #define MAX_DFA_SIZE_INCREMENT 750
  190.   #define INITIAL_MAXCCLS 100    /* max number of unique character classes */
  191.   #define MAXCCLS_INCREMENT 100
  192.  
  193. /* size of table holding members of character classes */
  194.   #define INITIAL_MAX_CCL_TBL_SIZE 500
  195.   #define MAX_CCL_TBL_SIZE_INCREMENT 250
  196.   #define INITIAL_MNS 2000    /* default maximum number of nfa states */
  197.   #define MNS_INCREMENT 1000 /* amount to bump above by if it's not enough */
  198.   #define INITIAL_MAX_DFAS 1000    /* default maximum number of dfa states */
  199.   #define MAX_DFAS_INCREMENT 1000
  200.  
  201. /* maximum number of nxt/chk pairs for non-templates */
  202.   #define INITIAL_MAX_XPAIRS 2000
  203.   #define MAX_XPAIRS_INCREMENT 2000
  204.  
  205. /* maximum number of nxt/chk pairs needed for templates */
  206.   #define INITIAL_MAX_TEMPLATE_XPAIRS 2500
  207.   #define MAX_TEMPLATE_XPAIRS_INCREMENT 2500
  208.  
  209. /* size of region set aside to cache the complete transition table of
  210.  * protos on the proto queue to enable quick comparisons
  211.  */
  212.   #define PROT_SAVE_SIZE 2000
  213.  
  214. #endif    /* MSDOS */
  215.  
  216. /* ---------------------------------------------------------- */
  217.  
  218. /* array names to be used in generated machine.  They're short because
  219.  * we write out one data statement (which names the array) for each element
  220.  * in the array.
  221.  */
  222.  
  223. #define ALIST 'l'    /* points to list of rules accepted for a state */
  224. #define ACCEPT 'a'    /* list of rules accepted for a state */
  225. #define ECARRAY 'e'    /* maps input characters to equivalence classes */
  226. #define MATCHARRAY 'm'    /* maps equivalence classes to meta-equivalence classes */
  227. #define BASEARRAY 'b'    /* "base" array */
  228. #define DEFARRAY 'd'    /* "default" array */
  229. #define NEXTARRAY 'n'    /* "next" array */
  230. #define CHECKARRAY 'c'    /* "check" array */
  231.  
  232. /* NIL must be 0.  If not, its special meaning when making equivalence classes
  233.  * (it marks the representative of a given e.c.) will be unidentifiable
  234.  */
  235. #define NIL 0
  236.  
  237. #define JAM -1    /* to mark a missing DFA transition */
  238. #define NO_TRANSITION NIL
  239. #define UNIQUE -1    /* marks a symbol as an e.c. representative */
  240. #define INFINITY -1    /* for x{5,} constructions */
  241.  
  242. /* size of input alphabet - should be size of ASCII set */
  243. #define CSIZE 127
  244.  
  245. #define JAMSTATE -32766    /* marks a reference to the state that always jams */
  246.  
  247. /* enough so that if it's subtracted from an NFA state number, the result
  248.  * is guaranteed to be negative
  249.  */
  250. #define MARKER_DIFFERENCE 32000
  251. #define MAXIMUM_MNS 31999
  252.  
  253. #define SYM_EPSILON 0    /* to mark transitions on the symbol epsilon */
  254.  
  255. #define INITIAL_MAX_SCS 40    /* maximum number of start conditions */
  256. #define MAX_SCS_INCREMENT 40    /* amount to bump by if it's not enough */
  257.  
  258. #define ONE_STACK_SIZE 500  /* stack of states with only one out-transition */
  259. #define SAME_TRANS -1 /*transition is the same as "default" entry for state */
  260.  
  261. /* the following percentages are used to tune table compression:
  262.  
  263.  * the percentage the number of out-transitions a state must be of the
  264.  * number of equivalence classes in order to be considered for table
  265.  * compaction by using protos
  266.  */
  267. #define PROTO_SIZE_PERCENTAGE 15
  268.  
  269. /* the percentage the number of homogeneous out-transitions of a state
  270.  * must be of the number of total out-transitions of the state in order
  271.  * that the state's transition table is first compared with a potential 
  272.  * template of the most common out-transition instead of with the first
  273.  * proto in the proto queue
  274.  */
  275. #define CHECK_COM_PERCENTAGE 50
  276.  
  277. /* the percentage the number of differences between a state's transition
  278.  * table and the proto it was first compared with must be of the total
  279.  * number of out-transitions of the state in order to keep the first
  280.  * proto as a good match and not search any further
  281.  */
  282. #define FIRST_MATCH_DIFF_PERCENTAGE 10
  283.  
  284. /* the percentage the number of differences between a state's transition
  285.  * table and the most similar proto must be of the state's total number
  286.  * of out-transitions to use the proto as an acceptable close match
  287.  */
  288. #define ACCEPTABLE_DIFF_PERCENTAGE 50
  289.  
  290. /* the percentage the number of homogeneous out-transitions of a state
  291.  * must be of the number of total out-transitions of the state in order
  292.  * to consider making a template from the state
  293.  */
  294. #define TEMPLATE_SAME_PERCENTAGE 60
  295.  
  296. /* the percentage the number of differences between a state's transition
  297.  * table and the most similar proto must be of the state's total number
  298.  * of out-transitions to create a new proto from the state
  299.  */
  300. #define NEW_PROTO_DIFF_PERCENTAGE 20
  301.  
  302. /* the percentage the total number of out-transitions of a state must be
  303.  * of the number of equivalence classes in order to consider trying to
  304.  * fit the transition table into "holes" inside the nxt/chk table.
  305.  */
  306. #define INTERIOR_FIT_PERCENTAGE 15
  307.  
  308. #define MSP 50 /*maximum number of saved protos (protos on the proto queue) */
  309.  
  310. /* maximum number of out-transitions a state can have that we'll rummage
  311.  * around through the interior of the internal fast table looking for a
  312.  * spot for it
  313.  */
  314. #define MAX_XTIONS_FOR_FULL_INTERIOR_FIT 4
  315.  
  316. /* number that, if used to subscript an array, has a good chance of producing
  317.  * an error; should be small enough to fit into a short
  318.  */
  319. #define BAD_SUBSCRIPT -32767
  320.  
  321. /* absolute value of largest number that can be stored in a short, with a
  322.  * bit of slop thrown in for general paranoia.
  323.  */
  324. #define MAX_SHORT 32766
  325.  
  326.  
  327. /* Declarations for global variables. */
  328.  
  329. /* variables for symbol tables:
  330.  * sctbl - start-condition symbol table
  331.  * ndtbl - name-definition symbol table
  332.  * ccltab - character class text symbol table
  333.  */
  334.  
  335. struct hash_entry
  336.     {
  337.     struct hash_entry *prev, *next;
  338.     char *name;
  339.     char *str_val;
  340.     int int_val;
  341.     } ;
  342.  
  343. typedef struct hash_entry *hash_table[];
  344.  
  345. #define NAME_TABLE_HASH_SIZE 101
  346. #define START_COND_HASH_SIZE 101
  347. #define CCL_HASH_SIZE 101
  348.  
  349. extern struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE]; 
  350. extern struct hash_entry *sctbl[START_COND_HASH_SIZE];
  351. extern struct hash_entry *ccltab[CCL_HASH_SIZE];
  352.  
  353.  
  354. /* variables for flags:
  355.  * printstats - if true (-v), dump statistics
  356.  * syntaxerror - true if a syntax error has been found
  357.  * eofseen - true if we've seen an eof in the input file
  358.  * ddebug - if true (-d), make a "debug" scanner
  359.  * trace - if true (-T), trace processing
  360.  * spprdflt - if true (-s), suppress the default rule
  361.  * interactive - if true (-I), generate an interactive scanner
  362.  * caseins - if true (-i), generate a case-insensitive scanner
  363.  * useecs - if true (-ce flag), use equivalence classes
  364.  * fulltbl - if true (-cf flag), don't compress the DFA state table
  365.  * usemecs - if true (-cm flag), use meta-equivalence classes
  366.  * reject - if true (-r flag), generate tables for REJECT macro
  367.  * fullspd - if true (-F flag), use Jacobson method of table representation
  368.  * gen_line_dirs - if true (i.e., no -L flag), generate #line directives
  369.  */
  370.  
  371. extern int printstats, syntaxerror, eofseen, ddebug, trace, spprdflt;
  372. extern int interactive, caseins, useecs, fulltbl, usemecs, reject;
  373. extern int fullspd, gen_line_dirs;
  374.  
  375.  
  376. /* variables used in the flex input routines:
  377.  * datapos - characters on current output line
  378.  * dataline - number of contiguous lines of data in current data
  379.  *    statement.  Used to generate readable -f output
  380.  * skelfile - fd of the skeleton file
  381.  * yyin - input file
  382.  * temp_action_file - temporary file to hold actions
  383.  * action_file_name - name of the temporary file
  384.  * infilename - name of input file
  385.  * linenum - current input line number
  386.  */
  387.  
  388. extern int datapos, dataline, linenum;
  389. extern FILE *skelfile, *yyin, *temp_action_file;
  390. extern char *infilename;
  391. extern char *action_file_name;
  392.  
  393.  
  394. /* variables for stack of states having only one out-transition:
  395.  * onestate - state number
  396.  * onesym - transition symbol
  397.  * onenext - target state
  398.  * onedef - default base entry
  399.  * onesp - stack pointer
  400.  */
  401.  
  402. extern int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
  403. extern int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
  404.  
  405.  
  406. /* variables for nfa machine data:
  407.  * current_mns - current maximum on number of NFA states
  408.  * accnum - number of the last accepting state
  409.  * firstst - physically the first state of a fragment
  410.  * lastst - last physical state of fragment
  411.  * finalst - last logical state of fragment
  412.  * transchar - transition character
  413.  * trans1 - transition state
  414.  * trans2 - 2nd transition state for epsilons
  415.  * accptnum - accepting number
  416.  * lastnfa - last nfa state number created
  417.  */
  418.  
  419. extern int current_mns;
  420. extern int accnum, *firstst, *lastst, *finalst, *transchar;
  421. extern int *trans1, *trans2, *accptnum, lastnfa;
  422.  
  423.  
  424. /* variables for protos:
  425.  * numtemps - number of templates created
  426.  * numprots - number of protos created
  427.  * protprev - backlink to a more-recently used proto
  428.  * protnext - forward link to a less-recently used proto
  429.  * prottbl - base/def table entry for proto
  430.  * protcomst - common state of proto
  431.  * firstprot - number of the most recently used proto
  432.  * lastprot - number of the least recently used proto
  433.  * protsave contains the entire state array for protos
  434.  */
  435.  
  436. extern int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
  437. extern int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
  438.  
  439.  
  440. /* variables for managing equivalence classes:
  441.  * numecs - number of equivalence classes
  442.  * nextecm - forward link of Equivalence Class members
  443.  * ecgroup - class number or backward link of EC members
  444.  * nummecs - number of meta-equivalence classes (used to compress
  445.  *   templates)
  446.  * tecfwd - forward link of meta-equivalence classes members
  447.  * tecbck - backward link of MEC's
  448.  */
  449.  
  450. extern int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs;
  451. extern int tecfwd[CSIZE + 1], tecbck[CSIZE + 1];
  452.  
  453.  
  454. /* variables for start conditions:
  455.  * lastsc - last start condition created
  456.  * current_max_scs - current limit on number of start conditions
  457.  * scset - set of rules active in start condition
  458.  * scbol - set of rules active only at the beginning of line in a s.c.
  459.  * scxclu - true if start condition is exclusive
  460.  * actvsc - stack of active start conditions for the current rule
  461.  */
  462.  
  463. extern int lastsc, current_max_scs, *scset, *scbol, *scxclu, *actvsc;
  464.  
  465.  
  466. /* variables for dfa machine data:
  467.  * current_max_dfa_size - current maximum number of NFA states in DFA
  468.  * current_max_xpairs - current maximum number of non-template xtion pairs
  469.  * current_max_template_xpairs - current maximum number of template pairs
  470.  * current_max_dfas - current maximum number DFA states
  471.  * lastdfa - last dfa state number created
  472.  * nxt - state to enter upon reading character
  473.  * chk - check value to see if "nxt" applies
  474.  * tnxt - internal nxt table for templates
  475.  * base - offset into "nxt" for given state
  476.  * def - where to go if "chk" disallows "nxt" entry
  477.  * tblend - last "nxt/chk" table entry being used
  478.  * firstfree - first empty entry in "nxt/chk" table
  479.  * dss - nfa state set for each dfa
  480.  * dfasiz - size of nfa state set for each dfa
  481.  * dfaacc - accepting set for each dfa state (or accepting number, if
  482.  *    -r is not given)
  483.  * accsiz - size of accepting set for each dfa state
  484.  * dhash - dfa state hash value
  485.  * todo - queue of DFAs still to be processed
  486.  * todo_head - head of todo queue
  487.  * todo_next - next available entry on todo queue
  488.  * numas - number of DFA accepting states created; note that this
  489.  *    is not necessarily the same value as accnum, which is the analogous
  490.  *    value for the NFA
  491.  * numsnpairs - number of state/nextstate transition pairs
  492.  * jambase - position in base/def where the default jam table starts
  493.  * jamstate - state number corresponding to "jam" state
  494.  * end_of_buffer_state - end-of-buffer dfa state number
  495.  */
  496.  
  497. extern int current_max_dfa_size, current_max_xpairs;
  498. extern int current_max_template_xpairs, current_max_dfas;
  499. extern int lastdfa, lasttemp, *nxt, *chk, *tnxt;
  500. extern int *base, *def, tblend, firstfree, **dss, *dfasiz;
  501. extern union dfaacc_union
  502.     {
  503.     int *dfaacc_set;
  504.     int dfaacc_state;
  505.     } *dfaacc;
  506. extern int *accsiz, *dhash, *todo, todo_head, todo_next, numas;
  507. extern int numsnpairs, jambase, jamstate;
  508. extern int end_of_buffer_state;
  509.  
  510. /* variables for ccl information:
  511.  * lastccl - ccl index of the last created ccl
  512.  * current_maxccls - current limit on the maximum number of unique ccl's
  513.  * cclmap - maps a ccl index to its set pointer
  514.  * ccllen - gives the length of a ccl
  515.  * cclng - true for a given ccl if the ccl is negated
  516.  * cclreuse - counts how many times a ccl is re-used
  517.  * current_max_ccl_tbl_size - current limit on number of characters needed
  518.  *    to represent the unique ccl's
  519.  * ccltbl - holds the characters in each ccl - indexed by cclmap
  520.  */
  521.  
  522. extern int lastccl, current_maxccls, *cclmap, *ccllen, *cclng, cclreuse;
  523. extern int current_max_ccl_tbl_size;
  524. extern char *ccltbl;
  525.  
  526.  
  527. /* variables for miscellaneous information:
  528.  * starttime - real-time when we started
  529.  * endtime - real-time when we ended
  530.  * nmstr - last NAME scanned by the scanner
  531.  * sectnum - section number currently being parsed
  532.  * nummt - number of empty nxt/chk table entries
  533.  * hshcol - number of hash collisions detected by snstods
  534.  * dfaeql - number of times a newly created dfa was equal to an old one
  535.  * numeps - number of epsilon NFA states created
  536.  * eps2 - number of epsilon states which have 2 out-transitions
  537.  * num_reallocs - number of times it was necessary to realloc() a group
  538.  *          of arrays
  539.  * tmpuses - number of DFA states that chain to templates
  540.  * totnst - total number of NFA states used to make DFA states
  541.  * peakpairs - peak number of transition pairs we had to store internally
  542.  * numuniq - number of unique transitions
  543.  * numdup - number of duplicate transitions
  544.  * hshsave - number of hash collisions saved by checking number of states
  545.  */
  546.  
  547. extern char *starttime, *endtime, nmstr[MAXLINE];
  548. extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
  549. extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
  550.  
  551. char *allocate_array(), *reallocate_array();
  552.  
  553. #define allocate_integer_array(size) \
  554.     (int *) allocate_array( size, sizeof( int ) )
  555.  
  556. #define reallocate_integer_array(array,size) \
  557.     (int *) reallocate_array( (char *) array, size, sizeof( int ) )
  558.  
  559. #define allocate_integer_pointer_array(size) \
  560.     (int **) allocate_array( size, sizeof( int * ) )
  561.  
  562. #define allocate_dfaacc_union(size) \
  563.     (union dfaacc_union *) \
  564.         allocate_array( size, sizeof( union dfaacc_union ) )
  565.  
  566. #define reallocate_integer_pointer_array(array,size) \
  567.     (int **) reallocate_array( (char *) array, size, sizeof( int * ) )
  568.  
  569. #define reallocate_dfaacc_union(array, size) \
  570.     (union dfaacc_union *)  reallocate_array( (char *) array, size, sizeof( union dfaacc_union ) )
  571.  
  572. #define allocate_character_array(size) allocate_array( size, sizeof( char ) )
  573.  
  574. #define reallocate_character_array(array,size) \
  575.     reallocate_array( array, size, sizeof( char ) )
  576.  
  577.  
  578. /* used to communicate between scanner and parser.  The type should really
  579.  * be YYSTYPE, but we can't easily get our hands on it.
  580.  */
  581. extern int yylval;
  582.  
  583.