summaryrefslogtreecommitdiff
path: root/devel/doc++/patches/patch-src_doc2tex.ll
blob: 2e2c728cad78738bc84325358883956aace46110 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
$NetBSD: patch-src_doc2tex.ll,v 1.2 2013/04/30 22:16:12 joerg Exp $

--- src/doc2tex.ll.orig	2000-11-05 16:21:16.000000000 +0000
+++ src/doc2tex.ll
@@ -23,8 +23,8 @@
 
 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -33,6 +33,8 @@
 #include "classgraph.h"
 #include "doc.h"
 
+using namespace std;
+
 #define YY_DECL int yylex()
 
 #undef	YY_INPUT
@@ -58,7 +60,7 @@ static int	yyLineNr	= 0;
 static int	texBracketCount	= 0;
 static McString	refStr		= "";
 static Entry*	ref		= 0;
-static Entry*	noref		= ref + 1;
+static Entry*	noref		= ::ref + 1;
 static char	yyFileName[264];
 bool		mathmode	= false;
 static int	tabFlag		= 0;
@@ -184,30 +186,30 @@ static void closeVerbMode()
 			}
 
 <Ref>[^}]*		{
-			if(ref == 0)
+			if(::ref == 0)
 			    {
 			    refStr = McString(yytext, 0, yyleng - 2);
-			    ref = getRefEntry(refStr, current);
+			    ::ref = getRefEntry(refStr, current);
 			    }
 			REJECT;
 			}
 
 <Ref>"}"		{
-			if(ref && ref != noref)
+			if(::ref && ::ref != noref)
 			    {
 			    fprintf(out, " ($\\rightarrow$ ");
-			    if(MAKE_DOC(ref))
+			    if(MAKE_DOC(::ref))
 				{
-				ref->dumpNumber(out);
+				::ref->dumpNumber(out);
 				fprintf(out, ",");
 				}
 			    fprintf(out, " {\\em page }\\pageref{cxx.");
-			    ref->dumpNumber(out);
+			    ::ref->dumpNumber(out);
 			    fprintf(out, "})");
 			    }
 			else
 			    fprintf(out, refStr.c_str());
-			ref = 0;
+			::ref = 0;
 			refStr.clear();
 			BEGIN(0);
 			}
@@ -244,28 +246,28 @@ static void closeVerbMode()
 			}
 
 <Link>[^ ]*		{
-			if(ref == 0)
+			if(::ref == 0)
 			    {
 			    McString tmp = yytext;
-			    ref = getRefEntry(tmp, current);
+			    ::ref = getRefEntry(tmp, current);
 			    }
 			REJECT;
 			}
 
 <Link>"}"		{
-			if(ref && ref != noref)
+			if(::ref && ::ref != noref)
 			    {
 			    fprintf(out, " ($\\rightarrow$ ");
-			    if(MAKE_DOC(ref))
+			    if(MAKE_DOC(::ref))
 				{
-				ref->dumpNumber(out);
+				::ref->dumpNumber(out);
 				fprintf(out, ",");
 				}
 			    fprintf(out, " {\\em page }\\pageref{cxx.");
-			    ref->dumpNumber(out);
+			    ::ref->dumpNumber(out);
 			    fprintf(out, "})");
 			    }
-			ref = 0;
+			::ref = 0;
 			BEGIN(0);
 			}