home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / g / bug / 2181 < prev    next >
Encoding:
Text File  |  1993-01-08  |  26.8 KB  |  2,151 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!vki68.aar-vki.DK!eks
  3. From: eks@vki68.aar-vki.DK (Eigil Krogh Sorensen)
  4. Subject: gcc-2.3.3 error while compiling groff-1.06 lex.cc
  5. Message-ID: <m0nAL6V-0001YPC@vki68.aar-vki.dk>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Fri, 8 Jan 1993 13:54:28 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 2137
  12.  
  13. Error while compiling groff-1.06.
  14.  
  15. System:
  16. Motorola sysV68 R3V5.1
  17.  
  18. Hardware:
  19. mvme147/68030 based (mot3300)
  20.  
  21. Compiler:
  22. gcc-2.3.3
  23.  
  24. Program:
  25. Groff-1.06
  26.  
  27. eqn/lex.cc
  28.  
  29.  
  30. ---------------------------------------------------------------------
  31. Screen dumps. (vki68 eks $ is prompt).
  32. ---------------------------------------------------------------------
  33.  
  34. -------------------------------------------------------------------
  35. compiler error messages.
  36. ------------------------
  37. nice make
  38. Making all in include
  39. Making all in libgroff
  40. Making all in libdriver
  41. Making all in libbib
  42. Making all in groff
  43. Making all in troff
  44. Making all in tbl
  45. Making all in pic
  46. Making all in eqn
  47.         gcc -O2 -v -I. -I. -I../include -I./../include -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_CC_LIMITS_H=1 -DHAVE_CC_UNISTD_H=1 -DSTDLIB_H_DECLARES_GETOPT=1 -DSTDLIB_H_DECLARES_PUTENV=1 -DLONG_FOR_TIME_T=1 -Dvfork=fork   -c lex.cc
  48. Reading specs from /usr/local/lib/gcc-lib/3300/2.3.3/specs
  49. gcc version 2.3.3
  50.  /usr/local/lib/gcc-lib/3300/2.3.3/cpp -lang-c++ -v -I. -I. -I../include -I./../include -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dm68k -Dunix -DsysV68 -D__m68k__ -D__unix__ -D__sysV68__ -D__m68k -D__unix -D__sysV68 -D__OPTIMIZE__ -D__HAVE_68881__ -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_CC_LIMITS_H=1 -DHAVE_CC_UNISTD_H=1 -DSTDLIB_H_DECLARES_GETOPT=1 -DSTDLIB_H_DECLARES_PUTENV=1 -DLONG_FOR_TIME_T=1 -Dvfork=fork lex.cc /usr/tmp/cca07841.i
  51. GNU CPP version 2.3.3 (68k, SGS/AT&T sysV68 syntax)
  52.  /usr/local/lib/gcc-lib/3300/2.3.3/cc1plus /usr/tmp/cca07841.i -quiet -dumpbase lex.cc -O2 -version -o /usr/tmp/cca07841.s
  53. GNU C++ version 2.3.3 (68k, SGS/AT&T sysV68 syntax) compiled by GNU C version 2.3.3.
  54. lex.cc: In method `definition::definition ()':
  55. lex.cc:37: class `definition' does not have any field named `contents'
  56. lex.cc: In method `definition::~definition ()':
  57. lex.cc:44: `contents' undeclared (first use this function)
  58. lex.cc:44: (Each undeclared identifier is reported only once
  59. lex.cc:44: for each function it appears in.)
  60. lex.cc:44: type to vector delete is neither pointer or array type
  61. lex.cc: In function `void  init_table (const char *)':
  62. lex.cc:256: structure has no member named `tok'
  63. lex.cc:262: structure has no member named `contents'
  64. lex.cc:268: structure has no member named `contents'
  65. lex.cc: In function `int  get_token (int (=  0 ))':
  66. lex.cc:787: structure has no member named `contents'
  67. lex.cc:686: too few arguments to function `void  interpolate_macro_with_args (const char *)'
  68. lex.cc:787: at this point in file
  69. lex.cc:851: structure has no member named `contents'
  70. lex.cc:856: structure has no member named `tok'
  71. lex.cc:865: warning: control reaches end of non-void function
  72. lex.cc: In function `void  do_definition (int)':
  73. lex.cc:910: structure has no member named `contents'
  74. lex.cc:910: type to vector delete is neither pointer or array type
  75. lex.cc:915: structure has no member named `contents'
  76. *** Error code 1
  77.  
  78. Stop.
  79. *** Error code 1
  80.  
  81. Stop.
  82. *** Error code 1
  83.  
  84. Stop.
  85.  
  86.  
  87.  
  88. --------------------------------------------------------------------
  89. cpp output.
  90. -----------
  91. vki68 eks $ pwd
  92. /usr/eks/gnu/ftp.denet.dk/groff-1.06/groff-1.06/eqn
  93. vki68 eks $ gcc -v -O2 -E  -I../include -o lex.E lex.cc
  94. Reading specs from /usr/local/lib/gcc-lib/3300/2.3.3/specs
  95. gcc version 2.3.3
  96.  /usr/local/lib/gcc-lib/3300/2.3.3/cpp -lang-c++ -v -I../include -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dm68k -Dunix -DsysV68 -D__m68k__ -D__unix__ -D__sysV68__ -D__m68k -D__unix -D__sysV68 -D__OPTIMIZE__ -D__HAVE_68881__ lex.cc -o lex.E
  97. GNU CPP version 2.3.3 (68k, SGS/AT&T sysV68 syntax)
  98. vki68 eks $ 
  99. vki68 eks $ 
  100. vki68 eks $ cat lex.E
  101. # 1 "lex.cc"
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122. # 1 "eqn.h" 1
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143. # 1 "/usr/local/lib/g++-include/stdio.h" 1 3
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164. #pragma interface
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176. # 1 "/usr/local/lib/g++-include/_G_config.h" 1 3
  177.   
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184. typedef int   _G_clock_t;
  185. typedef short _G_dev_t;
  186. typedef long   _G_fpos_t;
  187. typedef int   _G_gid_t;
  188. typedef unsigned short _G_ino_t;
  189. typedef int   _G_mode_t;
  190. typedef int   _G_nlink_t;
  191. typedef long _G_off_t;
  192. typedef int   _G_pid_t;
  193. typedef long int _G_ptrdiff_t;
  194. typedef int   _G_sigset_t;
  195. typedef unsigned int _G_size_t;
  196. typedef long _G_time_t;
  197. typedef int   _G_uid_t;
  198. typedef long int _G_wchar_t;
  199. typedef  int   _G_ssize_t;
  200. typedef void * _G_va_list;
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222. # 33 "/usr/local/lib/g++-include/stdio.h" 2 3
  223.  
  224.  
  225. extern "C" {
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259. # 1 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdio.h" 1 3
  260.  
  261. # 1 "/usr/local/lib/g++-include/stdarg.h" 1 3
  262. extern "C" {
  263. # 1 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdarg.h" 1 3
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311. typedef void *__gnuc_va_list;
  312.  
  313.  
  314.  
  315.  
  316.  
  317. # 85 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdarg.h" 3
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. # 137 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdarg.h" 3
  329.  
  330.  
  331.  
  332.  
  333.  
  334. # 2 "/usr/local/lib/g++-include/stdarg.h" 2 3
  335.  
  336. }
  337. # 2 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stdio.h" 2 3
  338.  
  339. #ident "@(#)stdio.h     35.2"
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356. typedef struct {
  357.  
  358.         int     _cnt;
  359.         unsigned char   *_ptr;
  360.  
  361.  
  362.  
  363.  
  364.         unsigned char   *_base;
  365.         char    _flag;
  366.         char    _file;
  367. } FILE;
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.                 
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412. extern FILE     _iob[80         ];
  413. extern FILE     *__hide_fopen (), *__hide_fdopen (), *__hide_freopen (), *__hide_popen (), *tmpfile();
  414. extern long     __hide_ftell ();
  415. extern void     __hide_rewind (), __hide_setbuf ();
  416. extern char     *ctermid(), *cuserid(), *fgets(), *gets(), *__hide_tempnam (), *tmpnam();
  417. extern unsigned char *_bufendtab[];
  418.  
  419. extern int      fclose(), fflush(), __hide_fread (), __hide_fwrite (), fseek(), fgetc(),
  420.                 getw(), pclose(), __hide_printf (), __hide_fprintf (), __hide_sprintf (),
  421.                 __hide_vprintf (), __hide_vfprintf (), __hide_vsprintf (), fputc(), __hide_putw (),
  422.                 __hide_puts (), __hide_fputs (), __hide_scanf (), __hide_fscanf (), __hide_sscanf (),
  423.                 __hide_setvbuf (), system(), ungetc();
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430. # 69 "/usr/local/lib/g++-include/stdio.h" 2 3
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470. }
  471.  
  472. extern "C" {
  473.  
  474. int    fclose(FILE*);
  475. FILE*  fdopen(int, const char*);
  476. int    fflush(FILE*);
  477. int    fgetc(FILE*);
  478. char*  fgets(char*, int, FILE *);
  479. FILE*  fopen(const char*, const char*);
  480. int    fprintf(FILE*, const char* ...);
  481. int    fputc(int, FILE*);
  482. int    fputs(const char*, FILE*);
  483. _G_size_t  fread(void*, _G_size_t , _G_size_t , FILE*);
  484.  
  485.  
  486.  
  487. FILE*  freopen(const char*, const char*, FILE*);
  488.  
  489. int    fscanf(FILE*, const char* ...);
  490. int    fseek(FILE*, long, int);
  491. long   ftell(FILE *);
  492. _G_size_t  fwrite(const void*, _G_size_t , _G_size_t , FILE*);
  493. char*  gets(char*);
  494. int    getw(FILE*);
  495. int    pclose(FILE*);
  496. void   perror(const char*);
  497. FILE*  popen(const char*, const char*);
  498. int    printf(const char* ...);
  499. int    puts(const char*);
  500. int    putw(int, FILE*);
  501. int    rewind(FILE*);
  502. int    scanf(const char* ...);
  503. void   setbuf(FILE*, char*);
  504. void   setbuffer(FILE*, char*, int);
  505. int    setlinebuf(FILE*);
  506. int    setvbuf(FILE*, char*, int, _G_size_t );
  507. int    sscanf(char*, const char* ...);
  508. FILE*  tmpfile();
  509. int    ungetc(int, FILE*);
  510. int    vfprintf (...) ;
  511. int    vprintf (...) ;
  512. int  sprintf (...) ;
  513. int  vsprintf (...) ;
  514.  
  515. extern int _filbuf (...) ;
  516. extern int _flsbuf (...) ;
  517.  
  518. }
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537. # 21 "eqn.h" 2
  538.  
  539. # 1 "/usr/local/lib/g++-include/string.h" 1 3
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554. extern "C" {
  555.  
  556. char*     strcat(char*, const char*);
  557. char*     strchr(const char*, int);
  558. int       strcmp(const char*, const char*);
  559. int       strcoll(const char*, const char*);
  560. char*     strcpy(char*, const char*);
  561. _G_size_t     strcspn(const char*, const char*);
  562. char*     strdup(const char*);
  563.  
  564.  
  565.  
  566.  
  567. _G_size_t     strlen(const char*);
  568. char*     strncat(char*, const char*, _G_size_t );
  569. int       strncmp(const char*, const char*, _G_size_t );
  570. char*     strncpy(char*, const char*, _G_size_t );
  571. char*     strpbrk(const char*, const char*);
  572. char*     strrchr(const char*, int);
  573. _G_size_t     strspn(const char*, const char*);
  574. char*     strstr(const char*, const char *);
  575. char*     strtok(char*, const char*);
  576. _G_size_t     strxfrm(char*, const char*, _G_size_t );
  577.  
  578. char*     index(const char*, int);
  579. char*     rindex(const char*, int);
  580. }
  581.  
  582. # 1 "/usr/local/lib/g++-include/memory.h" 1 3
  583.  
  584.  
  585.  
  586.  
  587.  
  588. # 1 "/usr/local/lib/g++-include/stddef.h" 1 3
  589.  
  590.  
  591. extern "C" {
  592.  
  593.  
  594.  
  595. # 1 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stddef.h" 1 3
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623. # 43 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stddef.h" 3
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654. typedef long int ptrdiff_t;
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692. typedef unsigned int _G_size_t ;
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733. typedef __wchar_t wchar_t;
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752. # 179 "/usr/local/lib/gcc-lib/3300/2.3.3/include/stddef.h" 3
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776. # 7 "/usr/local/lib/g++-include/stddef.h" 2 3
  777.  
  778.  
  779.  
  780.  
  781. }
  782.  
  783. # 6 "/usr/local/lib/g++-include/memory.h" 2 3
  784.  
  785.  
  786. extern "C" {
  787.  
  788. void*     memalign (...) ;
  789. void*     memccpy (...) ;
  790. void*     memchr (...) ;
  791. int       memcmp (...) ;
  792. void*     memcpy (...) ;
  793. void*     memmove (...) ;
  794. void*     memset (...) ;
  795. int       ffs (...) ;
  796.  
  797.  
  798.  
  799. _G_size_t    getpagesize (...) ;
  800.  
  801. void*     valloc (...) ;
  802.  
  803. void      bcopy (...) ;
  804. int       bcmp (...) ;
  805. void      bzero (...) ;
  806. }
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821. # 43 "/usr/local/lib/g++-include/string.h" 2 3
  822.  
  823.  
  824.  
  825. # 22 "eqn.h" 2
  826.  
  827. # 1 "../include/assert.h" 1
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851. volatile
  852.  
  853. void assertion_failed(int, const char *);
  854.  
  855. inline void do_assert(int expr, int line, const char *file)
  856. {
  857.   if (!expr)
  858.     assertion_failed(line, file);
  859. }
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869. # 23 "eqn.h" 2
  870.  
  871. # 1 "/usr/local/lib/g++-include/stdlib.h" 1 3
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879. extern "C" {
  880.  
  881. int       abs(int);
  882.  
  883.  
  884. void volatile abort(void);
  885.  
  886.  
  887.  
  888.  
  889. double    atof(const char*);
  890. int       atoi(const char*);
  891. long      atol(const char*);
  892.  
  893. int       atexit(auto void (*p) (void));
  894. int       bsearch (const void *, const void *, _G_size_t , 
  895.                    _G_size_t , auto int (*ptf)(const void*, const void*));
  896. void*     calloc(_G_size_t , _G_size_t );
  897. void      cfree(void*);
  898.  
  899.  
  900. void volatile exit(int);
  901.  
  902.  
  903.  
  904.  
  905. char*     fcvt(double, int, int*, int*);
  906. void      free(void*);
  907. char*     getenv(const char*);
  908. int       getopt(int, char * const *, const char*);
  909. int       getpw(int, char*);
  910. char*     gcvt(double, int, char*);
  911. char*     ecvt(double, int, int*, int*);
  912. extern char**   environ;
  913.  
  914. long      labs(long);
  915. void*     malloc(_G_size_t );
  916. _G_size_t     malloc_usable_size(void*);
  917. int       putenv(const char*);
  918. extern char*    optarg;
  919. extern int      opterr;
  920. extern int      optind;
  921. void      qsort(void*, _G_size_t , _G_size_t , auto int (*ptf)(void*,void*));
  922. int       rand(void);
  923. void*     realloc(void*, _G_size_t );
  924. int       setkey(const char*);
  925. int       srand(unsigned int);
  926. double    strtod(const char*, char**);
  927. long      strtol(const char*, char**, int);
  928. unsigned long stroul(const char**, int);
  929. int       system(const char*);
  930.  
  931. long      random(void);
  932. void      srandom(int);
  933. char*     setstate(char*);
  934. char*     initstate(unsigned, char*, int);
  935.  
  936. double    drand48(void);
  937. void      lcong48(short*);
  938. long      jrand48(short*);
  939. long      lrand48(void);
  940. long      mrand48(void);
  941. long      nrand48(short*);
  942. short*    seed48(short*);
  943. void      srand48(long);
  944.  
  945. char*     ctermid(char*);
  946. char*     cuserid(char*);
  947. char*     tempnam(const char*, const char*);
  948. char*     tmpnam(char*);
  949.  
  950. }
  951.  
  952. # 24 "eqn.h" 2
  953.  
  954. # 1 "/usr/local/lib/g++-include/errno.h" 1 3
  955.  
  956.  
  957. extern "C" {
  958.  
  959.  
  960.  
  961.  
  962.  
  963. # 1 "/usr/include/errno.h" 1 3
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970. # 1 "/usr/include/sys/errno.h" 1 3
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978. #ident  "@(#)kern-port:sys/errno.h      35.2"
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100. # 7 "/usr/include/errno.h" 2 3
  1101.  
  1102. extern int errno;
  1103. # 9 "/usr/local/lib/g++-include/errno.h" 2 3
  1104.  
  1105.  
  1106.  
  1107.  
  1108. extern char*    sys_errlist[];
  1109. extern int      sys_nerr;
  1110.  
  1111. extern int      errno;
  1112.  
  1113. void      perror(const char*);
  1114. char*     strerr(int);
  1115.  
  1116.  
  1117. }
  1118.  
  1119.  
  1120. # 25 "eqn.h" 2
  1121.  
  1122. # 1 "../include/cset.h" 1
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151. enum cset_builtin { CSET_BUILTIN };
  1152.  
  1153. class cset {
  1154. public:
  1155.   cset();
  1156.   cset(cset_builtin);
  1157.   cset(const char *);
  1158.   cset(const unsigned char *);
  1159.   int operator()(unsigned char) const;
  1160.  
  1161.   cset &operator|=(const cset &);
  1162.   cset &operator|=(unsigned char);
  1163.  
  1164.   friend class cset_init;
  1165. private:
  1166.   char v[255 +1];
  1167.   void clear();
  1168. };
  1169.  
  1170. inline int cset::operator()(unsigned char c) const
  1171. {
  1172.   return v[c];
  1173. }
  1174.  
  1175. inline cset &cset::operator|=(unsigned char c)
  1176. {
  1177.   v[c] = 1;
  1178.   return *this;
  1179. }
  1180.  
  1181. extern cset csalpha;
  1182. extern cset csupper;
  1183. extern cset cslower;
  1184. extern cset csdigit;
  1185. extern cset csxdigit;
  1186. extern cset csspace;
  1187. extern cset cspunct;
  1188. extern cset csalnum;
  1189. extern cset csprint;
  1190. extern cset csgraph;
  1191. extern cset cscntrl;
  1192.  
  1193. static class cset_init {
  1194.   static int initialised;
  1195. public:
  1196.   cset_init();
  1197. } _cset_init;
  1198. # 26 "eqn.h" 2
  1199.  
  1200. # 1 "../include/errarg.h" 1
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226. class errarg {
  1227.   enum { EMPTY, STRING, CHAR, INTEGER, DOUBLE } type;
  1228.  
  1229.     const char *s;
  1230.     int n;
  1231.     char c;
  1232.     double d;
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  public:
  1243.   errarg();
  1244.   errarg(const char *);
  1245.   errarg(char);
  1246.   errarg(unsigned char);
  1247.   errarg(int);
  1248.   errarg(double);
  1249.   int empty() const;
  1250.   void print() const;
  1251. };
  1252.  
  1253. extern errarg empty_errarg;
  1254.  
  1255. extern void errprint(const char *,
  1256.                      const errarg &arg1 = empty_errarg,
  1257.                      const errarg &arg2 = empty_errarg,
  1258.                      const errarg &arg3 = empty_errarg);
  1259.  
  1260. # 27 "eqn.h" 2
  1261.  
  1262. # 1 "../include/error.h" 1
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283. extern void fatal_with_file_and_line(const char *filename, int lineno,
  1284.                                      const char *format,
  1285.                                      const errarg &arg1 = empty_errarg,
  1286.                                      const errarg &arg2 = empty_errarg,
  1287.                                      const errarg &arg3 = empty_errarg);
  1288.  
  1289. extern void error_with_file_and_line(const char *filename, int lineno,
  1290.                                      const char *format,
  1291.                                      const errarg &arg1 = empty_errarg,
  1292.                                      const errarg &arg2 = empty_errarg,
  1293.                                      const errarg &arg3 = empty_errarg);
  1294.  
  1295. extern void warning_with_file_and_line(const char *filename, int lineno,
  1296.                                      const char *format,
  1297.                                      const errarg &arg1 = empty_errarg,
  1298.                                      const errarg &arg2 = empty_errarg,
  1299.                                      const errarg &arg3 = empty_errarg);
  1300.  
  1301. extern void fatal(const char *,
  1302.                   const errarg &arg1 = empty_errarg,
  1303.                   const errarg &arg2 = empty_errarg,
  1304.                   const errarg &arg3 = empty_errarg);
  1305.  
  1306. extern void error(const char *,
  1307.                   const errarg &arg1 = empty_errarg,
  1308.                   const errarg &arg2 = empty_errarg,
  1309.                   const errarg &arg3 = empty_errarg);
  1310.  
  1311. extern void warning(const char *,
  1312.                     const errarg &arg1 = empty_errarg,
  1313.                     const errarg &arg2 = empty_errarg,
  1314.                     const errarg &arg3 = empty_errarg);
  1315.  
  1316.  
  1317. extern const char *program_name;
  1318. extern int current_lineno;
  1319. extern const char *current_filename;
  1320.  
  1321. # 28 "eqn.h" 2
  1322.  
  1323. # 1 "../include/lib.h" 1
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344. extern "C" {
  1345.   char *strerror(int);
  1346.  
  1347.   const char *itoa(int);
  1348.   const char *iftoa(int, int);
  1349.  
  1350. };
  1351.  
  1352.  
  1353. extern "C" {
  1354.   int getopt(int, const char **, const char *);
  1355.   extern char *optarg;
  1356.   extern int optind;
  1357.   extern int opterr;
  1358. }
  1359.  
  1360.  
  1361. char *strsave(const char *s);
  1362. int is_prime(unsigned);
  1363.  
  1364. # 1 "/usr/local/lib/g++-include/stdio.h" 1 3
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383. # 174 "/usr/local/lib/g++-include/stdio.h" 3
  1384.  
  1385. # 41 "../include/lib.h" 2
  1386.  
  1387.  
  1388. FILE *xtmpfile();
  1389.  
  1390. int interpret_lf_args(const char *p);
  1391.  
  1392. extern char illegal_char_table[];
  1393.  
  1394. inline int illegal_input_char(int c)
  1395. {
  1396.   return c >= 0 && illegal_char_table[c];
  1397. }
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440. # 29 "eqn.h" 2
  1441.  
  1442.  
  1443. # 1 "box.h" 1
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464. struct list_box;
  1465.  
  1466. class box {
  1467. private:
  1468.   static int next_uid;
  1469. public:
  1470.   int spacing_type;
  1471.   const int uid;
  1472.   box();
  1473.   virtual void debug_print() = 0;
  1474.   virtual ~box();
  1475.   void top_level();
  1476.   virtual int compute_metrics(int);
  1477.   virtual void compute_subscript_kern();
  1478.   virtual void compute_skew();
  1479.   virtual void output();
  1480.   void extra_space();
  1481.   virtual list_box *to_list_box();
  1482.   virtual int is_simple();
  1483.   virtual int is_char();
  1484.   virtual int left_is_italic();
  1485.   virtual int right_is_italic();
  1486.   virtual void handle_char_type(int, int);
  1487.   enum { FOUND_NOTHING = 0, FOUND_MARK = 1, FOUND_LINEUP = 2 };
  1488.   void set_spacing_type(char *type);
  1489.   virtual void hint(unsigned);
  1490.   virtual void check_tabs(int);
  1491. };
  1492.  
  1493. class box_list {
  1494. private:
  1495.   int maxlen;
  1496. public:
  1497.   box **p;
  1498.   int len;
  1499.  
  1500.   box_list(box *);
  1501.   ~box_list();
  1502.   void append(box *);
  1503.   void list_check_tabs(int);
  1504.   void list_debug_print(const char *sep);
  1505.   friend class list_box;
  1506. };
  1507.  
  1508. class list_box : public box {
  1509.   int is_script;
  1510.   box_list list;
  1511.   int sty;
  1512. public:
  1513.   list_box(box *);
  1514.   void debug_print();
  1515.   int compute_metrics(int);
  1516.   void compute_subscript_kern();
  1517.   void output();
  1518.   void check_tabs(int);
  1519.   void append(box *);
  1520.   list_box *to_list_box();
  1521.   void handle_char_type(int, int);
  1522.   void compute_sublist_width(int n);
  1523.   friend box *make_script_box(box *, box *, box *);
  1524.   friend box *make_mark_box(box *);
  1525.   friend box *make_lineup_box(box *);
  1526. };
  1527.  
  1528. enum alignment { LEFT_ALIGN, RIGHT_ALIGN, CENTER_ALIGN };
  1529.  
  1530. class column : public box_list {
  1531.   alignment align;
  1532.   int space;
  1533. public:
  1534.   column(box *);
  1535.   void set_alignment(alignment);
  1536.   void set_space(int);
  1537.   void debug_print(const char *);
  1538.  
  1539.   friend class matrix_box;
  1540.   friend class pile_box;
  1541. };
  1542.  
  1543. class pile_box : public box {
  1544.   column col;
  1545. public:
  1546.   pile_box(box *);
  1547.   int compute_metrics(int);
  1548.   void output();
  1549.   void debug_print();
  1550.   void check_tabs(int);
  1551.   void set_alignment(alignment a) { col.set_alignment(a); }
  1552.   void set_space(int n) { col.set_space(n); }
  1553.   void append(box *p) { col.append(p); }
  1554. };
  1555.  
  1556. class matrix_box : public box {
  1557. private:
  1558.   int len;
  1559.   int maxlen;
  1560.   column **p;
  1561. public:
  1562.   matrix_box(column *);
  1563.   ~matrix_box();
  1564.   void append(column *);
  1565.   int compute_metrics(int);
  1566.   void output();
  1567.   void check_tabs(int);
  1568.   void debug_print();
  1569. };
  1570.  
  1571. class pointer_box : public box {
  1572. protected:
  1573.   box *p;
  1574. public:
  1575.   pointer_box(box *);
  1576.   ~pointer_box();
  1577.   int compute_metrics(int);
  1578.   void compute_subscript_kern();
  1579.   void compute_skew();
  1580.   void debug_print() = 0;
  1581.   void check_tabs(int);
  1582. };
  1583.  
  1584. class vcenter_box : public pointer_box {
  1585. public:
  1586.   vcenter_box(box *);
  1587.   int compute_metrics(int);
  1588.   void output();
  1589.   void debug_print();
  1590. };
  1591.  
  1592. class simple_box : public box {
  1593. public:
  1594.   int compute_metrics(int);
  1595.   void compute_subscript_kern();
  1596.   void compute_skew();
  1597.   void output() = 0;
  1598.   void debug_print() = 0;
  1599.   int is_simple();
  1600. };
  1601.  
  1602. class quoted_text_box : public simple_box {
  1603.   char *text;
  1604. public:
  1605.   quoted_text_box(char *);
  1606.   ~quoted_text_box();
  1607.   void debug_print();
  1608.   void output();
  1609. };
  1610.  
  1611. class half_space_box : public simple_box {
  1612. public:
  1613.   half_space_box();
  1614.   void output();
  1615.   void debug_print();
  1616. };
  1617.  
  1618. class space_box : public simple_box {
  1619. public:
  1620.   space_box();
  1621.   void output();
  1622.   void debug_print();
  1623. };
  1624.  
  1625. class tab_box : public box {
  1626.   int disabled;
  1627. public:
  1628.   tab_box();
  1629.   void output();
  1630.   void debug_print();
  1631.   void check_tabs(int);
  1632. };
  1633.  
  1634. class size_box : public pointer_box {
  1635. private:
  1636.   char *size;
  1637. public:
  1638.   size_box(char *, box *);
  1639.   ~size_box();
  1640.   int compute_metrics(int);
  1641.   void output();
  1642.   void debug_print();
  1643. };
  1644.  
  1645. class font_box : public pointer_box {
  1646. private:
  1647.   char *f;
  1648. public:
  1649.   font_box(char *, box *);
  1650.   ~font_box();
  1651.   int compute_metrics(int);
  1652.   void output();
  1653.   void debug_print();
  1654. };
  1655.  
  1656. class fat_box : public pointer_box {
  1657. public:
  1658.   fat_box(box *);
  1659.   int compute_metrics(int);
  1660.   void output();
  1661.   void debug_print();
  1662. };
  1663.  
  1664. class vmotion_box : public pointer_box {
  1665. private:
  1666.   int n;                         
  1667. public:
  1668.   vmotion_box(int, box *);
  1669.   int compute_metrics(int);
  1670.   void output();
  1671.   void debug_print();
  1672. };
  1673.  
  1674. class hmotion_box : public pointer_box {
  1675.   int n;
  1676. public:
  1677.   hmotion_box(int, box *);
  1678.   int compute_metrics(int);
  1679.   void output();
  1680.   void debug_print();
  1681. };
  1682.  
  1683. box *split_text(char *);
  1684. box *make_script_box(box *, box *, box *);
  1685. box *make_mark_box(box *);
  1686. box *make_lineup_box(box *);
  1687. box *make_delim_box(char *, box *, char *);
  1688. box *make_sqrt_box(box *);
  1689. box *make_prime_box(box *);
  1690. box *make_over_box(box *, box *);
  1691. box *make_small_over_box(box *, box *);
  1692. box *make_limit_box(box *, box *, box *);
  1693. box *make_accent_box(box *, box *);
  1694. box *make_uaccent_box(box *, box *);
  1695. box *make_overline_box(box *);
  1696. box *make_underline_box(box *);
  1697. box *make_special_box(char *, box *);
  1698.  
  1699. void set_space(int);
  1700. void set_gsize(const char *);
  1701. void set_gfont(const char *);
  1702. void set_grfont(const char *);
  1703. void set_gbfont(const char *);
  1704. const char *get_gfont();
  1705. const char *get_grfont();
  1706. const char *get_gbfont();
  1707. void start_string();
  1708. void output_string();
  1709. void do_text(const char *);
  1710. void restore_compatibility();
  1711. void set_script_reduction(int n);
  1712. void set_minimum_size(int n);
  1713. void set_param(const char *name, int value);
  1714.  
  1715. void set_char_type(const char *type, char *ch);
  1716.  
  1717. void init_char_table();
  1718. void init_extensible();
  1719. void define_extensible(const char *name, const char *ext, const char *top = 0,
  1720.                        const char *mid = 0, const char *bot = 0);
  1721. # 31 "eqn.h" 2
  1722.  
  1723.  
  1724. extern char start_delim;
  1725. extern char end_delim;
  1726. extern int non_empty_flag;
  1727. extern int inline_flag;
  1728. extern int draw_flag;
  1729. extern int one_size_reduction_flag;
  1730. extern int compatible_flag;
  1731.  
  1732. void init_lex(const char *str, const char *filename, int lineno);
  1733. void lex_error(const char *message,
  1734.                const errarg &arg1 = empty_errarg,
  1735.                const errarg &arg2 = empty_errarg,
  1736.                const errarg &arg3 = empty_errarg);
  1737.  
  1738. void init_table(const char *device);
  1739.  
  1740.  
  1741.  
  1742. # 21 "lex.cc" 2
  1743.  
  1744. # 1 "eqn.tab.h" 1
  1745. typedef union {
  1746.         char *str;
  1747.         box *b;
  1748.         pile_box *pb;
  1749.         matrix_box *mb;
  1750.         int n;
  1751.         column *col;
  1752. } YYSTYPE;
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813. extern YYSTYPE yylval;
  1814. # 22 "lex.cc" 2
  1815.  
  1816. # 1 "../include/stringclass.h" 1
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838. # 1 "/usr/local/lib/g++-include/stdio.h" 1 3
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857. # 174 "/usr/local/lib/g++-include/stdio.h" 3
  1858.  
  1859. # 22 "../include/stringclass.h" 2
  1860.  
  1861. # 1 "../include/assert.h" 1
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882. # 33 "../include/assert.h"
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892. # 23 "../include/stringclass.h" 2
  1893.  
  1894.  
  1895. class string {
  1896. public:
  1897.   string();
  1898.   string(const string &);
  1899.   string(const char *);
  1900.   string(const char *, int);
  1901.   string(char);
  1902.  
  1903.   ~string();
  1904.   
  1905.   string &operator=(const string &);
  1906.   string &operator=(const char *);
  1907.   string &operator=(char);
  1908.  
  1909.   string &operator+=(const string &);
  1910.   string &operator+=(const char *);
  1911.   string &operator+=(char);
  1912.   void append(const char *, int);
  1913.   
  1914.   int length() const;
  1915.   int empty() const;
  1916.   int operator*() const;
  1917.  
  1918.   string substring(int i, int n) const;
  1919.  
  1920.   char &operator[](int);
  1921.   char operator[](int) const;
  1922.  
  1923.   void set_length(int i);
  1924.   const char *contents() const;
  1925.   int search(char) const;
  1926.   char *extract() const;
  1927.   void clear();
  1928.   void move(string &);
  1929.  
  1930.   friend string operator+(const string &, const string &);
  1931.   friend string operator+(const string &, const char *);
  1932.   friend string operator+(const char *, const string &);
  1933.   friend string operator+(const string &, char);
  1934.   friend string operator+(char, const string &);
  1935.  
  1936.   friend int operator==(const string &, const string &);
  1937.   friend int operator!=(const string &, const string &);
  1938.   friend int operator<=(const string &, const string &);
  1939.   friend int operator<(const string &, const string &);
  1940.   friend int operator>=(const string &, const string &);
  1941.   friend int operator>(const string &, const string &);
  1942.  
  1943. private:
  1944.   char *ptr;
  1945.   int len;
  1946.   int sz;
  1947.  
  1948.   string(const char *, int, const char *, int);  
  1949.   void grow1();
  1950. };
  1951.  
  1952.  
  1953. inline char &string::operator[](int i)
  1954. {
  1955.   do_assert(i >= 0 && i < len, 85, "../include/stringclass.h") ;
  1956.   return ptr[i];
  1957. }
  1958.  
  1959. inline char string::operator[](int i) const
  1960. {
  1961.   do_assert(i >= 0 && i < len, 91, "../include/stringclass.h") ;
  1962.   return ptr[i];
  1963. }
  1964.  
  1965. inline int string::length() const
  1966. {
  1967.   return len;
  1968. }
  1969.  
  1970. inline int string::empty() const
  1971. {
  1972.   return len == 0;
  1973. }
  1974.  
  1975. inline int string::operator*() const
  1976. {
  1977.   return len;
  1978. }
  1979.  
  1980. inline const char *string::contents() const
  1981. {
  1982.   return  ptr;
  1983. }
  1984.  
  1985. inline string operator+(const string &s1, const string &s2)
  1986. {
  1987.   return string(s1.ptr, s1.len, s2.ptr, s2.len);
  1988. }
  1989.  
  1990. inline string operator+(const string &s1, const char *s2)
  1991. {
  1992.   if (s2 == 0)
  1993.     return s1;
  1994.   else
  1995.     return string(s1.ptr, s1.len, s2, strlen(s2));
  1996. }
  1997.  
  1998. inline string operator+(const char *s1, const string &s2)
  1999. {
  2000.   if (s1 == 0)
  2001.     return s2;
  2002.   else
  2003.     return string(s1, strlen(s1), s2.ptr, s2.len);
  2004. }
  2005.  
  2006. inline string operator+(const string &s, char c)
  2007. {
  2008.   return string(s.ptr, s.len, &c, 1);
  2009. }
  2010.  
  2011. inline string operator+(char c, const string &s)
  2012. {
  2013.   return string(&c, 1, s.ptr, s.len);
  2014. }
  2015.  
  2016. inline int operator==(const string &s1, const string &s2)
  2017. {
  2018.   return (s1.len == s2.len 
  2019.           && (s1.len == 0 || memcmp(s1.ptr, s2.ptr, s1.len) == 0));
  2020. }
  2021.  
  2022. inline int operator!=(const string &s1, const string &s2)
  2023. {
  2024.   return (s1.len != s2.len 
  2025.           || (s1.len != 0 && memcmp(s1.ptr, s2.ptr, s1.len) != 0));
  2026. }
  2027.  
  2028. inline string string::substring(int i, int n) const
  2029. {
  2030.   do_assert(i >= 0 && i + n <= len, 160, "../include/stringclass.h") ;
  2031.   return string(ptr + i, n);
  2032. }
  2033.  
  2034. inline string &string::operator+=(char c)
  2035. {
  2036.   if (len >= sz)
  2037.     grow1();
  2038.   ptr[len++] = c;
  2039.   return *this;
  2040. }
  2041.  
  2042. void put_string(const string &, FILE *);
  2043.  
  2044. string as_string(int);
  2045. # 23 "lex.cc" 2
  2046.  
  2047. # 1 "../include/ptable.h" 1
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068. # 1 "../include/assert.h" 1
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089. # 33 "../include/assert.h"
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099. # 21 "../include/ptable.h" 2
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114. extern unsigned next_ptable_size(unsigned);
  2115. extern unsigned long hash_string(const char *);
  2116.  
  2117.  
  2118. # 68 "../include/ptable.h"
  2119.  
  2120.  
  2121.  
  2122. # 166 "../include/ptable.h"
  2123.  
  2124. # 24 "lex.cc" 2
  2125.  
  2126.  
  2127. struct definition {
  2128.   char is_macro;
  2129.   char is_simple;
  2130.   union {
  2131.     int tok;
  2132.     char *contents;
  2133.   };
  2134.   definition();
  2135.   ~definition();
  2136. };
  2137.  
  2138. definition::definition() : is_macro(1), contents(0), is_simple(0)
  2139. {
  2140. }
  2141.  
  2142. definition::~definition()
  2143. {
  2144.   if (is_macro)
  2145.     delete []  contents;
  2146. }
  2147.  
  2148. struct definition_passoc    {   char *key;      definition *val;        definition_passoc   (); };      struct definition_ptable   ;    class definition_ptable_iterator    {   definition_ptable    *p;        unsigned i;     public: definition_ptable_iterator   (definition_ptable    *);  int next(const char **, definition **); };      class definition_ptable    {    definition_passoc    *v;        unsigned size;  unsigned used;  enum { FULL_NUM = 2, FULL_DEN = 3, INITIAL_SIZE = 17 }; public: definition_ptab
  2149. le   (); ~definition_ptable   ();        void define(const char *, definition *);        definition *lookup(const char *);       friend class definition_ptable_iterator   ;     }; 
  2150.  
  2151.