home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 404_02 / bisnp / bison.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-16  |  4.3 KB  |  241 lines

  1. /* before anything */
  2. #ifdef c_plusplus
  3. #ifndef __cplusplus
  4. #define __cplusplus
  5. #endif
  6. #endif
  7. #ifdef __cplusplus
  8. #ifndef YY_USE_CLASS
  9. #define YY_USE_CLASS
  10. #endif
  11. #else
  12. #endif
  13. #include <stdio.h>
  14. $ /* %{ and %header{ and %union, during decl */
  15. #ifndef YY_@_COMPATIBILITY
  16. #ifndef YY_USE_CLASS
  17. #define  YY_@_COMPATIBILITY 1
  18. #else
  19. #define  YY_@_COMPATIBILITY 0
  20. #endif
  21. #endif
  22.  
  23. #if YY_@_COMPATIBILITY != 0
  24. /* backward compatibility */
  25. #ifdef YYLTYPE
  26. #ifndef YY_@_LTYPE
  27. #define YY_@_LTYPE YYLTYPE
  28. /* WARNING obsolete !!! user defined YYLTYPE not reported into generated header */
  29. /* use %define LTYPE */
  30. #endif
  31. #endif
  32. #ifdef YYSTYPE
  33. #ifndef YY_@_STYPE 
  34. #define YY_@_STYPE YYSTYPE
  35. /* WARNING obsolete !!! user defined YYSTYPE not reported into generated header */
  36. /* use %define STYPE */
  37. #endif
  38. #endif
  39. #ifdef YYDEBUG
  40. #ifndef YY_@_DEBUG
  41. #define  YY_@_DEBUG YYDEBUG
  42. /* WARNING obsolete !!! user defined YYDEBUG not reported into generated header */
  43. /* use %define DEBUG */
  44. #endif
  45. #endif
  46. #ifdef YY_@_STYPE
  47. #ifndef yystype
  48. #define yystype YY_@_STYPE
  49. #endif
  50. #endif
  51. /* use goto to be compatible */
  52. #ifndef YY_@_USE_GOTO
  53. #define YY_@_USE_GOTO 1
  54. #endif
  55. #endif
  56.  
  57. /* use no goto to be clean in C++ */
  58. #ifndef YY_@_USE_GOTO
  59. #define YY_@_USE_GOTO 0
  60. #endif
  61.  
  62. #ifndef YY_@_PURE
  63. $/* YY_@_PURE */
  64. #endif
  65. $/* prefix */
  66. #ifndef YY_@_DEBUG
  67. $/* YY_@_DEBUG */
  68. #endif
  69. #ifndef YY_@_LSP_NEEDED
  70. $ /* YY_@_LSP_NEEDED*/
  71. #endif
  72. /* DEFAULT LTYPE*/
  73. #ifdef YY_@_LSP_NEEDED
  74. #ifndef YY_@_LTYPE
  75. typedef
  76.   struct yyltype
  77.     {
  78.       int timestamp;
  79.       int first_line;
  80.       int first_column;
  81.       int last_line;
  82.       int last_column;
  83.       char *text;
  84.    }
  85.   yyltype;
  86.  
  87. #define YY_@_LTYPE yyltype
  88. #endif
  89. #endif
  90. /* DEFAULT STYPE*/
  91. #ifndef YY_@_STYPE
  92. #define YY_@_STYPE int
  93. #endif
  94. /* DEFAULT MISCELANEOUS */
  95. #ifndef YY_@_PARSE
  96. #define YY_@_PARSE yyparse
  97. #endif
  98. #ifndef YY_@_LEX
  99. #define YY_@_LEX yylex
  100. #endif
  101. #ifndef YY_@_LVAL
  102. #define YY_@_LVAL yylval
  103. #endif
  104. #ifndef YY_@_LLOC
  105. #define YY_@_LLOC yylloc
  106. #endif
  107. #ifndef YY_@_CHAR
  108. #define YY_@_CHAR yychar
  109. #endif
  110. #ifndef YY_@_NERRS
  111. #define YY_@_NERRS yynerrs
  112. #endif
  113. #ifndef YY_@_DEBUG_FLAG
  114. #define YY_@_DEBUG_FLAG yydebug
  115. #endif
  116. #ifndef YY_@_ERROR
  117. #define YY_@_ERROR yyerror
  118. #endif
  119.  
  120. #ifndef YY_@_PARSE_PARAM
  121. #ifndef __STDC__
  122. #ifndef __cplusplus
  123. #ifndef YY_USE_CLASS
  124. #define YY_@_PARSE_PARAM
  125. #ifndef YY_@_PARSE_PARAM_DEF
  126. #define YY_@_PARSE_PARAM_DEF
  127. #endif
  128. #endif
  129. #endif
  130. #endif
  131. #ifndef YY_@_PARSE_PARAM
  132. #define YY_@_PARSE_PARAM void
  133. #endif
  134. #endif
  135.  
  136. /* TOKEN C */
  137. #ifndef YY_USE_CLASS
  138.  
  139. #ifndef YY_@_PURE
  140. extern YY_@_STYPE YY_@_LVAL;
  141. #endif
  142.  
  143. $ /* #defines token */
  144. /* after #define tokens, before const tokens S5*/
  145. #else
  146. #ifndef YY_@_CLASS
  147. #define YY_@_CLASS @
  148. #endif
  149.  
  150. #ifndef YY_@_INHERIT
  151. #define YY_@_INHERIT
  152. #endif
  153. #ifndef YY_@_MEMBERS
  154. #define YY_@_MEMBERS 
  155. #endif
  156. #ifndef YY_@_LEX_BODY
  157. #define YY_@_LEX_BODY  
  158. #endif
  159. #ifndef YY_@_ERROR_BODY
  160. #define YY_@_ERROR_BODY  
  161. #endif
  162. #ifndef YY_@_CONSTRUCTOR_PARAM
  163. #define YY_@_CONSTRUCTOR_PARAM
  164. #endif
  165. /* choose between enum and const */
  166. #ifndef YY_@_USE_CONST_TOKEN
  167. #define YY_@_USE_CONST_TOKEN 0
  168. /* yes enum is more compatible with flex,  */
  169. /* so by default we use it */
  170. #endif
  171. #if YY_@_USE_CONST_TOKEN != 0
  172. #ifndef YY_@_ENUM_TOKEN
  173. #define YY_@_ENUM_TOKEN yy_@_enum_token
  174. #endif
  175. #endif
  176.  
  177. class YY_@_CLASS YY_@_INHERIT
  178. {
  179. public:
  180. #if YY_@_USE_CONST_TOKEN != 0
  181. /* static const int token ... */
  182. $ /* decl const */
  183. #else
  184. enum YY_@_ENUM_TOKEN { YY_@_NULL_TOKEN=0
  185. $ /* enum token */
  186.      }; /* end of enum declaration */
  187. #endif
  188. public:
  189.  int YY_@_PARSE(YY_@_PARSE_PARAM);
  190.  virtual void YY_@_ERROR(char *msg) YY_@_ERROR_BODY;
  191. #ifdef YY_@_PURE
  192. #ifdef YY_@_LSP_NEEDED
  193.  virtual int  YY_@_LEX(YY_@_STYPE *YY_@_LVAL,YY_@_LTYPE *YY_@_LLOC) YY_@_LEX_BODY;
  194. #else
  195.  virtual int  YY_@_LEX(YY_@_STYPE *YY_@_LVAL) YY_@_LEX_BODY;
  196. #endif
  197. #else
  198.  virtual int YY_@_LEX() YY_@_LEX_BODY;
  199.  YY_@_STYPE YY_@_LVAL;
  200. #ifdef YY_@_LSP_NEEDED
  201.  YY_@_LTYPE YY_@_LLOC;
  202. #endif
  203.  int YY_@_NERRS;
  204.  int YY_@_CHAR;
  205. #endif
  206. #if YY_@_DEBUG != 0
  207. public:
  208.  int YY_@_DEBUG_FLAG;    /*  nonzero means print parse trace    */
  209. #endif
  210. public:
  211.  YY_@_CLASS(YY_@_CONSTRUCTOR_PARAM);
  212. public:
  213.  YY_@_MEMBERS 
  214. };
  215. /* other declare folow */
  216. #endif
  217.  
  218.  
  219. #if YY_@_COMPATIBILITY != 0
  220. /* backward compatibility */
  221. #ifndef YYSTYPE
  222. #define YYSTYPE YY_@_STYPE
  223. #endif
  224.  
  225. #ifndef YYLTYPE
  226. #define YYLTYPE YY_@_LTYPE
  227. #endif
  228. #ifndef YYDEBUG
  229. #ifdef YY_@_DEBUG 
  230. #define YYDEBUG YY_@_DEBUG
  231. #endif
  232. #endif
  233.  
  234. #endif
  235. /* END */
  236. $ /* section 3 %header{ */
  237.  /* AFTER END , NEVER READ !!! */
  238.  
  239.  
  240.  
  241.