home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume26 / c++2latex / part02 < prev    next >
Encoding:
Text File  |  1991-12-14  |  55.1 KB  |  2,061 lines

  1. Newsgroups: comp.sources.misc
  2. From: heitkoet@gorbi.informatik.uni-dortmund.de (Joerg Heitkoetter)
  3. Subject:  v26i114:  c++2latex - a C++ to LaTeX converter, Part02/03
  4. Message-ID: <1991Dec15.033422.23766@sparky.imd.sterling.com>
  5. X-Md4-Signature: 561d1e18c59322c524374760742b915a
  6. Date: Sun, 15 Dec 1991 03:34:22 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: heitkoet@gorbi.informatik.uni-dortmund.de (Joerg Heitkoetter)
  10. Posting-number: Volume 26, Issue 114
  11. Archive-name: c++2latex/part02
  12. Environment: C++, LaTeX
  13.  
  14. #!/bin/sh
  15. # do not concatenate these parts, unpack them in order with /bin/sh
  16. # file c++2latex.c continued
  17. #
  18. if test ! -r _shar_seq_.tmp; then
  19.     echo 'Please unpack part 1 first!'
  20.     exit 1
  21. fi
  22. (read Scheck
  23.  if test "$Scheck" != 2; then
  24.     echo Please unpack part "$Scheck" next!
  25.     exit 1
  26.  else
  27.     exit 0
  28.  fi
  29. ) < _shar_seq_.tmp || exit 1
  30. if test ! -f _shar_wnt_.tmp; then
  31.     echo 'x - still skipping c++2latex.c'
  32. else
  33. echo 'x - continuing file c++2latex.c'
  34. sed 's/^X//' << 'SHAR_EOF' >> 'c++2latex.c' &&
  35. X      310,  196,  141,  312,  196,  267,  316,  313,  319,  196,
  36. X      141,  196,  314,  196,  196,  196,  196,  315,  196,  196,
  37. X      196,  196,  196,  320,  317,  196,  196,  196,  196,  196,
  38. X      196,  196,  196,  318,  303,  381,  382,  322,  321,  355,
  39. X
  40. X      196,  324,  196,  241,  243,  323,  241,  243,  334,  357,
  41. X      330,  326,  331,  325,  342,  328,  340,  358,  327,  332,
  42. X      335,  242,  244,  336,  333,  329,  339,  344,  345,  343,
  43. X      348,  353,  337,  341,  338,  347,  368,  196,  349,  350,
  44. X      346,  196,  351,  196,  352,  369,  369,  371,  196,  371,
  45. X      196,  196,  372,  372,  372,  264,  264,  264,  374,  196,
  46. X      374,  196,  196,  375,  375,  375,  140,  373,  196,  373,
  47. X      269,  269,  269,  269,  269,  269,  376,  376,  196,  140,
  48. X      373,  196,  405,  406,  407,  373,  196,  196,  409,  196,
  49. X      196,  410,  376,  408,  413,  196,  196,  414,  411,  412,
  50. X
  51. X      376,  415,  196,  196,  196,  196,  196,  196,  196,  196,
  52. X      416,  196,  196,  196,  196,  196,  196,  417,  196,  196,
  53. X      196,  196,  421,  419,  196,  420,  196,  196,  368,  418,
  54. X      196,  422,  196,  196,  196,  196,  196,  460,  460,  196,
  55. X      196,  423,  424,  425,  196,  433,  196,  196,  432,  196,
  56. X      426,  427,  437,  430,  196,  196,  429,  428,  196,  434,
  57. X      431,  435,  436,  442,  438,  446,  447,  196,  441,  439,
  58. X      440,  443,  444,  445,  484,  448,  372,  372,  372,  372,
  59. X      372,  372,  375,  375,  375,  375,  375,  375,  483,  486,
  60. X      196,  196,  485,  196,  487,  196,  488,  490,  489,  196,
  61. X
  62. X      196,  491,  196,  196,  196,  196,  196,  196,  196,  196,
  63. X      196,  196,  196,  492,  196,  196,  196,  196,  196,  196,
  64. X      196,  196,  196,  196,  196,  497,  196,  196,  196,  196,
  65. X      196,  196,  196,  196,  499,  196,  196,  493,  196,  495,
  66. X      494,  500,  498,  496,  501,  502,  504,  507,  510,  511,
  67. X      196,  503,  509,  512,  505,  508,  196,  506,  515,  518,
  68. X      514,  196,  543,  513,  542,  541,  544,  516,  517,  545,
  69. X      548,  547,  549,  546,  196,  196,  551,  550,  196,  196,
  70. X      196,  552,  556,  196,  553,  196,  555,  196,  196,  196,
  71. X      554,  196,  196,  196,  196,  196,  196,  196,  196,  196,
  72. X
  73. X      196,  196,  196,  196,  196,  196,  196,  196,  196,  557,
  74. X      559,  196,  196,  561,  196,  560,  196,  196,  558,  196,
  75. X      196,  564,  563,  567,  565,  196,  196,  196,  581,  562,
  76. X      584,  196,  566,  568,  601,  582,  585,  587,  588,  579,
  77. X      589,  580,  583,  590,  598,  586,  591,  592,  602,  196,
  78. X      196,  599,  604,  196,  196,  605,  597,  596,  600,  595,
  79. X      606,  603,  607,   67,   67,   67,   67,   67,   67,   67,
  80. X       67,   67,   72,   72,   72,   72,   72,   72,   72,   72,
  81. X       72,   76,   76,   76,   76,   76,   76,   76,   76,   76,
  82. X       81,   81,   81,   81,   81,   81,   81,   81,   81,  125,
  83. X
  84. X      125,  125,  125,  125,  125,  125,  125,  148,  148,  148,
  85. X      148,  191,  191,  191,  191,  191,  191,  191,  191,  191,
  86. X      193,  193,  193,  193,  193,  193,  193,  193,  193,  196,
  87. X      594,  196,  196,  196,  196,  201,  593,  201,  201,  201,
  88. X      201,  257,  196,  257,  257,  196,  196,  257,  270,  270,
  89. X      370,  370,  462,  462,  462,  196,  196,  196,  196,  196,
  90. X      196,  196,  196,  196,  196,  196,  578,  577,  576,  575,
  91. X      574,  573,  572,  571,  570,  569,  196,  196,  196,  196,
  92. X      196,  196,  196,  196,  540,  539,  538,  537,  536,  535,
  93. X      534,  533,  532,  531,  530,  529,  528,  527,  461,  368,
  94. X
  95. X      526,  525,  524,  523,  522,  521,  520,  519,  196,  196,
  96. X      196,  196,  196,  196,  196,  196,  196,  482,  481,  480,
  97. X      479,  478,  477,  476,  475,  474,  473,  472,  471,  470,
  98. X      469,  468,  467,  466,  465,  464,  463,  461,  459,  458,
  99. X      457,  456,  455,  454,  453,  452,  451,  450,  449,  196,
  100. X      196,  196,  196,  196,  196,  404,  403,  402,  401,  400,
  101. X      399,  398,  397,  396,  395,  394,  393,  392,  391,  390,
  102. X      389,  388,  387,  386,  385,  384,  383,  380,  379,  378,
  103. X      377,  367,  367,  366,  365,  364,  363,  360,  359,  356,
  104. X      196,  196,  304,  194,  192,  303,  302,  301,  296,  295,
  105. X
  106. X      290,  287,  286,  285,  284,  283,  282,  281,  280,  279,
  107. X      278,  277,  276,  275,  274,  273,  126,  272,  271,  261,
  108. X      256,  255,  254,  253,  246,  196,  200,  194,  192,  189,
  109. X      177,  176,  175,  174,  169,  168,  165,  154,  153,  152,
  110. X      151,  145,  127,  126,  122,  114,  113,  608,   13,  608,
  111. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  112. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  113. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  114. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  115. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  116. X
  117. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  118. X      608,  608,  608,  608,  608,  608,  608
  119. X    } ;
  120. X
  121. static const short int yy_chk[1218] =
  122. X    {   0,
  123. X        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  124. X        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  125. X        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  126. X        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  127. X        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  128. X        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  129. X        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  130. X       31,    2,  607,    3,    4,    4,  606,    4,  100,    4,
  131. X        5,    5,   31,    5,    6,    6,    2,    6,   15,    7,
  132. X        7,   15,    7,    5,    7,    8,    8,    6,    8,   22,
  133. X
  134. X        8,   27,    9,    9,    3,    9,   10,   10,   29,   10,
  135. X        4,   41,   27,    7,  100,   22,   41,   29,   29,    8,
  136. X       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
  137. X       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
  138. X       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
  139. X       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
  140. X       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
  141. X       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
  142. X       11,   11,   11,   11,   11,   11,   11,   11,   12,   20,
  143. X       62,   12,   20,   30,  103,   30,   30,   30,   36,   36,
  144. X
  145. X       66,   33,   48,   33,   33,   33,   12,   38,   38,   48,
  146. X       49,   50,   66,   50,   33,   48,   97,   33,   33,   49,
  147. X       51,   53,   50,   51,   56,   56,  103,   33,   53,   62,
  148. X      103,   20,   20,   33,   56,  251,   20,   56,   20,   92,
  149. X       63,   33,   20,   63,  251,   71,   20,   32,   71,   32,
  150. X       32,   32,   65,   73,   70,   65,   73,   99,   63,   70,
  151. X       32,   97,   77,   32,   32,   77,   82,   85,   91,   82,
  152. X       65,   95,   93,   32,   86,   98,   85,   85,   86,   32,
  153. X       86,   86,   86,   87,   94,   70,   92,   32,   87,   70,
  154. X       32,  101,   90,   70,   90,   87,  107,   90,   96,  102,
  155. X
  156. X       70,  175,   99,   70,   93,   70,  106,   70,  104,  175,
  157. X       91,   93,   98,   95,   93,   95,   91,   93,   91,   98,
  158. X       94,  111,  105,  108,   95,  112,  111,  171,  112,   94,
  159. X      242,  115,  118,  111,  115,  242,  107,  101,   94,  118,
  160. X       96,  107,  101,   96,  171,   96,  102,  104,  104,  102,
  161. X      106,  202,  109,  110,  126,  109,  110,  104,  205,  605,
  162. X      104,  105,  108,  126,  126,  187,  169,  172,  187,  105,
  163. X      109,  110,  188,  115,  115,  188,  105,  169,  115,  203,
  164. X      115,  117,  172,  117,  115,  176,  117,  176,  115,  134,
  165. X      134,  134,  117,  202,  205,  204,  137,  137,  137,  180,
  166. X
  167. X      134,  134,  180,  134,  126,  207,  182,  137,  137,  182,
  168. X      137,  206,  190,  134,  134,  190,  211,  180,  214,  134,
  169. X      137,  137,  203,  209,  182,  138,  137,  138,  138,  138,
  170. X      139,  208,  139,  139,  139,  210,  195,  207,  138,  195,
  171. X      212,  138,  138,  139,  204,  213,  139,  139,  140,  215,
  172. X      140,  138,  216,  140,  140,  140,  139,  138,  217,  206,
  173. X      206,  218,  139,  208,  219,  138,  211,  209,  214,  221,
  174. X      139,  222,  210,  223,  224,  227,  225,  210,  231,  226,
  175. X      228,  230,  232,  215,  212,  229,  235,  233,  234,  236,
  176. X      237,  240,  238,  213,  244,  277,  277,  216,  215,  244,
  177. X
  178. X      604,  218,  239,  241,  243,  217,  241,  243,  227,  247,
  179. X      224,  221,  225,  219,  232,  222,  231,  247,  221,  226,
  180. X      228,  241,  243,  229,  226,  223,  230,  233,  234,  232,
  181. X      237,  240,  229,  231,  229,  236,  259,  307,  237,  238,
  182. X      235,  311,  239,  312,  239,  259,  259,  262,  309,  262,
  183. X      313,  308,  262,  262,  262,  264,  264,  264,  265,  310,
  184. X      265,  315,  314,  265,  265,  265,  264,  264,  316,  264,
  185. X      268,  268,  268,  269,  269,  269,  270,  270,  317,  264,
  186. X      264,  318,  307,  308,  309,  264,  319,  320,  311,  321,
  187. X      322,  312,  270,  310,  314,  324,  325,  315,  313,  313,
  188. X
  189. X      270,  316,  326,  330,  331,  328,  332,  333,  336,  338,
  190. X      317,  334,  335,  337,  339,  342,  341,  318,  340,  343,
  191. X      345,  344,  322,  320,  350,  321,  348,  347,  369,  319,
  192. X      351,  324,  349,  353,  352,  408,  603,  369,  369,  601,
  193. X      411,  325,  326,  328,  410,  337,  413,  406,  336,  414,
  194. X      330,  331,  341,  334,  412,  415,  333,  332,  416,  338,
  195. X      335,  339,  340,  347,  342,  351,  352,  419,  345,  343,
  196. X      344,  348,  349,  350,  408,  353,  371,  371,  371,  372,
  197. X      372,  372,  374,  374,  374,  375,  375,  375,  406,  411,
  198. X      420,  421,  410,  426,  412,  422,  413,  415,  414,  424,
  199. X
  200. X      427,  416,  428,  432,  430,  429,  433,  434,  435,  431,
  201. X      437,  436,  438,  419,  439,  440,  443,  445,  442,  447,
  202. X      444,  487,  488,  448,  492,  426,  489,  493,  497,  491,
  203. X      490,  498,  499,  503,  428,  495,  496,  420,  502,  422,
  204. X      421,  429,  427,  424,  430,  431,  433,  436,  439,  440,
  205. X      500,  432,  438,  442,  434,  437,  501,  435,  444,  448,
  206. X      443,  504,  489,  442,  488,  487,  490,  445,  447,  491,
  207. X      495,  493,  496,  492,  505,  507,  498,  497,  508,  509,
  208. X      510,  499,  503,  511,  500,  512,  502,  513,  515,  541,
  209. X      501,  516,  542,  517,  545,  546,  553,  550,  551,  584,
  210. X
  211. X      552,  556,  557,  564,  567,  568,  582,  566,  579,  504,
  212. X      507,  583,  586,  509,  587,  508,  599,  590,  505,  592,
  213. X      600,  512,  511,  516,  513,  598,  591,  602,  545,  510,
  214. X      551,  589,  515,  517,  584,  546,  552,  556,  557,  541,
  215. X      564,  542,  550,  566,  579,  553,  567,  568,  586,  588,
  216. X      585,  582,  590,  581,  580,  592,  578,  577,  583,  575,
  217. X      599,  587,  602,  609,  609,  609,  609,  609,  609,  609,
  218. X      609,  609,  610,  610,  610,  610,  610,  610,  610,  610,
  219. X      610,  611,  611,  611,  611,  611,  611,  611,  611,  611,
  220. X      612,  612,  612,  612,  612,  612,  612,  612,  612,  613,
  221. X
  222. X      613,  613,  613,  613,  613,  613,  613,  614,  614,  614,
  223. X      614,  615,  615,  615,  615,  615,  615,  615,  615,  615,
  224. X      616,  616,  616,  616,  616,  616,  616,  616,  616,  617,
  225. X      573,  617,  617,  617,  617,  618,  571,  618,  618,  618,
  226. X      618,  619,  565,  619,  619,  563,  562,  619,  620,  620,
  227. X      621,  621,  622,  622,  622,  561,  560,  559,  558,  555,
  228. X      554,  549,  548,  547,  544,  543,  540,  539,  538,  531,
  229. X      528,  527,  525,  524,  523,  519,  518,  514,  506,  494,
  230. X      486,  485,  484,  483,  481,  480,  478,  477,  476,  475,
  231. X      474,  473,  471,  470,  468,  467,  466,  465,  462,  460,
  232. X
  233. X      459,  458,  456,  455,  454,  453,  452,  449,  446,  441,
  234. X      425,  423,  418,  417,  409,  407,  405,  404,  403,  401,
  235. X      400,  399,  398,  397,  396,  395,  394,  393,  392,  391,
  236. X      388,  387,  384,  383,  382,  381,  378,  370,  366,  365,
  237. X      364,  363,  362,  361,  360,  359,  358,  357,  356,  346,
  238. X      329,  327,  323,  306,  305,  301,  300,  299,  298,  297,
  239. X      296,  295,  294,  293,  292,  291,  290,  289,  288,  287,
  240. X      285,  283,  282,  281,  280,  279,  278,  276,  275,  274,
  241. X      273,  258,  257,  255,  254,  253,  252,  249,  248,  246,
  242. X      220,  201,  197,  193,  191,  183,  181,  177,  174,  173,
  243. X
  244. X      170,  168,  167,  165,  164,  163,  162,  161,  160,  159,
  245. X      158,  157,  156,  155,  154,  153,  150,  147,  143,  133,
  246. X      125,  121,  120,  119,  116,   89,   88,   80,   79,   75,
  247. X       60,   59,   58,   57,   55,   54,   52,   47,   46,   45,
  248. X       43,   37,   26,   23,   21,   18,   17,   13,  608,  608,
  249. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  250. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  251. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  252. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  253. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  254. X
  255. X      608,  608,  608,  608,  608,  608,  608,  608,  608,  608,
  256. X      608,  608,  608,  608,  608,  608,  608
  257. X    } ;
  258. X
  259. static yy_state_type yy_last_accepting_state;
  260. static YY_CHAR *yy_last_accepting_cpos;
  261. X
  262. /* the intent behind this definition is that it'll catch
  263. X * any uses of REJECT which flex missed
  264. X */
  265. #define REJECT reject_used_but_not_detected
  266. #define yymore() yymore_used_but_not_detected
  267. #define YY_MORE_ADJ 0
  268. X
  269. /* these variables are all declared out here so that section 3 code can
  270. X * manipulate them
  271. X */
  272. /* points to current character in buffer */
  273. static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
  274. static int yy_init = 1;        /* whether we need to initialize */
  275. static int yy_start = 0;    /* start state number */
  276. X
  277. /* flag which is used to allow yywrap()'s to do buffer switches
  278. X * instead of setting up a fresh yyin.  A bit of a hack ...
  279. X */
  280. static int yy_did_buffer_switch_on_eof;
  281. X
  282. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  283. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  284. static int yy_get_next_buffer YY_PROTO(( void ));
  285. static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
  286. void yyrestart YY_PROTO(( FILE *input_file ));
  287. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  288. void yy_load_buffer_state YY_PROTO(( void ));
  289. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  290. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  291. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  292. X
  293. #define yy_new_buffer yy_create_buffer
  294. X
  295. #ifdef __cplusplus
  296. static int yyinput YY_PROTO(( void ));
  297. #else
  298. static int input YY_PROTO(( void ));
  299. #endif
  300. X
  301. YY_DECL
  302. X    {
  303. X    register yy_state_type yy_current_state;
  304. X    register YY_CHAR *yy_cp, *yy_bp;
  305. X    register int yy_act;
  306. X
  307. X
  308. X
  309. X            INIT;
  310. X
  311. X
  312. X    if ( yy_init )
  313. X    {
  314. X    YY_USER_INIT;
  315. X
  316. X    if ( ! yy_start )
  317. X        yy_start = 1;    /* first start state */
  318. X
  319. X    if ( ! yyin )
  320. X        yyin = stdin;
  321. X
  322. X    if ( ! yyout )
  323. X        yyout = stdout;
  324. X
  325. X    if ( yy_current_buffer )
  326. X        yy_init_buffer( yy_current_buffer, yyin );
  327. X    else
  328. X        yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  329. X
  330. X    yy_load_buffer_state();
  331. X
  332. X    yy_init = 0;
  333. X    }
  334. X
  335. X    while ( 1 )        /* loops until end-of-file is reached */
  336. X    {
  337. X    yy_cp = yy_c_buf_p;
  338. X
  339. X    /* support of yytext */
  340. X    *yy_cp = yy_hold_char;
  341. X
  342. X    /* yy_bp points to the position in yy_ch_buf of the start of the
  343. X     * current run.
  344. X     */
  345. X    yy_bp = yy_cp;
  346. X
  347. X    yy_current_state = yy_start;
  348. X    if ( yy_bp[-1] == '\n' )
  349. X        ++yy_current_state;
  350. yy_match:
  351. X    do
  352. X        {
  353. X        register YY_CHAR yy_c = yy_ec[*yy_cp];
  354. X        if ( yy_accept[yy_current_state] )
  355. X        {
  356. X        yy_last_accepting_state = yy_current_state;
  357. X        yy_last_accepting_cpos = yy_cp;
  358. X        }
  359. X        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  360. X        {
  361. X        yy_current_state = yy_def[yy_current_state];
  362. X        if ( yy_current_state >= 609 )
  363. X            yy_c = yy_meta[yy_c];
  364. X        }
  365. X        yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  366. X        ++yy_cp;
  367. X        }
  368. X    while ( yy_current_state != 608 );
  369. X    yy_cp = yy_last_accepting_cpos;
  370. X    yy_current_state = yy_last_accepting_state;
  371. X
  372. yy_find_action:
  373. X    yy_act = yy_accept[yy_current_state];
  374. X
  375. X    YY_DO_BEFORE_ACTION;
  376. X    YY_USER_ACTION;
  377. X
  378. do_action:    /* this label is used only to access EOF actions */
  379. X
  380. X
  381. X    switch ( yy_act )
  382. X        {
  383. X        case 0: /* must backtrack */
  384. X        /* undo the effects of YY_DO_BEFORE_ACTION */
  385. X        *yy_cp = yy_hold_char;
  386. X        yy_cp = yy_last_accepting_cpos;
  387. X        yy_current_state = yy_last_accepting_state;
  388. X        goto yy_find_action;
  389. X
  390. case 1:
  391. # line 109 "c++2latex.l"
  392. { CPP; BEGIN (INCLUDE); }
  393. X    YY_BREAK
  394. case 2:
  395. # line 111 "c++2latex.l"
  396. case 3:
  397. # line 112 "c++2latex.l"
  398. case 4:
  399. # line 113 "c++2latex.l"
  400. case 5:
  401. # line 114 "c++2latex.l"
  402. case 6:
  403. # line 115 "c++2latex.l"
  404. case 7:
  405. # line 116 "c++2latex.l"
  406. case 8:
  407. # line 117 "c++2latex.l"
  408. case 9:
  409. # line 118 "c++2latex.l"
  410. case 10:
  411. # line 119 "c++2latex.l"
  412. case 11:
  413. # line 120 "c++2latex.l"
  414. case 12:
  415. # line 121 "c++2latex.l"
  416. case 13:
  417. # line 121 "c++2latex.l"
  418. CPP;
  419. X    YY_BREAK
  420. case 14:
  421. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  422. yy_c_buf_p = yy_cp -= 1;
  423. YY_DO_BEFORE_ACTION; /* set up yytext again */
  424. # line 124 "c++2latex.l"
  425. { OUT ("$<$"); FONT (string_font);
  426. X              SUB (yytext+1); OUT ("}$>$");
  427. X              input(); INIT; }
  428. X    YY_BREAK
  429. case 15:
  430. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
  431. yy_c_buf_p = yy_cp -= 1;
  432. YY_DO_BEFORE_ACTION; /* set up yytext again */
  433. # line 127 "c++2latex.l"
  434. { OUT ("\""); FONT (string_font);
  435. X              SUB (yytext+1); OUT ("}\"");
  436. X              input(); INIT; }
  437. X    YY_BREAK
  438. case 16:
  439. # line 130 "c++2latex.l"
  440. ECHO;
  441. X    YY_BREAK
  442. case 17:
  443. # line 131 "c++2latex.l"
  444. OUT ("\\mbox{}\\\\\n");
  445. X    YY_BREAK
  446. case 18:
  447. # line 132 "c++2latex.l"
  448. { REPARSE; INIT; }
  449. X    YY_BREAK
  450. case 19:
  451. # line 135 "c++2latex.l"
  452. case 20:
  453. # line 136 "c++2latex.l"
  454. case 21:
  455. # line 137 "c++2latex.l"
  456. case 22:
  457. # line 138 "c++2latex.l"
  458. case 23:
  459. # line 139 "c++2latex.l"
  460. case 24:
  461. # line 140 "c++2latex.l"
  462. case 25:
  463. # line 141 "c++2latex.l"
  464. case 26:
  465. # line 142 "c++2latex.l"
  466. case 27:
  467. # line 143 "c++2latex.l"
  468. case 28:
  469. # line 144 "c++2latex.l"
  470. case 29:
  471. # line 145 "c++2latex.l"
  472. case 30:
  473. # line 146 "c++2latex.l"
  474. case 31:
  475. # line 147 "c++2latex.l"
  476. case 32:
  477. # line 148 "c++2latex.l"
  478. case 33:
  479. # line 149 "c++2latex.l"
  480. case 34:
  481. # line 150 "c++2latex.l"
  482. case 35:
  483. # line 151 "c++2latex.l"
  484. case 36:
  485. # line 152 "c++2latex.l"
  486. case 37:
  487. # line 153 "c++2latex.l"
  488. case 38:
  489. # line 154 "c++2latex.l"
  490. case 39:
  491. # line 155 "c++2latex.l"
  492. case 40:
  493. # line 156 "c++2latex.l"
  494. case 41:
  495. # line 157 "c++2latex.l"
  496. case 42:
  497. # line 158 "c++2latex.l"
  498. case 43:
  499. # line 159 "c++2latex.l"
  500. case 44:
  501. # line 160 "c++2latex.l"
  502. case 45:
  503. # line 161 "c++2latex.l"
  504. case 46:
  505. # line 162 "c++2latex.l"
  506. case 47:
  507. # line 163 "c++2latex.l"
  508. case 48:
  509. # line 164 "c++2latex.l"
  510. case 49:
  511. # line 165 "c++2latex.l"
  512. case 50:
  513. # line 166 "c++2latex.l"
  514. case 51:
  515. # line 167 "c++2latex.l"
  516. case 52:
  517. # line 168 "c++2latex.l"
  518. case 53:
  519. # line 169 "c++2latex.l"
  520. case 54:
  521. # line 170 "c++2latex.l"
  522. case 55:
  523. # line 171 "c++2latex.l"
  524. case 56:
  525. # line 172 "c++2latex.l"
  526. case 57:
  527. # line 173 "c++2latex.l"
  528. case 58:
  529. # line 174 "c++2latex.l"
  530. case 59:
  531. # line 175 "c++2latex.l"
  532. case 60:
  533. # line 176 "c++2latex.l"
  534. case 61:
  535. # line 177 "c++2latex.l"
  536. case 62:
  537. # line 178 "c++2latex.l"
  538. case 63:
  539. # line 179 "c++2latex.l"
  540. case 64:
  541. # line 180 "c++2latex.l"
  542. case 65:
  543. # line 181 "c++2latex.l"
  544. case 66:
  545. # line 182 "c++2latex.l"
  546. case 67:
  547. # line 183 "c++2latex.l"
  548. case 68:
  549. # line 184 "c++2latex.l"
  550. case 69:
  551. # line 185 "c++2latex.l"
  552. case 70:
  553. # line 186 "c++2latex.l"
  554. case 71:
  555. # line 187 "c++2latex.l"
  556. case 72:
  557. # line 188 "c++2latex.l"
  558. case 73:
  559. # line 188 "c++2latex.l"
  560. KEY;
  561. X    YY_BREAK
  562. case 74:
  563. # line 189 "c++2latex.l"
  564. SYM ("rightarrow");
  565. X    YY_BREAK
  566. case 75:
  567. # line 190 "c++2latex.l"
  568. SYM ("ll");
  569. X    YY_BREAK
  570. case 76:
  571. # line 191 "c++2latex.l"
  572. SYM ("gg");
  573. X    YY_BREAK
  574. case 77:
  575. # line 192 "c++2latex.l"
  576. SYM ("leq");
  577. X    YY_BREAK
  578. case 78:
  579. # line 193 "c++2latex.l"
  580. SYM ("geq");
  581. X    YY_BREAK
  582. case 79:
  583. # line 194 "c++2latex.l"
  584. SYM ("neq");
  585. X    YY_BREAK
  586. case 80:
  587. # line 195 "c++2latex.l"
  588. SYM ("mid\\mid");
  589. X    YY_BREAK
  590. case 81:
  591. # line 196 "c++2latex.l"
  592. SYM ("ldots");
  593. X    YY_BREAK
  594. case 82:
  595. # line 197 "c++2latex.l"
  596. SYM ("ast=");
  597. X    YY_BREAK
  598. case 83:
  599. # line 198 "c++2latex.l"
  600. SYM ("ll=");
  601. X    YY_BREAK
  602. case 84:
  603. # line 199 "c++2latex.l"
  604. SYM ("gg=");
  605. X    YY_BREAK
  606. case 85:
  607. # line 200 "c++2latex.l"
  608. SYM ("vee=");
  609. X    YY_BREAK
  610. case 86:
  611. # line 201 "c++2latex.l"
  612. SYM ("mid=");
  613. X    YY_BREAK
  614. case 87:
  615. # line 202 "c++2latex.l"
  616. SYM ("sim");
  617. X    YY_BREAK
  618. case 88:
  619. # line 203 "c++2latex.l"
  620. SYM ("ast");
  621. X    YY_BREAK
  622. case 89:
  623. # line 204 "c++2latex.l"
  624. SYM ("wedge");
  625. X    YY_BREAK
  626. case 90:
  627. # line 205 "c++2latex.l"
  628. SYM ("mid");
  629. X    YY_BREAK
  630. case 91:
  631. # line 206 "c++2latex.l"
  632. SYM ("rightarrow\\ast");
  633. X    YY_BREAK
  634. case 92:
  635. # line 207 "c++2latex.l"
  636. OUT ("$/$");
  637. X    YY_BREAK
  638. case 93:
  639. # line 208 "c++2latex.l"
  640. OUT ("$<$");
  641. X    YY_BREAK
  642. case 94:
  643. # line 209 "c++2latex.l"
  644. OUT ("$>$");
  645. X    YY_BREAK
  646. case 95:
  647. # line 210 "c++2latex.l"
  648. OUT ("\\&\\&");
  649. X    YY_BREAK
  650. case 96:
  651. # line 211 "c++2latex.l"
  652. OUT ("\\%=");
  653. X    YY_BREAK
  654. case 97:
  655. # line 212 "c++2latex.l"
  656. OUT ("\\&=");
  657. X    YY_BREAK
  658. case 98:
  659. # line 213 "c++2latex.l"
  660. OUT ("\\{");
  661. X    YY_BREAK
  662. case 99:
  663. # line 214 "c++2latex.l"
  664. OUT ("\\}");
  665. X    YY_BREAK
  666. case 100:
  667. # line 215 "c++2latex.l"
  668. OUT ("\\&");
  669. X    YY_BREAK
  670. case 101:
  671. # line 216 "c++2latex.l"
  672. OUT ("\\%");
  673. X    YY_BREAK
  674. case 102:
  675. # line 217 "c++2latex.l"
  676. OUT ("-{}-");
  677. X    YY_BREAK
  678. case 103:
  679. # line 218 "c++2latex.l"
  680. OUT (".$\\ast$");
  681. X    YY_BREAK
  682. case 104:
  683. # line 220 "c++2latex.l"
  684. case 105:
  685. # line 221 "c++2latex.l"
  686. case 106:
  687. # line 222 "c++2latex.l"
  688. case 107:
  689. # line 223 "c++2latex.l"
  690. case 108:
  691. # line 224 "c++2latex.l"
  692. case 109:
  693. # line 225 "c++2latex.l"
  694. case 110:
  695. # line 226 "c++2latex.l"
  696. case 111:
  697. # line 227 "c++2latex.l"
  698. case 112:
  699. # line 228 "c++2latex.l"
  700. case 113:
  701. # line 229 "c++2latex.l"
  702. case 114:
  703. # line 230 "c++2latex.l"
  704. case 115:
  705. # line 231 "c++2latex.l"
  706. case 116:
  707. # line 232 "c++2latex.l"
  708. case 117:
  709. # line 233 "c++2latex.l"
  710. case 118:
  711. # line 234 "c++2latex.l"
  712. case 119:
  713. # line 235 "c++2latex.l"
  714. case 120:
  715. # line 236 "c++2latex.l"
  716. case 121:
  717. # line 237 "c++2latex.l"
  718. case 122:
  719. # line 237 "c++2latex.l"
  720. ECHO;
  721. X    YY_BREAK
  722. case 123:
  723. # line 240 "c++2latex.l"
  724. case 124:
  725. # line 240 "c++2latex.l"
  726. SUB (yytext);
  727. X    YY_BREAK
  728. X /*    1.   Asterisk comments mini scanner */
  729. X /*    1.1. Curly  brace comment */
  730. case 125:
  731. # line 244 "c++2latex.l"
  732. { BEGIN (BCOMMENT);
  733. X                                OUT ("\\}");
  734. X                                BTAB;
  735. X                                FONT (comment_font);
  736. X                                OUT ("/$\\ast$"); }
  737. X    YY_BREAK
  738. X /*    1.2. Comments at the beginning of a line */
  739. case 126:
  740. # line 251 "c++2latex.l"
  741. { BEGIN (BCOMMENT);
  742. X                FONT (comment_font);
  743. X                                REPARSE; }
  744. X    YY_BREAK
  745. X /*    1.3. Other comments, aligned to right side of paper */
  746. case 127:
  747. # line 256 "c++2latex.l"
  748. { BEGIN (BCOMMENT);
  749. X                                if (aligntoright) {
  750. X                    OUT ("\\hfill");
  751. X                } else {
  752. X                    CTAB;
  753. X                }
  754. X                FONT (comment_font);
  755. X                                OUT ("/$\\ast$"); }
  756. X    YY_BREAK
  757. case 128:
  758. # line 265 "c++2latex.l"
  759. { INIT; OUT ("$\\ast$/}"); }
  760. X    YY_BREAK
  761. case 129:
  762. # line 266 "c++2latex.l"
  763. OUT ("\\mbox{}\\\\\n");
  764. X    YY_BREAK
  765. case 130:
  766. # line 267 "c++2latex.l"
  767. IND;
  768. X    YY_BREAK
  769. case 131:
  770. # line 268 "c++2latex.l"
  771. SUB (yytext);
  772. X    YY_BREAK
  773. X /*    2.   Double slash ``//'' comments mini scanner */
  774. X /*    2.1. Curly brace comment */
  775. case 132:
  776. # line 272 "c++2latex.l"
  777. { BEGIN (SLASHCOMMENT);
  778. X                                OUT ("\\}");
  779. X                                BTAB;
  780. X                FONT (comment_font);
  781. X                                OUT ("//");}
  782. X    YY_BREAK
  783. X /*    2.2. Complete line comment */
  784. case 133:
  785. # line 279 "c++2latex.l"
  786. { BEGIN (SLASHCOMMENT);
  787. X                                FONT (comment_font);
  788. X                REPARSE; }
  789. X    YY_BREAK
  790. X /*    2.3. Other comments */
  791. case 134:
  792. # line 284 "c++2latex.l"
  793. { BEGIN (SLASHCOMMENT);
  794. X                                if (aligntoright) {
  795. X                    OUT ("\\hfill");
  796. X                } else {
  797. X                    CTAB;
  798. X                }
  799. X                FONT (comment_font);
  800. X                                OUT ("//"); }
  801. X    YY_BREAK
  802. case 135:
  803. # line 293 "c++2latex.l"
  804. { INIT; OUT ("}\\mbox{}\\\\\n"); }
  805. X    YY_BREAK
  806. case 136:
  807. # line 294 "c++2latex.l"
  808. IND;
  809. X    YY_BREAK
  810. case 137:
  811. # line 295 "c++2latex.l"
  812. SUB (yytext);
  813. X    YY_BREAK
  814. case 138:
  815. # line 298 "c++2latex.l"
  816. { BEGIN (STRING);
  817. X                FONT (string_font); OUT ("\""); }
  818. X    YY_BREAK
  819. case 139:
  820. # line 300 "c++2latex.l"
  821. OUT ("$\\backslash\\backslash$");
  822. X    YY_BREAK
  823. case 140:
  824. # line 301 "c++2latex.l"
  825. { OUT ("$\\backslash$"); SUB (yytext+1); }
  826. X    YY_BREAK
  827. case 141:
  828. # line 302 "c++2latex.l"
  829. { INIT; OUT ("\"}"); }
  830. X    YY_BREAK
  831. case 142:
  832. # line 303 "c++2latex.l"
  833. OUT ("\\mbox{}\\\\\n");
  834. X    YY_BREAK
  835. case 143:
  836. # line 304 "c++2latex.l"
  837. IND;
  838. X    YY_BREAK
  839. case 144:
  840. # line 305 "c++2latex.l"
  841. SUB (yytext);
  842. X    YY_BREAK
  843. case 145:
  844. # line 308 "c++2latex.l"
  845. case 146:
  846. # line 309 "c++2latex.l"
  847. case 147:
  848. # line 310 "c++2latex.l"
  849. case 148:
  850. # line 310 "c++2latex.l"
  851. ECHO;
  852. X    YY_BREAK
  853. case 149:
  854. # line 312 "c++2latex.l"
  855. ECHO;
  856. X    YY_BREAK
  857. case 150:
  858. # line 315 "c++2latex.l"
  859. case 151:
  860. # line 316 "c++2latex.l"
  861. case 152:
  862. # line 317 "c++2latex.l"
  863. case 153:
  864. # line 317 "c++2latex.l"
  865. SUB (yytext);
  866. X    YY_BREAK
  867. case 154:
  868. # line 319 "c++2latex.l"
  869. ECHO;
  870. X    YY_BREAK
  871. case 155:
  872. # line 321 "c++2latex.l"
  873. ECHO;
  874. X    YY_BREAK
  875. case 156:
  876. # line 323 "c++2latex.l"
  877. OUT ("$\\backslash$\\\\\n");
  878. X    YY_BREAK
  879. case 157:
  880. # line 324 "c++2latex.l"
  881. IND;
  882. X    YY_BREAK
  883. case 158:
  884. # line 325 "c++2latex.l"
  885. ECHO;
  886. X    YY_BREAK
  887. case 159:
  888. # line 326 "c++2latex.l"
  889. OUT ("\\newpage\n");
  890. X    YY_BREAK
  891. case 160:
  892. # line 327 "c++2latex.l"
  893. OUT ("\\mbox{}\\\\\n");
  894. X    YY_BREAK
  895. case 161:
  896. # line 329 "c++2latex.l"
  897. ECHO;
  898. X    YY_BREAK
  899. case YY_STATE_EOF(INITIAL):
  900. case YY_STATE_EOF(STRING):
  901. case YY_STATE_EOF(BCOMMENT):
  902. case YY_STATE_EOF(INCLUDE):
  903. case YY_STATE_EOF(SLASHCOMMENT):
  904. case YY_STATE_EOF(CPLUSPLUS):
  905. X    yyterminate();
  906. X
  907. X        case YY_END_OF_BUFFER:
  908. X        {
  909. X        /* amount of text matched not including the EOB char */
  910. X        int yy_amount_of_matched_text = yy_cp - yytext - 1;
  911. X
  912. X        /* undo the effects of YY_DO_BEFORE_ACTION */
  913. X        *yy_cp = yy_hold_char;
  914. X
  915. X        /* note that here we test for yy_c_buf_p "<=" to the position
  916. X         * of the first EOB in the buffer, since yy_c_buf_p will
  917. X         * already have been incremented past the NUL character
  918. X         * (since all states make transitions on EOB to the end-
  919. X         * of-buffer state).  Contrast this with the test in yyinput().
  920. X         */
  921. X        if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  922. X            /* this was really a NUL */
  923. X            {
  924. X            yy_state_type yy_next_state;
  925. X
  926. X            yy_c_buf_p = yytext + yy_amount_of_matched_text;
  927. X
  928. X            yy_current_state = yy_get_previous_state();
  929. X
  930. X            /* okay, we're now positioned to make the
  931. X             * NUL transition.  We couldn't have
  932. X             * yy_get_previous_state() go ahead and do it
  933. X             * for us because it doesn't know how to deal
  934. X             * with the possibility of jamming (and we
  935. X             * don't want to build jamming into it because
  936. X             * then it will run more slowly)
  937. X             */
  938. X
  939. X            yy_next_state = yy_try_NUL_trans( yy_current_state );
  940. X
  941. X            yy_bp = yytext + YY_MORE_ADJ;
  942. X
  943. X            if ( yy_next_state )
  944. X            {
  945. X            /* consume the NUL */
  946. X            yy_cp = ++yy_c_buf_p;
  947. X            yy_current_state = yy_next_state;
  948. X            goto yy_match;
  949. X            }
  950. X
  951. X            else
  952. X            {
  953. X                yy_cp = yy_last_accepting_cpos;
  954. X                yy_current_state = yy_last_accepting_state;
  955. X            goto yy_find_action;
  956. X            }
  957. X            }
  958. X
  959. X        else switch ( yy_get_next_buffer() )
  960. X            {
  961. X            case EOB_ACT_END_OF_FILE:
  962. X            {
  963. X            yy_did_buffer_switch_on_eof = 0;
  964. X
  965. X            if ( yywrap() )
  966. X                {
  967. X                /* note: because we've taken care in
  968. X                 * yy_get_next_buffer() to have set up yytext,
  969. X                 * we can now set up yy_c_buf_p so that if some
  970. X                 * total hoser (like flex itself) wants
  971. X                 * to call the scanner after we return the
  972. X                 * YY_NULL, it'll still work - another YY_NULL
  973. X                 * will get returned.
  974. X                 */
  975. X                yy_c_buf_p = yytext + YY_MORE_ADJ;
  976. X
  977. X                yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  978. X                goto do_action;
  979. X                }
  980. X
  981. X            else
  982. X                {
  983. X                if ( ! yy_did_buffer_switch_on_eof )
  984. X                YY_NEW_FILE;
  985. X                }
  986. X            }
  987. X            break;
  988. X
  989. X            case EOB_ACT_CONTINUE_SCAN:
  990. X            yy_c_buf_p = yytext + yy_amount_of_matched_text;
  991. X
  992. X            yy_current_state = yy_get_previous_state();
  993. X
  994. X            yy_cp = yy_c_buf_p;
  995. X            yy_bp = yytext + YY_MORE_ADJ;
  996. X            goto yy_match;
  997. X
  998. X            case EOB_ACT_LAST_MATCH:
  999. X            yy_c_buf_p =
  1000. X                &yy_current_buffer->yy_ch_buf[yy_n_chars];
  1001. X
  1002. X            yy_current_state = yy_get_previous_state();
  1003. X
  1004. X            yy_cp = yy_c_buf_p;
  1005. X            yy_bp = yytext + YY_MORE_ADJ;
  1006. X            goto yy_find_action;
  1007. X            }
  1008. X        break;
  1009. X        }
  1010. X
  1011. X        default:
  1012. #ifdef FLEX_DEBUG
  1013. X        printf( "action # %d\n", yy_act );
  1014. #endif
  1015. X        YY_FATAL_ERROR(
  1016. X            "fatal flex scanner internal error--no action found" );
  1017. X        }
  1018. X    }
  1019. X    }
  1020. X
  1021. X
  1022. /* yy_get_next_buffer - try to read in a new buffer
  1023. X *
  1024. X * synopsis
  1025. X *     int yy_get_next_buffer();
  1026. X *     
  1027. X * returns a code representing an action
  1028. X *     EOB_ACT_LAST_MATCH - 
  1029. X *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1030. X *     EOB_ACT_END_OF_FILE - end of file
  1031. X */
  1032. X
  1033. static int yy_get_next_buffer()
  1034. X
  1035. X    {
  1036. X    register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
  1037. X    register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
  1038. X    register int number_to_move, i;
  1039. X    int ret_val;
  1040. X
  1041. X    if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  1042. X    YY_FATAL_ERROR(
  1043. X        "fatal flex scanner internal error--end of buffer missed" );
  1044. X
  1045. X    /* try to read more data */
  1046. X
  1047. X    /* first move last chars to start of buffer */
  1048. X    number_to_move = yy_c_buf_p - yytext;
  1049. X
  1050. X    for ( i = 0; i < number_to_move; ++i )
  1051. X    *(dest++) = *(source++);
  1052. X
  1053. X    if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  1054. X    /* don't do the read, it's not guaranteed to return an EOF,
  1055. X     * just force an EOF
  1056. X     */
  1057. X    yy_n_chars = 0;
  1058. X
  1059. X    else
  1060. X    {
  1061. X    int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  1062. X
  1063. X    if ( num_to_read > YY_READ_BUF_SIZE )
  1064. X        num_to_read = YY_READ_BUF_SIZE;
  1065. X
  1066. X    else if ( num_to_read <= 0 )
  1067. X        YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  1068. X
  1069. X    /* read in more data */
  1070. X    YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  1071. X          yy_n_chars, num_to_read );
  1072. X    }
  1073. X
  1074. X    if ( yy_n_chars == 0 )
  1075. X    {
  1076. X    if ( number_to_move == 1 )
  1077. X        {
  1078. X        ret_val = EOB_ACT_END_OF_FILE;
  1079. X        yy_current_buffer->yy_eof_status = EOF_DONE;
  1080. X        }
  1081. X
  1082. X    else
  1083. X        {
  1084. X        ret_val = EOB_ACT_LAST_MATCH;
  1085. X        yy_current_buffer->yy_eof_status = EOF_PENDING;
  1086. X        }
  1087. X    }
  1088. X
  1089. X    else
  1090. X    ret_val = EOB_ACT_CONTINUE_SCAN;
  1091. X
  1092. X    yy_n_chars += number_to_move;
  1093. X    yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1094. X    yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1095. X
  1096. X    /* yytext begins at the second character in yy_ch_buf; the first
  1097. X     * character is the one which preceded it before reading in the latest
  1098. X     * buffer; it needs to be kept around in case it's a newline, so
  1099. X     * yy_get_previous_state() will have with '^' rules active
  1100. X     */
  1101. X
  1102. X    yytext = &yy_current_buffer->yy_ch_buf[1];
  1103. X
  1104. X    return ( ret_val );
  1105. X    }
  1106. X
  1107. X
  1108. /* yy_get_previous_state - get the state just before the EOB char was reached
  1109. X *
  1110. X * synopsis
  1111. X *     yy_state_type yy_get_previous_state();
  1112. X */
  1113. X
  1114. static yy_state_type yy_get_previous_state()
  1115. X
  1116. X    {
  1117. X    register yy_state_type yy_current_state;
  1118. X    register YY_CHAR *yy_cp;
  1119. X
  1120. X    register YY_CHAR *yy_bp = yytext;
  1121. X
  1122. X    yy_current_state = yy_start;
  1123. X    if ( yy_bp[-1] == '\n' )
  1124. X    ++yy_current_state;
  1125. X
  1126. X    for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1127. X    {
  1128. X    register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
  1129. X    if ( yy_accept[yy_current_state] )
  1130. X        {
  1131. X        yy_last_accepting_state = yy_current_state;
  1132. X        yy_last_accepting_cpos = yy_cp;
  1133. X        }
  1134. X    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1135. X        {
  1136. X        yy_current_state = yy_def[yy_current_state];
  1137. X        if ( yy_current_state >= 609 )
  1138. X        yy_c = yy_meta[yy_c];
  1139. X        }
  1140. X    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1141. X    }
  1142. X
  1143. X    return ( yy_current_state );
  1144. X    }
  1145. X
  1146. X
  1147. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1148. X *
  1149. X * synopsis
  1150. X *     next_state = yy_try_NUL_trans( current_state );
  1151. X */
  1152. X
  1153. #ifdef YY_USE_PROTOS
  1154. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  1155. #else
  1156. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1157. register yy_state_type yy_current_state;
  1158. #endif
  1159. X
  1160. X    {
  1161. X    register int yy_is_jam;
  1162. X    register YY_CHAR *yy_cp = yy_c_buf_p;
  1163. X
  1164. X    register YY_CHAR yy_c = 1;
  1165. X    if ( yy_accept[yy_current_state] )
  1166. X    {
  1167. X    yy_last_accepting_state = yy_current_state;
  1168. X    yy_last_accepting_cpos = yy_cp;
  1169. X    }
  1170. X    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1171. X    {
  1172. X    yy_current_state = yy_def[yy_current_state];
  1173. X    if ( yy_current_state >= 609 )
  1174. X        yy_c = yy_meta[yy_c];
  1175. X    }
  1176. X    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1177. X    yy_is_jam = (yy_current_state == 608);
  1178. X
  1179. X    return ( yy_is_jam ? 0 : yy_current_state );
  1180. X    }
  1181. X
  1182. X
  1183. #ifdef YY_USE_PROTOS
  1184. static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
  1185. #else
  1186. static void yyunput( c, yy_bp )
  1187. YY_CHAR c;
  1188. register YY_CHAR *yy_bp;
  1189. #endif
  1190. X
  1191. X    {
  1192. X    register YY_CHAR *yy_cp = yy_c_buf_p;
  1193. X
  1194. X    /* undo effects of setting up yytext */
  1195. X    *yy_cp = yy_hold_char;
  1196. X
  1197. X    if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1198. X    { /* need to shift things up to make room */
  1199. X    register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  1200. X    register YY_CHAR *dest =
  1201. X        &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  1202. X    register YY_CHAR *source =
  1203. X        &yy_current_buffer->yy_ch_buf[number_to_move];
  1204. X
  1205. X    while ( source > yy_current_buffer->yy_ch_buf )
  1206. X        *--dest = *--source;
  1207. X
  1208. X    yy_cp += dest - source;
  1209. X    yy_bp += dest - source;
  1210. X    yy_n_chars = yy_current_buffer->yy_buf_size;
  1211. X
  1212. X    if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1213. X        YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1214. X    }
  1215. X
  1216. X    if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  1217. X    yy_cp[-2] = '\n';
  1218. X
  1219. X    *--yy_cp = c;
  1220. X
  1221. X    /* note: the formal parameter *must* be called "yy_bp" for this
  1222. X     *       macro to now work correctly
  1223. X     */
  1224. X    YY_DO_BEFORE_ACTION; /* set up yytext again */
  1225. X    }
  1226. X
  1227. X
  1228. #ifdef __cplusplus
  1229. static int yyinput()
  1230. #else
  1231. static int input()
  1232. #endif
  1233. X
  1234. X    {
  1235. X    int c;
  1236. X    YY_CHAR *yy_cp = yy_c_buf_p;
  1237. X
  1238. X    *yy_cp = yy_hold_char;
  1239. X
  1240. X    if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1241. X    {
  1242. X    /* yy_c_buf_p now points to the character we want to return.
  1243. X     * If this occurs *before* the EOB characters, then it's a
  1244. X     * valid NUL; if not, then we've hit the end of the buffer.
  1245. X     */
  1246. X    if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1247. X        /* this was really a NUL */
  1248. X        *yy_c_buf_p = '\0';
  1249. X
  1250. X    else
  1251. X        { /* need more input */
  1252. X        yytext = yy_c_buf_p;
  1253. X        ++yy_c_buf_p;
  1254. X
  1255. X        switch ( yy_get_next_buffer() )
  1256. X        {
  1257. X        case EOB_ACT_END_OF_FILE:
  1258. X            {
  1259. X            if ( yywrap() )
  1260. X            {
  1261. X            yy_c_buf_p = yytext + YY_MORE_ADJ;
  1262. X            return ( EOF );
  1263. X            }
  1264. X
  1265. X            YY_NEW_FILE;
  1266. X
  1267. #ifdef __cplusplus
  1268. X            return ( yyinput() );
  1269. #else
  1270. X            return ( input() );
  1271. #endif
  1272. X            }
  1273. X            break;
  1274. X
  1275. X        case EOB_ACT_CONTINUE_SCAN:
  1276. X            yy_c_buf_p = yytext + YY_MORE_ADJ;
  1277. X            break;
  1278. X
  1279. X        case EOB_ACT_LAST_MATCH:
  1280. #ifdef __cplusplus
  1281. X            YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  1282. #else
  1283. X            YY_FATAL_ERROR( "unexpected last match in input()" );
  1284. #endif
  1285. X        }
  1286. X        }
  1287. X    }
  1288. X
  1289. X    c = *yy_c_buf_p;
  1290. X    yy_hold_char = *++yy_c_buf_p;
  1291. X
  1292. X    return ( c );
  1293. X    }
  1294. X
  1295. X
  1296. #ifdef YY_USE_PROTOS
  1297. void yyrestart( FILE *input_file )
  1298. #else
  1299. void yyrestart( input_file )
  1300. FILE *input_file;
  1301. #endif
  1302. X
  1303. X    {
  1304. X    yy_init_buffer( yy_current_buffer, input_file );
  1305. X    yy_load_buffer_state();
  1306. X    }
  1307. X
  1308. X
  1309. #ifdef YY_USE_PROTOS
  1310. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1311. #else
  1312. void yy_switch_to_buffer( new_buffer )
  1313. YY_BUFFER_STATE new_buffer;
  1314. #endif
  1315. X
  1316. X    {
  1317. X    if ( yy_current_buffer == new_buffer )
  1318. X    return;
  1319. X
  1320. X    if ( yy_current_buffer )
  1321. X    {
  1322. X    /* flush out information for old buffer */
  1323. X    *yy_c_buf_p = yy_hold_char;
  1324. X    yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1325. X    yy_current_buffer->yy_n_chars = yy_n_chars;
  1326. X    }
  1327. X
  1328. X    yy_current_buffer = new_buffer;
  1329. X    yy_load_buffer_state();
  1330. X
  1331. X    /* we don't actually know whether we did this switch during
  1332. X     * EOF (yywrap()) processing, but the only time this flag
  1333. X     * is looked at is after yywrap() is called, so it's safe
  1334. X     * to go ahead and always set it.
  1335. X     */
  1336. X    yy_did_buffer_switch_on_eof = 1;
  1337. X    }
  1338. X
  1339. X
  1340. #ifdef YY_USE_PROTOS
  1341. void yy_load_buffer_state( void )
  1342. #else
  1343. void yy_load_buffer_state()
  1344. #endif
  1345. X
  1346. X    {
  1347. X    yy_n_chars = yy_current_buffer->yy_n_chars;
  1348. X    yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1349. X    yyin = yy_current_buffer->yy_input_file;
  1350. X    yy_hold_char = *yy_c_buf_p;
  1351. X    }
  1352. X
  1353. X
  1354. #ifdef YY_USE_PROTOS
  1355. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1356. #else
  1357. YY_BUFFER_STATE yy_create_buffer( file, size )
  1358. FILE *file;
  1359. int size;
  1360. #endif
  1361. X
  1362. X    {
  1363. X    YY_BUFFER_STATE b;
  1364. X
  1365. X    b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  1366. X
  1367. X    if ( ! b )
  1368. X    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1369. X
  1370. X    b->yy_buf_size = size;
  1371. X
  1372. X    /* yy_ch_buf has to be 2 characters longer than the size given because
  1373. X     * we need to put in 2 end-of-buffer characters.
  1374. X     */
  1375. X    b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  1376. X
  1377. X    if ( ! b->yy_ch_buf )
  1378. X    YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1379. X
  1380. X    yy_init_buffer( b, file );
  1381. X
  1382. X    return ( b );
  1383. X    }
  1384. X
  1385. X
  1386. #ifdef YY_USE_PROTOS
  1387. void yy_delete_buffer( YY_BUFFER_STATE b )
  1388. #else
  1389. void yy_delete_buffer( b )
  1390. YY_BUFFER_STATE b;
  1391. #endif
  1392. X
  1393. X    {
  1394. X    if ( b == yy_current_buffer )
  1395. X    yy_current_buffer = (YY_BUFFER_STATE) 0;
  1396. X
  1397. X    free( (char *) b->yy_ch_buf );
  1398. X    free( (char *) b );
  1399. X    }
  1400. X
  1401. X
  1402. #ifdef YY_USE_PROTOS
  1403. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1404. #else
  1405. void yy_init_buffer( b, file )
  1406. YY_BUFFER_STATE b;
  1407. FILE *file;
  1408. #endif
  1409. X
  1410. X    {
  1411. X    b->yy_input_file = file;
  1412. X
  1413. X    /* we put in the '\n' and start reading from [1] so that an
  1414. X     * initial match-at-newline will be true.
  1415. X     */
  1416. X
  1417. X    b->yy_ch_buf[0] = '\n';
  1418. X    b->yy_n_chars = 1;
  1419. X
  1420. X    /* we always need two end-of-buffer characters.  The first causes
  1421. X     * a transition to the end-of-buffer state.  The second causes
  1422. X     * a jam in that state.
  1423. X     */
  1424. X    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1425. X    b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1426. X
  1427. X    b->yy_buf_pos = &b->yy_ch_buf[1];
  1428. X
  1429. X    b->yy_eof_status = EOF_NOT_SEEN;
  1430. X    }
  1431. # line 329 "c++2latex.l"
  1432. X
  1433. X
  1434. #include "main.c"
  1435. SHAR_EOF
  1436. echo 'File c++2latex.c is complete' &&
  1437. chmod 0640 c++2latex.c ||
  1438. echo 'restore of c++2latex.c failed'
  1439. Wc_c="`wc -c < 'c++2latex.c'`"
  1440. test 63841 -eq "$Wc_c" ||
  1441.     echo 'c++2latex.c: original size 63841, current size' "$Wc_c"
  1442. rm -f _shar_wnt_.tmp
  1443. fi
  1444. # ============= c++2latex.l ==============
  1445. if test -f 'c++2latex.l' -a X"$1" != X"-c"; then
  1446.     echo 'x - skipping c++2latex.l (File already exists)'
  1447.     rm -f _shar_wnt_.tmp
  1448. else
  1449. > _shar_wnt_.tmp
  1450. echo 'x - extracting c++2latex.l (Text)'
  1451. sed 's/^X//' << 'SHAR_EOF' > 'c++2latex.l' &&
  1452. /*
  1453. X *  This is a flex input file but should be edited in -*-C-*- mode
  1454. X *
  1455. X *  C++2LaTeX: Produce prettyprinted LaTeX files from  C++ or C sources.
  1456. X *  Copyright (C) 1990 Norbert Kiesel
  1457. X *
  1458. X *  This program is free software; you can redistribute it and/or modify
  1459. X *  it under the terms of the GNU General Public License as published by
  1460. X *  the Free Software Foundation; either version 1, or (at your option)
  1461. X *  any later version.
  1462. X *
  1463. X *  This program is distributed in the hope that it will be useful,
  1464. X *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  1465. X *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1466. X *  GNU General Public License for more details.
  1467. X *
  1468. X *  You should have received a copy of the GNU General Public License
  1469. X *  along with this program; if not, write to the Free Software
  1470. X *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1471. X *
  1472. X *  Norbert Kiesel     
  1473. X *  RWTH Aachen / Institut f. Informatik III
  1474. X *  Ahornstr. 55
  1475. X *  D-5100 Aachen
  1476. X *  West Germany  
  1477. X *
  1478. X *  Phone:  +49 241 80-7266
  1479. X *  EUNET:  norbert@rwthi3.uucp
  1480. X *  USENET: ...!mcvax!unido!rwthi3!norbert
  1481. X *  X.400:  norbert@rwthi3.informatik.rwth-aachen.de
  1482. X *
  1483. X *  Please contact me for any bugs you find in this code or any
  1484. X *  improvements! I'd also be very happy to get feedback where and
  1485. X *  how frequently this program is used (just drop a little mail :-).
  1486. X *
  1487. X *  ---------------------------------------------------------------------
  1488. X *
  1489. X *  C++2LaTeX 2.0:
  1490. X *  Produce even more prettyprinted LaTeX files from C++ or C sources.
  1491. X *
  1492. X *  Copyright (C) 1991    Joerg Heitkoetter
  1493. X *  Systems Analysis Group, University of Dortmund, Germany.
  1494. X *  (heitkoet@gorbi.informatik.uni-dortmund.de).
  1495. X *
  1496. X */
  1497. X
  1498. %x STRING BCOMMENT INCLUDE SLASHCOMMENT
  1499. %s CPLUSPLUS
  1500. X
  1501. %{
  1502. #define KEY        printf ("{\\%s %s}", keyword_font, yytext)
  1503. #define CPP        printf ("{\\%s \\%s}", cpp_font, yytext)
  1504. #define SYM(x)        printf ("$\\%s$", x)
  1505. #define OUT(x)        printf ("%s", x)
  1506. #define BTAB        printf ("\\hspace*{%d\\indentation}", tabtobrace)
  1507. #define CTAB        printf ("\\hspace*{%d\\indentation}", tabtocomment)
  1508. #define FONT(x)        printf ("{\\%s ",x);
  1509. #define SUB(x)        substitute(x)
  1510. #define IND        indent(yytext)
  1511. #define INIT        BEGIN (cplusplus_mode ? CPLUSPLUS : INITIAL);
  1512. #define REPARSE        yyless (0)
  1513. X
  1514. #include <stdio.h>
  1515. X
  1516. #ifdef ANSI_C
  1517. X  #ifdef C_PLUSPLUS
  1518. X    #error ANSI_C and C_PLUSPLUS are mutually exclusive
  1519. X  #else
  1520. X    int cplusplus_mode = 0;
  1521. X  #endif
  1522. #else /* CPLUSPLUS or default */
  1523. X  int cplusplus_mode = 1;
  1524. #endif
  1525. X
  1526. int complete_file    = 0;
  1527. int header        = 0;
  1528. int tabtotab        = 8;
  1529. int piped        = 0;
  1530. X
  1531. int aligntoright    = 1;        /* align comments to the right  -joke */
  1532. int tabtobrace        = 2;        /* distance between closing brace and corresponding comment  -joke */
  1533. int tabtocomment    = 4;        /* distance between statement and corresponding comment  -joke */
  1534. X
  1535. char *font_size        = "10";        /* used to be 11  -joke */
  1536. char *indentation    = "0.5em";
  1537. char *comment_font    = "it";
  1538. char *keyword_font    = "bf";
  1539. char *header_font    = "sl";
  1540. char *cpp_font        = "tt";
  1541. char *string_font    = "tt";
  1542. X
  1543. #ifdef __STDC__
  1544. void substitute(const char *);
  1545. void indent(const char *);
  1546. void newpage(int);
  1547. void usage(const char *);
  1548. #else
  1549. void substitute();
  1550. void indent();
  1551. void newpage();
  1552. void usage();
  1553. #endif
  1554. %}
  1555. X
  1556. %%
  1557. X
  1558. X            INIT;
  1559. X
  1560. "#"[ \t]*"include"    { CPP; BEGIN (INCLUDE); }
  1561. "#"[ \t]*"define"    |
  1562. "#"[ \t]*"undef"    |
  1563. "#"[ \t]*"pragma"    |
  1564. "#"[ \t]*"if"        |
  1565. "#"[ \t]*"ifdef"    |
  1566. "#"[ \t]*"ifndef"       |
  1567. "#"[ \t]*"elif"        |
  1568. "#"[ \t]*"else"        |
  1569. "#"[ \t]*"error"    |
  1570. "#"[ \t]*"line"         |        /* added G++ special #line directive  -joke */
  1571. "#"[ \t]*"ex"           |        /* added G++ special #ex directive  -joke */
  1572. "#"[ \t]*"endif"    CPP;
  1573. X
  1574. X
  1575. <INCLUDE>"<"[^>]*/">"    { OUT ("$<$"); FONT (string_font);
  1576. X              SUB (yytext+1); OUT ("}$>$");
  1577. X              input(); INIT; }
  1578. <INCLUDE>\"[^\"]*/\"    { OUT ("\""); FONT (string_font);
  1579. X              SUB (yytext+1); OUT ("}\"");
  1580. X              input(); INIT; }
  1581. <INCLUDE>[ \t]+        ECHO;
  1582. <INCLUDE>[\n]        OUT ("\\mbox{}\\\\\n");
  1583. <INCLUDE>.        { REPARSE; INIT; }
  1584. X
  1585. "auto"            |
  1586. "double"        |
  1587. "int"            |
  1588. "struct"        |
  1589. "break"            |
  1590. "else"            |
  1591. "long"            |
  1592. "switch"        |
  1593. "case"            |
  1594. "enum"            |
  1595. "register"        |
  1596. "typedef"        |
  1597. "char"            |
  1598. "extern"        |
  1599. "return"        |
  1600. "union"            |
  1601. "const"            |
  1602. "float"            |
  1603. "short"            |
  1604. "unsigned"        |
  1605. "continue"        |
  1606. "for"            |
  1607. "signed"        |
  1608. "void"            |
  1609. "default"        |
  1610. "goto"            |
  1611. "sizeof"        |
  1612. "volatile"        |
  1613. "do"            |
  1614. "if"            |
  1615. "static"        |
  1616. "while"            |
  1617. <CPLUSPLUS>"new"    |
  1618. <CPLUSPLUS>"delete"    |
  1619. <CPLUSPLUS>"this"    |
  1620. <CPLUSPLUS>"operator"    |
  1621. <CPLUSPLUS>"class"    |
  1622. <CPLUSPLUS>"public"    |
  1623. <CPLUSPLUS>"protected"    |
  1624. <CPLUSPLUS>"private"    |
  1625. <CPLUSPLUS>"virtual"    |
  1626. <CPLUSPLUS>"friend"    |
  1627. <CPLUSPLUS>"inline"    |
  1628. <CPLUSPLUS>"dynamic"    |        /* added  -joke */
  1629. <CPLUSPLUS>"typeof"    |        /* added  -joke */
  1630. <CPLUSPLUS>"all"    |        /* G++ special added  -joke */
  1631. <CPLUSPLUS>"except"    |        /* G++ special added  -joke */
  1632. <CPLUSPLUS>"exception"    |        /* G++ special added  -joke */
  1633. <CPLUSPLUS>"raise"    |        /* G++ special added  -joke */
  1634. <CPLUSPLUS>"raises"    |        /* G++ special added  -joke */
  1635. <CPLUSPLUS>"reraise"    |        /* G++ special added  -joke */
  1636. <CPLUSPLUS>"try"    |        /* G++ special added  -joke */
  1637. <CPLUSPLUS>"asm"    |        /* added  -joke */
  1638. <CPLUSPLUS>"catch"    |        /* added  -joke */
  1639. <CPLUSPLUS>"overload"    KEY;
  1640. "->"            SYM ("rightarrow");
  1641. "<<"            SYM ("ll");
  1642. ">>"            SYM ("gg");
  1643. "<="            SYM ("leq");
  1644. ">="            SYM ("geq");
  1645. "!="            SYM ("neq");
  1646. "||"            SYM ("mid\\mid");
  1647. "..."            SYM ("ldots");
  1648. "*="            SYM ("ast=");
  1649. "<<="            SYM ("ll=");
  1650. ">>="            SYM ("gg=");
  1651. "^="            SYM ("vee=");
  1652. "|="            SYM ("mid=");
  1653. "~"            SYM ("sim");
  1654. "*"            SYM ("ast");
  1655. "^"            SYM ("wedge");
  1656. "|"            SYM ("mid");
  1657. <CPLUSPLUS>"->*"    SYM ("rightarrow\\ast");
  1658. "/"            OUT ("$/$");
  1659. "<"            OUT ("$<$");
  1660. ">"            OUT ("$>$");
  1661. "&&"            OUT ("\\&\\&");
  1662. "%="            OUT ("\\%=");
  1663. "&="            OUT ("\\&=");
  1664. "{"            OUT ("\\{");
  1665. "}"            OUT ("\\}");
  1666. "&"            OUT ("\\&");
  1667. "%"            OUT ("\\%");
  1668. "--"            OUT ("-{}-");
  1669. <CPLUSPLUS>".*"        OUT (".$\\ast$");
  1670. "?"            |
  1671. ":"            |
  1672. "="            |
  1673. ","            |
  1674. "."            |
  1675. ";"            |
  1676. "!"            |
  1677. "-"            |
  1678. "+"            |
  1679. "/="            |
  1680. "=="            |
  1681. "++"            |
  1682. "+="            |
  1683. "-="            |
  1684. "("            |
  1685. ")"            |
  1686. "["            |
  1687. "]"            |
  1688. <CPLUSPLUS>"::"        ECHO;
  1689. X
  1690. <CPLUSPLUS>[a-zA-Z_$][a-zA-Z_$0-9]*    |
  1691. [a-zA-Z_][a-zA-Z_0-9]*            SUB (yytext);
  1692. X
  1693. X /*    1.   Asterisk comments mini scanner */
  1694. X /*    1.1. Curly  brace comment */
  1695. "}"[ \t]*"/*"                  { BEGIN (BCOMMENT);
  1696. X                                OUT ("\\}");
  1697. X                                BTAB;
  1698. X                                FONT (comment_font);
  1699. X                                OUT ("/$\\ast$"); }
  1700. X
  1701. X /*    1.2. Comments at the beginning of a line */
  1702. ^[ \t]*"/*"              { BEGIN (BCOMMENT);
  1703. X                FONT (comment_font);
  1704. X                                REPARSE; }
  1705. X
  1706. X /*    1.3. Other comments, aligned to right side of paper */
  1707. "/*"                  { BEGIN (BCOMMENT);
  1708. X                                if (aligntoright) {
  1709. X                    OUT ("\\hfill");
  1710. X                } else {
  1711. X                    CTAB;
  1712. X                }
  1713. X                FONT (comment_font);
  1714. X                                OUT ("/$\\ast$"); }
  1715. X
  1716. <BCOMMENT>"*/"              { INIT; OUT ("$\\ast$/}"); }
  1717. <BCOMMENT>"\n"            OUT ("\\mbox{}\\\\\n");
  1718. <BCOMMENT>[ \t]+        IND;
  1719. <BCOMMENT>.            SUB (yytext);
  1720. X
  1721. X /*    2.   Double slash ``//'' comments mini scanner */
  1722. X /*    2.1. Curly brace comment */
  1723. <CPLUSPLUS>}[ \t]*"//"        { BEGIN (SLASHCOMMENT);
  1724. X                                OUT ("\\}");
  1725. X                                BTAB;
  1726. X                FONT (comment_font);
  1727. X                                OUT ("//");}
  1728. X
  1729. X /*    2.2. Complete line comment */
  1730. <CPLUSPLUS>^[ \t]*"//"        { BEGIN (SLASHCOMMENT);
  1731. X                                FONT (comment_font);
  1732. X                REPARSE; }
  1733. X
  1734. X /*    2.3. Other comments */
  1735. <CPLUSPLUS>"//"           { BEGIN (SLASHCOMMENT);
  1736. X                                if (aligntoright) {
  1737. X                    OUT ("\\hfill");
  1738. X                } else {
  1739. X                    CTAB;
  1740. X                }
  1741. X                FONT (comment_font);
  1742. X                                OUT ("//"); }
  1743. X
  1744. <SLASHCOMMENT>"\n"          { INIT; OUT ("}\\mbox{}\\\\\n"); }
  1745. <SLASHCOMMENT>[ \t]+        IND;
  1746. <SLASHCOMMENT>.                SUB (yytext);
  1747. X
  1748. X
  1749. L?\"                       { BEGIN (STRING);
  1750. X                FONT (string_font); OUT ("\""); }
  1751. <STRING>\\\\            OUT ("$\\backslash\\backslash$");
  1752. <STRING>\\[bfnrtv'"]          { OUT ("$\\backslash$"); SUB (yytext+1); }
  1753. <STRING>\"              { INIT; OUT ("\"}"); }
  1754. <STRING>"\n"            OUT ("\\mbox{}\\\\\n");
  1755. <STRING>^[ \t]+            IND;
  1756. <STRING>.            SUB (yytext);
  1757. X
  1758. ([0-9]*\.[0-9]+[fFlL]?)         |
  1759. ([0-9]+\.[0-9]*[fFlL]?)         |
  1760. ([0-9]*\.?[0-9]+[eE][+-]?[0-9]+) |
  1761. ([0-9]+\.?[0-9]*[eE][+-]?[0-9]+) ECHO;
  1762. X
  1763. [0-9]+[uUlL]?            ECHO;
  1764. X
  1765. L?'[ -~]'            |
  1766. L?'\\[ntvbrfa\\?'"]'        |
  1767. L?'\\[0-7]{1,3}'        |
  1768. L?'\\x[0-9a-fA-F]{1,2}'        SUB (yytext);
  1769. X
  1770. 0[0-7]+[uUlL]?            ECHO;
  1771. X
  1772. 0x[0-9a-fA-F]+[uUlL]?        ECHO;
  1773. X
  1774. "\\\n"                OUT ("$\\backslash$\\\\\n");
  1775. ^[ \t]+                IND;
  1776. [ \t]+                ECHO;
  1777. "\f"[\n]?            OUT ("\\newpage\n");
  1778. "\n"                OUT ("\\mbox{}\\\\\n");
  1779. X
  1780. %%
  1781. X
  1782. #include "main.c"
  1783. SHAR_EOF
  1784. chmod 0640 c++2latex.l ||
  1785. echo 'restore of c++2latex.l failed'
  1786. Wc_c="`wc -c < 'c++2latex.l'`"
  1787. test 8532 -eq "$Wc_c" ||
  1788.     echo 'c++2latex.l: original size 8532, current size' "$Wc_c"
  1789. rm -f _shar_wnt_.tmp
  1790. fi
  1791. # ============= config/README ==============
  1792. if test ! -d 'config'; then
  1793.     echo 'x - creating directory config'
  1794.     mkdir 'config'
  1795. fi
  1796. if test -f 'config/README' -a X"$1" != X"-c"; then
  1797.     echo 'x - skipping config/README (File already exists)'
  1798.     rm -f _shar_wnt_.tmp
  1799. else
  1800. > _shar_wnt_.tmp
  1801. echo 'x - extracting config/README (Text)'
  1802. sed 's/^X//' << 'SHAR_EOF' > 'config/README' &&
  1803. This folder contains some stuff to support c++2latex's usage within
  1804. imke configurated application programs.
  1805. X
  1806. X    1. `Imakefile' contains a DVI target generated by 
  1807. X
  1808. X    2. `mkpt' a `make pretty definition target' tool based on the
  1809. X    imake rules provided by 
  1810. X
  1811. X    3. `pretty.rules', which must be included from your `local.def'
  1812. X    files somewhere down your system's X11 tree
  1813. X    (e.g. /usr/local/X11/config/local.def)
  1814. X
  1815. This is just a demo, but we use it for our InterViews based CARTOON
  1816. project...
  1817. X
  1818. Enjoy!
  1819. X
  1820. X    -joke
  1821. SHAR_EOF
  1822. chmod 0640 config/README ||
  1823. echo 'restore of config/README failed'
  1824. Wc_c="`wc -c < 'config/README'`"
  1825. test 498 -eq "$Wc_c" ||
  1826.     echo 'config/README: original size 498, current size' "$Wc_c"
  1827. rm -f _shar_wnt_.tmp
  1828. fi
  1829. # ============= config/mkpt ==============
  1830. if test -f 'config/mkpt' -a X"$1" != X"-c"; then
  1831.     echo 'x - skipping config/mkpt (File already exists)'
  1832.     rm -f _shar_wnt_.tmp
  1833. else
  1834. > _shar_wnt_.tmp
  1835. echo 'x - extracting config/mkpt (Text)'
  1836. sed 's/^X//' << 'SHAR_EOF' > 'config/mkpt' &&
  1837. #!/bin/csh -f
  1838. echo "#################################################"
  1839. echo "# Pretty printing rules generated automagically"
  1840. echo "# on `date` by `whoami`"
  1841. echo "# using joke's *mkpt* csh script..."
  1842. echo "# Now just type in: *make pretty*"
  1843. echo "#################################################"
  1844. echo "DVIS = \"
  1845. foreach i ($argv)
  1846. X    if ("$i" != "$argv[$#argv]") then
  1847. X        echo "    $i.dvi    \"
  1848. X    else
  1849. X        echo "    $i.dvi"
  1850. X    endif
  1851. end
  1852. echo ""
  1853. echo "SimpleDviTarget(pretty)"
  1854. foreach i ($argv)
  1855. X    echo "MakeDviFromSrc($i)"
  1856. end
  1857. SHAR_EOF
  1858. chmod 0750 config/mkpt ||
  1859. echo 'restore of config/mkpt failed'
  1860. Wc_c="`wc -c < 'config/mkpt'`"
  1861. test 508 -eq "$Wc_c" ||
  1862.     echo 'config/mkpt: original size 508, current size' "$Wc_c"
  1863. rm -f _shar_wnt_.tmp
  1864. fi
  1865. # ============= config/Imakefile ==============
  1866. if test -f 'config/Imakefile' -a X"$1" != X"-c"; then
  1867.     echo 'x - skipping config/Imakefile (File already exists)'
  1868.     rm -f _shar_wnt_.tmp
  1869. else
  1870. > _shar_wnt_.tmp
  1871. echo 'x - extracting config/Imakefile (Text)'
  1872. sed 's/^X//' << 'SHAR_EOF' > 'config/Imakefile' &&
  1873. #################################################
  1874. # Pretty printing rules generated automagically
  1875. # on Thu Dec  5 15:58:03 MET 1991 by heitkoet
  1876. # using joke's *mkpt* csh script...
  1877. # Now just type in: *make pretty*
  1878. #################################################
  1879. DVIS = \
  1880. X    ../getopt.h.dvi    \
  1881. X    ../demo.c.dvi    \
  1882. X    ../getopt.c.dvi    \
  1883. X    ../getopt1.c.dvi    \
  1884. X    ../main.c.dvi    \
  1885. X    ../version.c.dvi
  1886. X
  1887. SimpleDviTarget(pretty)
  1888. MakeDviFromSrc(../getopt.h)
  1889. MakeDviFromSrc(../demo.c)
  1890. MakeDviFromSrc(../getopt.c)
  1891. MakeDviFromSrc(../getopt1.c)
  1892. MakeDviFromSrc(../main.c)
  1893. MakeDviFromSrc(../version.c)
  1894. SHAR_EOF
  1895. chmod 0640 config/Imakefile ||
  1896. echo 'restore of config/Imakefile failed'
  1897. Wc_c="`wc -c < 'config/Imakefile'`"
  1898. test 574 -eq "$Wc_c" ||
  1899.     echo 'config/Imakefile: original size 574, current size' "$Wc_c"
  1900. rm -f _shar_wnt_.tmp
  1901. fi
  1902. # ============= config/pretty.rules ==============
  1903. if test -f 'config/pretty.rules' -a X"$1" != X"-c"; then
  1904.     echo 'x - skipping config/pretty.rules (File already exists)'
  1905.     rm -f _shar_wnt_.tmp
  1906. else
  1907. > _shar_wnt_.tmp
  1908. echo 'x - extracting config/pretty.rules (Text)'
  1909. sed 's/^X//' << 'SHAR_EOF' > 'config/pretty.rules' &&
  1910. /*
  1911. X *    Pretty Print rules setup        -joke 07/06/91
  1912. X */
  1913. #ifndef TeXSuffix
  1914. #define TeXSuffix tex
  1915. #endif
  1916. X
  1917. #ifndef DviSuffix
  1918. #define DviSuffix dvi
  1919. #endif
  1920. X
  1921. #ifndef AuxSuffix
  1922. #define AuxSuffix aux
  1923. #endif
  1924. X
  1925. #ifndef LogSuffix
  1926. #define LogSuffix log
  1927. #endif
  1928. X
  1929. #ifndef LaTeXCmd
  1930. #define LaTeXCmd latex
  1931. #endif
  1932. X
  1933. #ifndef Cplusplus2LaTeXCmd
  1934. #define Cplusplus2LaTeXCmd c++2latex
  1935. #endif
  1936. X
  1937. X
  1938. /*
  1939. X *    Set up pretty printing facility.
  1940. X */
  1941. X      TEXSUFFIX = TeXSuffix
  1942. X      DVISUFFIX = DviSuffix
  1943. X      AUXSUFFIX = AuxSuffix
  1944. X      LOGSUFFIX = LogSuffix
  1945. X
  1946. X       LATEXCMD = LaTeXCmd
  1947. X CPLUSPLUS2LATEXCMD = Cplusplus2LaTeXCmd
  1948. X
  1949. X
  1950. /*
  1951. X *    Make a Dvi file.
  1952. X */
  1953. #ifndef MakeDviRule
  1954. #define MakeDviRule(dst,src)                        @@\
  1955. dst.$(DVISUFFIX): src.$(TEXSUFFIX)                    @@\
  1956. X    @echo "LaTeXing src.$(TEXSUFFIX)"                @@\
  1957. X    $(RM) dst.$(DVISUFFIX)                        @@\
  1958. X    $(LATEXCMD) src.$(TEXSUFFIX)                    @@\
  1959. X    $(RM) src.$(TEXSUFFIX) src.$(AUXSUFFIX) src.$(LOGSUFFIX)
  1960. #endif
  1961. X
  1962. /*
  1963. X *    Make a LaTeX file.
  1964. X */
  1965. #ifndef MakeLaTeXRule
  1966. #define MakeLaTeXRule(dst,src,flags)                    @@\
  1967. dst.$(TEXSUFFIX): src                            @@\
  1968. X    @echo "C++2LaTeXing src"                    @@\
  1969. X    $(RM) dst.$(TEXSUFFIX)                        @@\
  1970. X    $(CPLUSPLUS2LATEXCMD) src flags -o dst.$(TEXSUFFIX)
  1971. #endif
  1972. X
  1973. /*
  1974. X *    Make a Dvi file from a C++ source with flags.
  1975. X */
  1976. #ifndef MakeDviFromSrcFlags
  1977. #define MakeDviFromSrcFlags(file,flags)                    @@\
  1978. X    MakeLaTeXRule(file,file,flags)                    @@\
  1979. X    MakeDviRule(file,file)
  1980. #endif
  1981. X
  1982. /*
  1983. X *    Make a Dvi file from a C++ source.
  1984. X */
  1985. #ifndef MakeDviFromSrc
  1986. #define MakeDviFromSrc(file)                        @@\
  1987. X    MakeDviFromSrcFlags(file,-h)
  1988. #endif
  1989. X
  1990. /*
  1991. X *    Make a LaTeX file from a C++ source with flags.
  1992. X */
  1993. #ifndef MakeLaTeXFromSrcFlags
  1994. #define MakeLaTeXFromSrcFlags(file,flags)                @@\
  1995. X    MakeLaTeXRule(file,file,flags)
  1996. #endif
  1997. X
  1998. /*
  1999. X *    Make a LaTeX file from a C++ source.
  2000. X */
  2001. #ifndef MakeLaTeXFromSrc
  2002. #define MakeLaTeXFromSrc(file)                        @@\
  2003. X    MakeLaTeXFromSrcFlags(file,/**/)
  2004. #endif
  2005. X
  2006. /*
  2007. X *    Build all Dvi files available.
  2008. X */
  2009. #ifndef BuildAllDviFiles
  2010. #define BuildAllDviFiles(target,dvifiles)                @@\
  2011. target:    dvifiles                            @@\
  2012. X    @echo ""
  2013. #endif
  2014. X
  2015. /*
  2016. X *    The simple dvi target: all Dvi files are stand-alone LaTeX.
  2017. X */
  2018. #ifndef SimpleDviTarget
  2019. #define SimpleDviTarget(name)                        @@\
  2020. X    BuildAllDviFiles(name,$(DVIS))
  2021. #endif
  2022. SHAR_EOF
  2023. chmod 0640 config/pretty.rules ||
  2024. echo 'restore of config/pretty.rules failed'
  2025. Wc_c="`wc -c < 'config/pretty.rules'`"
  2026. test 2149 -eq "$Wc_c" ||
  2027.     echo 'config/pretty.rules: original size 2149, current size' "$Wc_c"
  2028. rm -f _shar_wnt_.tmp
  2029. fi
  2030. # ============= demo.c ==============
  2031. if test -f 'demo.c' -a X"$1" != X"-c"; then
  2032.     echo 'x - skipping demo.c (File already exists)'
  2033.     rm -f _shar_wnt_.tmp
  2034. else
  2035. > _shar_wnt_.tmp
  2036. echo 'x - extracting demo.c (Text)'
  2037. sed 's/^X//' << 'SHAR_EOF' > 'demo.c' &&
  2038. //
  2039. //  Copyright (c) 1991 University of Dortmund
  2040. //
  2041. //  Permission to use, copy, modify, distribute, and sell this software and its
  2042. //  documentation for any purpose is hereby granted without fee, provided
  2043. //  that the above copyright notice appear in all copies and that both that
  2044. //  copyright notice and this permission notice appear in supporting
  2045. //  documentation, and that the name of UNIDO not be used in advertising or
  2046. //  publicity pertaining to distribution of the software without specific,
  2047. //  written prior permission.  UNIDO makes no representations about
  2048. SHAR_EOF
  2049. true || echo 'restore of demo.c failed'
  2050. fi
  2051. echo 'End of  part 2'
  2052. echo 'File demo.c is continued in part 3'
  2053. echo 3 > _shar_seq_.tmp
  2054. exit 0
  2055. exit 0 # Just in case...
  2056. -- 
  2057. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  2058. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  2059. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  2060. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  2061.