Cross Reference: XMLXref.lex
xref
: /
opengrok-jel
/
src
/
org
/
opensolaris
/
opengrok
/
analysis
/
plain
/
XMLXref.lex
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
0
N/A
/*
0
N/A
* CDDL HEADER START
0
N/A
*
0
N/A
* The contents of this file are subject to the terms of the
0
N/A
* Common Development and Distribution License (the "License").
0
N/A
* You may not use this file except in compliance with the License.
0
N/A
*
0
N/A
* See
LICENSE.txt
included in this distribution for the specific
0
N/A
* language governing permissions and limitations under the License.
0
N/A
*
0
N/A
* When distributing Covered Code, include this CDDL HEADER in each
0
N/A
* file and include the License file at
LICENSE.txt
.
0
N/A
* If applicable, add the following below this CDDL HEADER, with the
0
N/A
* fields enclosed by brackets "[]" replaced with your own identifying
0
N/A
* information: Portions Copyright [yyyy] [name of copyright owner]
0
N/A
*
0
N/A
* CDDL HEADER END
0
N/A
*/
0
N/A
0
N/A
/*
1067
N/A
* Copyright (c) 2005, 2010, Oracle
and
/
or
its affiliates. All rights reserved.
0
N/A
*/
0
N/A
0
N/A
package
org
.
opensolaris
.
opengrok
.
analysis
.
plain
;
850
N/A
import
org
.
opensolaris
.
opengrok
.
analysis
.
JFlexXref
;
937
N/A
import
org
.
opensolaris
.
opengrok
.
util
.
StringUtils
;
850
N/A
import
java
.
io
.
IOException
;
850
N/A
import
java
.
io
.
Writer
;
850
N/A
import
java
.
io
.
Reader
;
0
N/A
import
org
.
opensolaris
.
opengrok
.
web
.
Util
;
0
N/A
0
N/A
%%
0
N/A
%
public
0
N/A
%
class
XMLXref
850
N/A
%
extends
JFlexXref
0
N/A
%
unicode
0
N/A
%
ignorecase
0
N/A
%
int
0
N/A
%{
1020
N/A
// TODO move this into an include file when bug #16053 is fixed
1020
N/A
@
Override
1020
N/A
protected
int
getLineNumber
() {
return
yyline
; }
1020
N/A
@
Override
1020
N/A
protected
void
setLineNumber
(
int
x) {
yyline
= x; }
0
N/A
%}
936
N/A
WhiteSpace
= [ \t\f]
1020
N/A
EOL
= \r|\n|\r\n
0
N/A
URIChar
= [\?\+\%\&\:\/\.\@\_\;\=\$\,\-\!\~\*\\]
0
N/A
FNameChar
= [a-
zA
-
Z0
-
9
_\-\.]
0
N/A
File
= {
FNameChar
}+
"."
([a-
zA
-Z]+) {
FNameChar
}*
0
N/A
Path
=
"/"
? {
FNameChar
}+ (
"/"
{
FNameChar
}+)+[a-
zA
-
Z0
-
9
]
0
N/A
0
N/A
FileChar
= [a-
zA
-
Z_0
-
9
_\-\/]
0
N/A
NameChar
= {
FileChar
}|
"."
0
N/A
146
N/A
%
state
TAG
STRING
COMMENT
SSTRING
CDATA
0
N/A
%%
0
N/A
0
N/A
<
YYINITIAL
> {
1370
N/A
"<!--"
{
yybegin
(
COMMENT
);
out
.
write
(
"<span class=\"c\"><!--"
);
spans
.
push
(
"c"
); }
146
N/A
"<![CDATA["
{
146
N/A
yybegin
(
CDATA
);
1370
N/A
out
.
write
(
"<<span class=\"n\">![CDATA[</span><span class=\"c\">"
);
spans
.
push
(
"c"
);
146
N/A
}
974
N/A
"<"
{
yybegin
(
TAG
);
out
.
write
(
"<"
);}
0
N/A
}
0
N/A
0
N/A
<
TAG
> {
1013
N/A
[a-
zA
-
Z_0
-
9
]+{
WhiteSpace
}*\= {
out
.
write
(
"<b>"
);
out
.
write
(
yytext
());
out
.
write
(
"</b>"
); }
1013
N/A
[a-
zA
-
Z_0
-
9
]+ {
out
.
write
(
"<span class=\"n\">"
);
out
.
write
(
yytext
());
out
.
write
(
"</span>"
); }
1370
N/A
\
" { yybegin(STRING); out.write("
<
span
class
=\
"s\">\""
);
spans
.
push
(
"s"
); }
1370
N/A
\
' { yybegin(SSTRING); out.write("<span class=\"s\">'
"); spans.push("
s
"); }
0
N/A
"
>
" { yybegin(YYINITIAL); out.write("
&
gt
;
"); }
0
N/A
"
<
" { yybegin(YYINITIAL); out.write("
&
lt
;
"); }
0
N/A
}
0
N/A
0
N/A
<STRING> {
1013
N/A
\" {WhiteSpace}* \" { out.write(yytext());}
1370
N/A
\" { yybegin(TAG); out.write("
\
"</span>"
);
spans
.
pop
(); }
0
N/A
}
1000
N/A
1000
N/A
<
STRING
,
SSTRING
,
COMMENT
,
CDATA
> {
974
N/A
"<"
{
out
.
write
(
"<"
);}
974
N/A
">"
{
out
.
write
(
">"
);}
0
N/A
}
0
N/A
0
N/A
<
SSTRING
> {
1013
N/A
\
' {WhiteSpace}* \' { out.write(yytext());}
1370
N/A
\' { yybegin(TAG); out.write("'
</
span
>
"); spans.pop(); }
0
N/A
}
0
N/A
0
N/A
<COMMENT> {
1370
N/A
"
-->
" { yybegin(YYINITIAL); out.write("
--&
gt
;</
span
>
"); spans.pop(); }
0
N/A
}
0
N/A
146
N/A
<CDATA> {
146
N/A
"
]]>
" {
1370
N/A
yybegin(YYINITIAL); out.write("
<
span
class
=\
"n\">]]</span></span>>"
);
spans
.
pop
();
146
N/A
}
146
N/A
}
146
N/A
146
N/A
<
YYINITIAL
,
COMMENT
,
CDATA
,
STRING
,
SSTRING
,
TAG
> {
0
N/A
{
File
}|{
Path
}
606
N/A
{
606
N/A
final
String
path
=
yytext
();
937
N/A
final
char
separator
=
StringUtils
.
isPossiblyJavaClass
(
path
) ?
'.'
:
'/'
;
606
N/A
final
String
hyperlink
=
606
N/A
Util
.
breadcrumbPath
(
urlPrefix
+
"path="
,
path
,
separator
,
606
N/A
getProjectPostfix
(),
true
);
606
N/A
out
.
append
(
hyperlink
);
606
N/A
}
0
N/A
0
N/A
(
"http"
|
"https"
|
"ftp"
)
"://"
({
FNameChar
}|{
URIChar
})+[a-
zA
-
Z0
-
9
/]
974
N/A
{
String
s=
yytext
();
974
N/A
out
.
write
(
"<a href=\""
);
1472
N/A
out
.
write
(
Util
.
uriEncodeURL
(s));
out
.
write
(
"\">"
);
1469
N/A
out
.
write
(
Util
.
htmlize
(s));
out
.
write
(
"</a>"
);}
0
N/A
0
N/A
{
NameChar
}+
"@"
{
NameChar
}+
"."
{
NameChar
}+
974
N/A
{
1122
N/A
writeEMailAddress
(
yytext
());
974
N/A
}
0
N/A
974
N/A
"&"
{
out
.
write
(
"&"
);}
1020
N/A
{
EOL
} {
startNewLine
(); }
974
N/A
[ !-~\t\f] {
out
.
write
(
yycharat
(0));}
974
N/A
. {
writeUnicodeChar
(
yycharat
(0)); }
35
N/A
}