@@ -31,6 +31,7 @@ package org.opensolaris.opengrok.analysis.c;
31
31
import java. util. regex. Matcher;
32
32
import java. util. regex. Pattern;
33
33
import org. opensolaris. opengrok. analysis. JFlexXrefSimple;
34
+ import org. opensolaris. opengrok. util. StringUtils;
34
35
import org. opensolaris. opengrok. web. HtmlConsts;
35
36
import org. opensolaris. opengrok. web. Util;
36
37
@@ -58,20 +59,17 @@ import org.opensolaris.opengrok.web.Util;
58
59
protected void setLineNumber(int x) { yyline = x; }
59
60
%}
60
61
61
- Identifier = [ a- zA- Z_] [ a- zA- Z0- 9_] +
62
-
63
62
File = [ a- zA- Z] {FNameChar} * "." ( [ cChHsStT] | [ Cc][ Oo][ Nn][ Ff] |
64
63
[ Jj][ Aa][ Vv][ Aa] | [ CcHh][ Pp][ Pp] | [ Cc][ Cc] | [ Tt][ Xx][ Tt] |
65
64
[ Hh][ Tt][ Mm][ Ll] ? | [ Pp][ Ll] | [ Xx][ Mm][ Ll] | [ CcHh][ \+ ][ \+ ] | [ Hh][ Hh] |
66
65
[ CcHh][ Xx][ Xx] | [ Dd][ Ii][ Ff][ Ff] | [ Pp][ Aa][ Tt][ Cc][ Hh] )
67
66
68
- Number = ( 0[ xX][ 0- 9a- fA- F] +| [ 0- 9] + \. [ 0- 9] +| [ 1- 9][ 0- 9] *)(( [ eE][ +-] ? [ 0- 9] +)? [ ufdlUFDL] *)?
69
-
70
67
%state STRING COMMENT SCOMMENT QSTRING
71
68
72
69
%include Common.lexh
73
70
%include CommonURI.lexh
74
71
%include CommonPath.lexh
72
+ %include C.lexh
75
73
%%
76
74
<YYINITIAL> {
77
75
\{ { incScope(); writeUnicodeChar(yycharat(0 )); }
@@ -128,15 +126,13 @@ Number = (0[xX][0-9a-fA-F]+|[0-9]+\.[0-9]+|[1-9][0-9]*)(([eE][+-]?[0-9]+)?[ufdlU
128
126
}
129
127
130
128
<STRING> {
129
+ \\ [ \"\\ ] |
131
130
\" {WhiteSpace} \" { out. write(htmlize(yytext())); }
132
131
\" { out. write(htmlize(yytext())); yypop(); }
133
- \\\\ |
134
- \\\" { out. write(htmlize(yytext())); }
135
132
}
136
133
137
134
<QSTRING> {
138
- "\\\\ " |
139
- "\\ '" |
135
+ \\ [ \'\\ ] |
140
136
\' {WhiteSpace} \' { out. write(htmlize(yytext())); }
141
137
142
138
\' { out. write(htmlize(yytext())); yypop(); }
@@ -161,7 +157,7 @@ Number = (0[xX][0-9a-fA-F]+|[0-9]+\.[0-9]+|[1-9][0-9]*)(([eE][+-]?[0-9]+)?[ufdlU
161
157
[^\n] { writeUnicodeChar(yycharat(0 )); }
162
158
}
163
159
164
- <STRING, COMMENT, SCOMMENT, STRING, QSTRING> {
160
+ <STRING, COMMENT, SCOMMENT, QSTRING> {
165
161
{FPath}
166
162
{ out. write(Util . breadcrumbPath(urlPrefix+ " path=" ,yytext(),' /' ));}
167
163
@@ -175,12 +171,26 @@ Number = (0[xX][0-9a-fA-F]+|[0-9]+\.[0-9]+|[1-9][0-9]*)(([eE][+-]?[0-9]+)?[ufdlU
175
171
out. write(path);
176
172
out. write(" </a>" );}
177
173
178
- {BrowseableURI} {
179
- appendLink(yytext(), true );
180
- }
181
-
182
174
{FNameChar} + "@" {FNameChar} + "." {FNameChar} +
183
175
{
184
176
writeEMailAddress(yytext());
185
177
}
186
178
}
179
+
180
+ <STRING, SCOMMENT> {
181
+ {BrowseableURI} {
182
+ appendLink(yytext(), true );
183
+ }
184
+ }
185
+
186
+ <COMMENT> {
187
+ {BrowseableURI} {
188
+ appendLink(yytext(), true , StringUtils . END_C_COMMENT );
189
+ }
190
+ }
191
+
192
+ <QSTRING> {
193
+ {BrowseableURI} {
194
+ appendLink(yytext(), true , StringUtils . APOS_NO_BSESC );
195
+ }
196
+ }
0 commit comments