home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / gperf.lzh / GPERF / OPTIONS.CC < prev    next >
C/C++ Source or Header  |  1993-07-30  |  24KB  |  609 lines

  1. /* Handles parsing the Options provided to the user.
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.    written by Douglas C. Schmidt (schmidt@ics.uci.edu)
  4.  
  5. This file is part of GNU GPERF.
  6.  
  7. GNU GPERF is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 1, or (at your option)
  10. any later version.
  11.  
  12. GNU GPERF is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with GNU GPERF; see the file COPYING.  If not, write to
  19. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21. #include <stdio.h>
  22. #include <builtin.h>
  23. #include <assert.h>
  24. #include <xgetopt.h>
  25. #include "options.h"
  26. #include "iterator.h"
  27.  
  28. /* Global option coordinator for the entire program. */
  29. Options option;       
  30.  
  31. /* Current program version. */
  32. extern char *version_string;
  33.  
  34. /* Prints program usage to standard error stream. */
  35.  
  36. static inline void 
  37. Options::usage (void) 
  38.   T (Trace t ("Options::usage");)
  39.   report_error ("Usage: %n [-acCdDef[num]gGhH<hashname>i<init>jk<keys>K<keyname>lL<language>nN<function name>oprs<size>S<switches>tTvZ<class name>].\n"
  40.                 "(type %n -h for help)\n");
  41. }
  42.  
  43. /* Output command-line Options. */
  44.  
  45. void 
  46. Options::print_options (void)
  47.   T (Trace t ("Options::print_options");)
  48.   int i;
  49.  
  50.   printf ("/* Command-line: ");
  51.  
  52.   for (i = 0; i < argument_count; i++) 
  53.     printf ("%s ", argument_vector[i]);
  54.    
  55.   printf (" */");
  56. }
  57.  
  58. /* Sorts the key positions *IN REVERSE ORDER!!*
  59.    This makes further routines more efficient.  Especially when generating code.
  60.    Uses a simple Insertion Sort since the set is probably ordered.
  61.    Returns 1 if there are no duplicates, 0 otherwise. */
  62.  
  63. static inline int 
  64. Options::key_sort (char *base, int len) 
  65. {
  66.   T (Trace t ("Options::key_sort");)
  67.   int i, j;
  68.  
  69.   for (i = 0, j = len - 1; i < j; i++) 
  70.     {
  71.       int curr, tmp;
  72.       
  73.       for (curr = i + 1,tmp = base[curr]; curr > 0 && tmp >= base[curr - 1]; curr--) 
  74.         if ((base[curr] = base[curr - 1]) == tmp) /* oh no, a duplicate!!! */
  75.           return 0;
  76.  
  77.       base[curr] = tmp;
  78.     }
  79.  
  80.   return 1;
  81. }
  82.  
  83. /* Sets the default Options. */
  84.  
  85. Options::Options (void) 
  86.   T (Trace t ("Options::Options");)
  87.   key_positions[0]    = WORD_START;
  88.   key_positions[1]    = WORD_END;
  89.   key_positions[2]    = EOS;
  90.   total_keysig_size  = 2;
  91.   delimiters          = DEFAULT_DELIMITERS;
  92.   jump                = DEFAULT_JUMP_VALUE;
  93.   option_word         = DEFAULTCHARS | C;
  94.   function_name       = DEFAULT_NAME;
  95.   key_name            = DEFAULT_KEY;
  96.   hash_name           = DEFAULT_HASH_NAME;
  97.   class_name          = DEFAULT_CLASS_NAME;
  98.   total_switches      = size = 1;
  99.   initial_asso_value  = iterations = 0;
  100. }
  101.  
  102. /* Dumps option status when debug is set. */
  103.  
  104. Options::~Options (void) 
  105.   T (Trace t ("Options::~Options");)
  106.   if (option_word & DEBUG)
  107.     {
  108.       char *ptr;
  109.  
  110.       fprintf (stderr, "\ndumping Options:\nDEBUG is.......: %s\nORDER is.......: %s"
  111.                "\nANSI is........: %s\nTYPE is........: %s\nGNU is.........: %s"
  112.                "\nRANDOM is......: %s\nDEFAULTCHARS is: %s\nSWITCH is......: %s"
  113.                "\nPOINTER is.....: %s\nNOLENGTH is....: %s\nLENTABLE is....: %s"
  114.                "\nDUP is.........: %s\nFAST is........: %s\nCOMP is.....: %s"
  115.                "\nNOTYPE is......: %s\nGLOBAL is......: %s\nCONST is....: %s"
  116.                "\nCPLUSPLUS is...: %s\nC is...........: %s\nENUM is.....: %s"
  117.                "\niterations = %d\nlookup function name = %s\nhash function name = %s"
  118.                "\nkey name = %s\njump value = %d\nmax associcated value = %d"
  119.                "\ninitial associated value = %d\ndelimiters = %s\nnumber of switch statements = %d\n",
  120.                option_word & DEBUG ? "enabled" : "disabled", 
  121.                option_word & ORDER ? "enabled" : "disabled",
  122.                option_word & ANSI ? "enabled" : "disabled",
  123.                option_word & TYPE ? "enabled" : "disabled",
  124.                option_word & GNU ? "enabled" : "disabled",
  125.                option_word & RANDOM ? "enabled" : "disabled",
  126.                option_word & DEFAULTCHARS ? "enabled" : "disabled",
  127.                option_word & SWITCH ? "enabled" : "disabled",
  128.                option_word & POINTER ? "enabled" : "disabled",
  129.                option_word & NOLENGTH ? "enabled" : "disabled",
  130.                option_word & LENTABLE ? "enabled" : "disabled",
  131.                option_word & DUP ? "enabled" : "disabled",
  132.                option_word & FAST ? "enabled" : "disabled",
  133.                option_word & COMP ? "enabled" : "disabled",
  134.                option_word & NOTYPE ? "enabled" : "disabled",
  135.                option_word & GLOBAL ? "enabled" : "disabled",
  136.                option_word & CONST ? "enabled" : "disabled",
  137.                option_word & CPLUSPLUS ? "enabled" : "disabled",
  138.                option_word & C ? "enabled" : "disabled",
  139.                option_word & ENUM ? "enabled" : "disabled",
  140.                iterations, function_name, hash_name, key_name, jump, size - 1,
  141.                initial_asso_value, delimiters, total_switches);
  142.       if (option_word & ALLCHARS) 
  143.         fprintf (stderr, "all characters are used in the hash function\n");
  144.  
  145.       fprintf (stderr, "maximum keysig size = %d\nkey positions are: \n",
  146.                total_keysig_size);
  147.  
  148.       for (ptr = key_positions; *ptr != EOS; ptr++) 
  149.         if (*ptr == WORD_END) 
  150.           fprintf (stderr, "$\n");
  151.         else 
  152.           fprintf (stderr, "%d\n", *ptr);
  153.  
  154.       fprintf (stderr, "finished dumping Options\n");
  155.     }
  156. }
  157.  
  158.  
  159. /* Parses the command line Options and sets appropriate flags in option_word. */
  160.  
  161. void 
  162. Options::operator() (int argc, char *argv[])
  163.   T (Trace t ("Options::operator()");)
  164.   GetOpt getopt (argc, argv, "adcCDe:Ef:gGhH:i:j:k:K:lL:nN:oprs:S:tTvZ:");
  165.   int    option_char;
  166.  
  167.   set_program_name (argv[0]);
  168.   argument_count  = argc;
  169.   argument_vector = argv;
  170.  
  171.   while ((option_char = getopt ()) != -1)
  172.     {
  173.       switch (option_char)
  174.         {
  175.         case 'a':               /* Generated coded uses the ANSI prototype format. */
  176.           { 
  177.             option_word |= ANSI;
  178.             break;
  179.           }
  180.         case 'c':               /* Generate strncmp rather than strcmp. */
  181.           {
  182.             option_word |= COMP;
  183.             break;
  184.           }
  185.         case 'C':               /* Make the generated tables readonly (const). */
  186.           {
  187.             option_word |= CONST;
  188.             break;
  189.           }
  190.         case 'd':               /* Enable debugging option. */
  191.           { 
  192.             option_word |= DEBUG;
  193.             report_error ("Starting program %n, version %s, with debuggin on.\n",
  194.                           version_string);
  195.             break;
  196.           }   
  197.         case 'D':               /* Enable duplicate option. */
  198.           { 
  199.             option_word |= DUP;
  200.             break;
  201.           }   
  202.         case 'e': /* Allows user to provide keyword/attribute separator */
  203.           {
  204.             option.delimiters = getopt.optarg;
  205.             break;
  206.           }
  207.         case 'E':
  208.           {
  209.             option_word |= ENUM;
  210.             break;
  211.           }
  212.         case 'f':               /* Generate the hash table ``fast.'' */
  213.           {
  214.             option_word |= FAST;
  215.             if ((iterations = atoi (getopt.optarg)) < 0) 
  216.               {
  217.                 report_error ("iterations value must not be negative, assuming 0\n");
  218.                 iterations = 0;
  219.               }
  220.             break;
  221.           }
  222.         case 'g':               /* Use the ``inline'' keyword for generated sub-routines. */
  223.           { 
  224.             option_word |= GNU;
  225.             break;
  226.           }
  227.         case 'G':               /* Make the keyword table a global variable. */
  228.           { 
  229.                                                 option_word |= GLOBAL;
  230.             break;
  231.           }
  232.         case 'h':               /* Displays a list of helpful Options to the user. */
  233.           { 
  234.             report_error (
  235.                           "-a\tGenerate ANSI standard C output code, i.e., function prototypes.\n"
  236.                           "-c\tGenerate comparison code using strncmp rather than strcmp.\n"
  237.                           "-C\tMake the contents of generated lookup tables constant, i.e., readonly.\n"
  238.                           "-d\tEnables the debugging option (produces verbose output to the standard error).\n"
  239.                           "-D\tHandle keywords that hash to duplicate values.  This is useful\n"
  240.                           "\tfor certain highly redundant keyword sets.  It enables the -S option.\n"
  241.                           "-e\tAllow user to provide a string containing delimiters used to separate\n"
  242.                           "\tkeywords from their attributes.  Default is \",\\n\"\n"
  243.                           "-E\tDefine constant values using an enum local to the lookup function\n"
  244.                           "\trather than with defines\n"
  245.                           "-f\tGenerate the gen-perf.hash function ``fast.''  This decreases GPERF's\n"
  246.                           "\trunning time at the cost of minimizing generated table-size.\n"
  247.                           "\tThe numeric argument represents the number of times to iterate when\n"
  248.                           "\tresolving a collision.  `0' means ``iterate by the number of keywords.''\n"
  249.                           "-g\tAssume a GNU compiler, e.g., g++ or gcc.  This makes all generated\n"
  250.                           "\troutines use the ``inline'' keyword to remove cost of function calls.\n"
  251.                           "-G\tGenerate the static table of keywords as a static global variable,\n"
  252.                           "\trather than hiding it inside of the lookup function (which is the\n"
  253.                           "\tdefault behavior).\n"
  254.                           "-h\tPrints this mesage.\n"
  255.                           "-H\tAllow user to specify name of generated hash function. Default\n"
  256.                           "\tis `hash'.\n"
  257.                           "-i\tProvide an initial value for the associate values array.  Default is 0.\n"
  258.                           "\tSetting this value larger helps inflate the size of the final table.\n"
  259.                           "-j\tAffects the ``jump value,'' i.e., how far to advance the associated\n"
  260.                           "\tcharacter value upon collisions.  Must be an odd number, default is %d.\n"
  261.                           "-k\tAllows selection of the key positions used in the hash function.\n"
  262.                           "\tThe allowable choices range between 1-%d, inclusive.  The positions\n"
  263.                           "\tare separated by commas, ranges may be used, and key positions may\n"
  264.                           "\toccur in any order.  Also, the meta-character '*' causes the generated\n"
  265.                           "\thash function to consider ALL key positions, and $ indicates the\n"
  266.                           "\t``final character'' of a key, e.g., $,1,2,4,6-10.\n"
  267.                           "-K\tAllow use to select name of the keyword component in the keyword structure.\n"
  268.                           "-l\tCompare key lengths before trying a string comparison.  This helps\n"
  269.                           "\tcut down on the number of string comparisons made during the lookup.\n"
  270.                           "-L\tGenerates code in the language specified by the option's argument.  Languages\n"
  271.                           "\thandled are currently C++ and C.  The default is C.\n"
  272.                           "-n\tDo not include the length of the keyword when computing the hash function\n"
  273.                           "-N\tAllow user to specify name of generated lookup function.  Default\n"
  274.                           "\tname is `in_word_set.'\n"
  275.                           "-o\tReorders input keys by frequency of occurrence of the key sets.\n"
  276.                           "\tThis should decrease the search time dramatically.\n"
  277.                           "-p\tChanges the return value of the generated function ``in_word_set''\n"
  278.                           "\tfrom its default boolean value (i.e., 0 or 1), to type ``pointer\n"
  279.                           "\tto wordlist array''  This is most useful when the -t option, allowing\n"
  280.                           "\tuser-defined structs, is used.\n"
  281.                           "-r\tUtilizes randomness to initialize the associated values table.\n"
  282.                           "-s\tAffects the size of the generated hash table.  The numeric argument\n"
  283.                           "\tfor this option indicates ``how many times larger or smaller'' the associated\n"
  284.                           "\tvalue range should be, in relationship to the number of keys, e.g. a value of 3\n"
  285.                           "\tmeans ``allow the maximum associated value to be about 3 times larger than the\n"
  286.                           "\tnumber of input keys.''  Conversely, a value of -3 means ``make the maximum\n"
  287.                           "\tassociated value about 3 times smaller than the number of input keys.\n"
  288.                           "\tA larger table should decrease the time required for an unsuccessful search,\n"
  289.                           "\tat the expense of extra table space.  Default value is 1.\n"
  290.                           "-S\tCauses the generated C code to use a switch statement scheme, rather\n"
  291.                           "\tthan an array lookup table.  This can lead to a reduction in both\n"
  292.                           "\ttime and space requirements for some keyfiles.  The argument to\n"
  293.                           "\tthis option determines how many switch statements are generated.\n"
  294.                           "\tA value of 1 generates 1 switch containing all the elements, a value of 2\n"
  295.                           "\tgenerates 2 tables with 1/2 the elements in each table, etc.  This\n"
  296.                           "\tis useful since many C compilers cannot correctly generate code for\n"
  297.                           "\tlarge switch statements.\n"
  298.                           "-t\tAllows the user to include a structured type declaration for \n"
  299.                           "\tgenerated code. Any text before %%%% is consider part of the type\n"
  300.                           "\tdeclaration.  Key words and additional fields may follow this, one\n"
  301.                           "\tgroup of fields per line.\n"
  302.                           "-T\tPrevents the transfer of the type declaration to the output file.\n"
  303.                           "\tUse this option if the type is already defined elsewhere.\n"
  304.                           "-v\tPrints out the current version number\n"
  305.                           "-Z\tAllow user to specify name of generated C++ class.  Default\n"
  306.                           "\tname is `Perfect_Hash.'\n%e%a", DEFAULT_JUMP_VALUE, (MAX_KEY_POS - 1), usage, 1);
  307.           }
  308.         case 'H':               /* Sets the name for the hash function */
  309.           {
  310.             hash_name = getopt.optarg;
  311.             break;
  312.           }
  313.         case 'i':               /* Sets the initial value for the associated values array. */
  314.           { 
  315.             if ((initial_asso_value = atoi (getopt.optarg)) < 0) 
  316.               report_error ("Initial value %d should be non-zero, ignoring and continuing.\n", initial_asso_value);
  317.             if (option[RANDOM])
  318.               report_error ("warning, -r option superceeds -i, ignoring -i option and continuing\n");
  319.             break;
  320.           }
  321.         case 'j':               /* Sets the jump value, must be odd for later algorithms. */
  322.           { 
  323.             if ((jump = atoi (getopt.optarg)) < 0)
  324.               report_error ("Jump value %d must be a positive number.\n%e%a", jump, usage, 1);
  325.             else if (jump && even (jump)) 
  326.               report_error ("Jump value %d should be odd, adding 1 and continuing...\n", jump++);
  327.             break;
  328.           }
  329.         case 'k':               /* Sets key positions used for hash function. */
  330.           { 
  331.             const int BAD_VALUE = -1;
  332.             int       value;
  333.             Iterator  expand (getopt.optarg, 1, MAX_KEY_POS - 1, WORD_END, BAD_VALUE, EOS);
  334.             
  335.             if (*getopt.optarg == '*') /* Use all the characters for hashing!!!! */
  336.               option_word = (option_word & ~DEFAULTCHARS) | ALLCHARS;
  337.             else 
  338.               {
  339.                 char *key_pos;
  340.  
  341.                 for (key_pos = key_positions; (value = expand ()) != EOS; key_pos++) 
  342.                   if (value == BAD_VALUE)
  343.                     report_error ("Illegal key value or range, use 1,2,3-%d,'$' or '*'.\n%e%a",
  344.                                    MAX_KEY_POS - 1, usage, 1);
  345.                   else 
  346.                     *key_pos = value;;
  347.  
  348.                 *key_pos = EOS;
  349.  
  350.                 if (! (total_keysig_size = (key_pos - key_positions))) 
  351.                   report_error ("No keys selected.\n%e%a", usage, 1);
  352.                 else if (! key_sort (key_positions, total_keysig_size))
  353.                   report_error ("Duplicate keys selected\n%e%a", usage, 1);
  354.  
  355.                 if (total_keysig_size != 2 
  356.                     || (key_positions[0] != 1 || key_positions[1] != WORD_END))
  357.                   option_word &= ~DEFAULTCHARS;
  358.               }
  359.             break;
  360.           }
  361.         case 'K':               /* Make this the keyname for the keyword component field. */
  362.           {
  363.             key_name = getopt.optarg;
  364.             break;
  365.           }
  366.         case 'l':               /* Create length table to avoid extra string compares. */
  367.           { 
  368.             option_word |= LENTABLE;
  369.             break;
  370.           }
  371.         case 'L':               /* Deal with different generated languages. */
  372.           {
  373.             option_word &= ~C;
  374.             if (!strcmp (getopt.optarg, "C++"))
  375.               option_word |= (CPLUSPLUS | ANSI);
  376.             else if (!strcmp (getopt.optarg, "C"))
  377.               option_word |= C;
  378.             else 
  379.               {
  380.                 report_error ("unsupported language option %s, defaulting to C\n", getopt.optarg);
  381.                 option_word |= C;
  382.               }
  383.             break;
  384.           }
  385.         case 'n':               /* Don't include the length when computing hash function. */
  386.           { 
  387.             option_word |= NOLENGTH;
  388.             break; 
  389.           }
  390.         case 'N':               /* Make generated lookup function name be optarg */
  391.           { 
  392.             function_name = getopt.optarg;
  393.             break;
  394.           }
  395.         case 'o':               /* Order input by frequency of key set occurrence. */
  396.           { 
  397.             option_word |= ORDER;
  398.             break;
  399.           }   
  400.         case 'p':               /* Generated lookup function now a pointer instead of int. */
  401.           { 
  402.             option_word |= POINTER;
  403.             break;
  404.           }
  405.         case 'r':               /* Utilize randomness to initialize the associated values table. */
  406.           { 
  407.             option_word |= RANDOM;
  408.             if (option.initial_asso_value != 0)
  409.               report_error ("warning, -r option superceeds -i, disabling -i option and continuing\n");
  410.             break;
  411.           }
  412.         case 's':               /* Range of associated values, determines size of final table. */
  413.           { 
  414.             if (abs (size = atoi (getopt.optarg)) > 50) 
  415.               report_error ("%d is excessive, did you really mean this?! (type %n -h for help)\n", size);
  416.             break; 
  417.           }       
  418.         case 'S':               /* Generate switch statement output, rather than lookup table. */
  419.           { 
  420.             option_word |= SWITCH;
  421.             if ((option.total_switches = atoi (getopt.optarg)) <= 0)
  422.               report_error ("number of switches %s must be a positive number\n%e%a", getopt.optarg, usage, 1);
  423.             break;
  424.           }
  425.         case 't':               /* Enable the TYPE mode, allowing arbitrary user structures. */
  426.           { 
  427.             option_word |= TYPE;
  428.             break;
  429.           }
  430.                                 case 'T':   /* Don't print structure definition. */
  431.                                         {
  432.                                                 option_word |= NOTYPE;
  433.                                                 break;
  434.                                         }
  435.         case 'v':               /* Print out the version and quit. */
  436.           report_error ("%n: version %s\n%e\n%a", version_string, usage, 1);
  437.         case 'Z':               /* Set the class name. */
  438.           {
  439.             class_name = getopt.optarg;
  440.             break;
  441.           }
  442.         default: 
  443.           report_error ("%e%a", usage, 1);
  444.         }
  445.       
  446.     }
  447.  
  448.   if (argv[getopt.optind] && ! freopen (argv[getopt.optind], "r", stdin))
  449.     report_error ("Cannot open keyword file %p\n%e%a", argv[getopt.optind], usage, 1);
  450.   
  451.   if (++getopt.optind < argc) 
  452.     report_error ("Extra trailing arguments to %n.\n%e%a", usage, 1);
  453. }
  454.  
  455. #ifndef __OPTIMIZE__
  456.  
  457. /* TRUE if option enable, else FALSE. */
  458. int  
  459. Options::operator[] (Option_Type option) 
  460.   T (Trace t ("Options::operator[]");)
  461.   return option_word & option;
  462. }
  463.  
  464. /* Enables option OPT. */
  465. void
  466. Options::operator= (enum Option_Type opt) 
  467. {
  468.   T (Trace t ("Options::operator=");)
  469.         option_word |= opt;
  470. }
  471.  
  472. /* Disables option OPT. */
  473. void
  474. Options::operator!= (enum Option_Type opt) 
  475. {
  476.   T (Trace t ("Options::operator!=");)
  477.         option_word &= ~opt;
  478. }
  479.  
  480. /* Initializes the key Iterator. */
  481. void 
  482. Options::reset (void) 
  483.   T (Trace t ("Options::reset");)
  484.   key_pos = 0;
  485. }
  486.  
  487. /* Returns current key_position and advances index. */
  488. int 
  489. Options::get (void) 
  490. {
  491.   T (Trace t ("Options::get");)
  492.   return key_positions[key_pos++];
  493. }
  494.  
  495. /* Sets the size of the table size. */
  496. void 
  497. Options::set_asso_max (int r) 
  498. {
  499.   T (Trace t ("Options::set_asso_max");)
  500.   size = r;
  501. }
  502.  
  503. /* Returns the size of the table size. */
  504. int 
  505. Options::get_asso_max (void) 
  506. {
  507.   T (Trace t ("Options::get_asso_max");)
  508.   return size;
  509. }
  510.  
  511. /* Returns total distinct key positions. */
  512. int 
  513. Options::get_max_keysig_size (void) 
  514. {
  515.   T (Trace t ("Options::get_max_keysig_size");)
  516.   return total_keysig_size;
  517. }
  518.  
  519. /* Sets total distinct key positions. */
  520. void
  521. Options::set_keysig_size (int size) 
  522.   T (Trace t ("Options::set_keysig_size");)
  523.   total_keysig_size = size;
  524. }
  525.  
  526. /* Returns the jump value. */
  527. int 
  528. Options::get_jump (void) 
  529. {
  530.   T (Trace t ("Options::get_jump");)
  531.   return jump;
  532. }
  533.  
  534. /* Returns the lookup function name. */
  535. const char *
  536. Options::get_function_name (void) 
  537. {
  538.   T (Trace t ("Options::get_function_name");)
  539.   return function_name;
  540. }
  541.  
  542. /* Returns the keyword key name. */
  543. const char *
  544. Options::get_key_name (void) 
  545. {
  546.   T (Trace t ("Options::get_key_name");)
  547.   return key_name;
  548. }
  549.  
  550. /* Returns the hash function name. */
  551. const char *
  552. Options::get_hash_name (void) 
  553. {
  554.   T (Trace t ("Options::get_hash_name");)
  555.         return hash_name;
  556. }
  557.  
  558. /* Returns the generated class name. */
  559. const char  *
  560. Options::get_class_name (void)
  561. {
  562.   T (Trace t ("Options::get_class_name");)
  563.   return class_name;
  564. }
  565.  
  566. /* Returns the initial associated character value. */
  567. int 
  568. Options::initial_value (void) 
  569. {
  570.   T (Trace t ("Options::initial_value");)
  571.   return initial_asso_value;
  572. }
  573.  
  574. /* Returns the iterations value. */
  575. int 
  576. Options::get_iterations (void) 
  577.   T (Trace t ("Options::get_iterations");)
  578.   return iterations;
  579. }
  580.  
  581. /* Returns the string used to delimit keywords from other attributes. */
  582. const char *
  583. Options::get_delimiter () 
  584. {
  585.   T (Trace t ("Options::get_delimiter");)
  586.   return delimiters;
  587. }
  588.  
  589. /* Gets the total number of switch statements to generate. */
  590. int
  591. Options::get_total_switches () 
  592. {
  593.   T (Trace t ("Options::get_total_switches");)
  594.   return total_switches;
  595. }
  596.  
  597. #endif /* not defined __OPTIMIZE__ */
  598.  
  599.  
  600.