home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pccts1.zip / H / DLGDEF.H < prev    next >
C/C++ Source or Header  |  1993-09-01  |  5KB  |  124 lines

  1. /* dlg2.h
  2.  * Things in scanner produced by dlg that should be visible to the outside
  3.  * world
  4.  *
  5.  * SOFTWARE RIGHTS
  6.  *
  7.  * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
  8.  * Set (PCCTS) -- PCCTS is in the public domain.  An individual or
  9.  * company may do whatever they wish with source code distributed with
  10.  * PCCTS or the code generated by PCCTS, including the incorporation of
  11.  * PCCTS, or its output, into commerical software.
  12.  * 
  13.  * We encourage users to develop software with PCCTS.  However, we do ask
  14.  * that credit is given to us for developing PCCTS.  By "credit",
  15.  * we mean that if you incorporate our source code into one of your
  16.  * programs (commercial product, research project, or otherwise) that you
  17.  * acknowledge this fact somewhere in the documentation, research report,
  18.  * etc...  If you like PCCTS and have developed a nice tool with the
  19.  * output, please mention that you developed it using PCCTS.  In
  20.  * addition, we ask that this header remain intact in our source code.
  21.  * As long as these guidelines are kept, we expect to continue enhancing
  22.  * this system and expect to make other tools available as they are
  23.  * completed.
  24.  *
  25.  * ANTLR 1.10
  26.  * Will Cohen
  27.  * Purdue University
  28.  * 1989-1993
  29.  */
  30.  
  31. #ifndef ZZDLGDEF_H
  32. #define ZZDLGDEF_H
  33.  
  34. #ifndef zzchar_t
  35. #ifdef ZZWCHAR_T
  36. #define zzchar_t wchar_t
  37. #else
  38. #define zzchar_t char
  39. #endif
  40. #endif
  41.  
  42. struct zzdlg_state {
  43.     FILE *stream;
  44.     int (*func_ptr)();
  45.     zzchar_t *str;
  46.     int auto_num;
  47.     int add_erase;
  48.     int lookc;
  49.     int char_full;
  50.     int begcol, endcol;
  51.     int line;
  52.     zzchar_t *lextext, *begexpr, *endexpr;
  53.     int bufsize;
  54.     int bufovf;
  55.     zzchar_t *nextpos;
  56.     int    class_num;
  57. };
  58.  
  59. #ifdef __STDC__
  60. extern zzchar_t    *zzlextext;      /* text of most recently matched token */
  61. extern zzchar_t    *zzbegexpr;    /* beginning of last reg expr recogn. */
  62. extern zzchar_t    *zzendexpr;    /* beginning of last reg expr recogn. */
  63. extern int    zzbufsize;    /* how long zzlextext is */
  64. extern int    zzbegcol;    /* column that first character of token is in*/
  65. extern int    zzendcol;    /* column that last character of token is in */
  66. extern int    zzline;        /* line current token is on */
  67. extern int    zzchar;        /* character to determine next state */
  68. extern int    zzbufovf;    /* indicates that buffer too small for text */
  69. extern void    (*zzerr)(char *);/* pointer to error reporting function */
  70.  
  71. /* functions */
  72. extern void    zzadvance(void);
  73. extern void    zzskip(void);    /* erase zzlextext, look for antoher token */
  74. extern void    zzmore(void);    /* keep zzlextext, look for another token */
  75. extern void    zzmode(int k);    /* switch to automaton 'k' */
  76. extern void    zzrdstream(FILE *);/* what stream to read from */
  77. extern void    zzclose_stream(void);/* close the current input stream */
  78. extern void    zzrdfunc(int (*)());/* what function to get char from */
  79. extern void zzrdstr( zzchar_t * );
  80. extern void    zzgettok(void);    /* get next token */
  81. extern void    zzreplchar(zzchar_t c);/* replace last recognized reg. expr. with
  82.                     a character */
  83. extern void    zzreplstr(zzchar_t *s);/* replace last recognized reg. expr. with
  84.                     a string */
  85. extern void zzsave_dlg_state(struct zzdlg_state *);
  86. extern void zzrestore_dlg_state(struct zzdlg_state *);
  87. extern int zzerr_in(void);
  88. extern void    zzerrstd(char *);
  89.  
  90. #else
  91.  
  92. extern zzchar_t    *zzlextext;      /* text of most recently matched token */
  93. extern zzchar_t    *zzbegexpr;    /* beginning of last reg expr recogn. */
  94. extern zzchar_t    *zzendexpr;    /* beginning of last reg expr recogn. */
  95. extern int    zzbufsize;    /* how long zzlextext is */
  96. extern int    zzbegcol;    /* column that first character of token is in*/
  97. extern int    zzendcol;    /* column that last character of token is in */
  98. extern int    zzline;        /* line current token is on */
  99. extern int    zzchar;        /* character to determine next state */
  100. extern int    zzbufovf;    /* indicates that buffer too small for text */
  101. extern void    (*zzerr)();    /* pointer to error reporting function */
  102.  
  103. /* functions */
  104. extern void    zzadvance();
  105. extern void    zzskip();    /* erase zzlextext, look for antoher token */
  106. extern void    zzmore();    /* keep zzlextext, look for another token */
  107. extern void    zzmode(/*k*/);    /* switch to automaton 'k' */
  108. extern void    zzrdstream();    /* what stream to read from */
  109. extern void    zzclose_stream();/* close the current input stream */
  110. extern void    zzrdfunc();    /* what function to get char from */
  111. extern void zzrdstr();
  112. extern void    zzgettok();    /* get next token */
  113. extern void    zzreplchar();    /* replace last recognized reg. expr. with
  114.                     a character */
  115. extern void    zzreplstr();    /* replace last recognized reg. expr. with
  116.                     a string */
  117. extern void zzsave_dlg_state();
  118. extern void zzrestore_dlg_state();
  119. extern int zzerr_in();
  120. extern void    zzerrstd();
  121. #endif
  122.  
  123. #endif
  124.