Cross Reference: PlainXref.lex
xref
: /
opengrok-jel
/
src
/
org
/
opensolaris
/
opengrok
/
analysis
/
plain
/
PlainXref.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
;
850
N/A
import
java
.
io
.
IOException
;
850
N/A
import
java
.
io
.
Writer
;
850
N/A
import
java
.
io
.
Reader
;
1469
N/A
import
org
.
opensolaris
.
opengrok
.
web
.
Util
;
0
N/A
0
N/A
%%
0
N/A
%
public
0
N/A
%
class
PlainXref
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
%}
0
N/A
URIChar
= [\?\+\%\&\:\/\.\@\_\;\=\$\,\-\!\~\*\\]
1020
N/A
EOL
= \r|\n|\r\n
0
N/A
FNameChar
= [a-
zA
-
Z0
-
9
_\-\.]
0
N/A
File
= {
FNameChar
}+
"."
([a-
zA
-Z]+) {
FNameChar
}*
0
N/A
Path
=
"/"
? [a-
zA
-Z]{
FNameChar
}* (
"/"
[a-
zA
-Z]{
FNameChar
}*)+[a-
zA
-
Z0
-
9
]
0
N/A
%%
0
N/A
{
File
}|{
Path
}
974
N/A
{
String
s=
yytext
();
974
N/A
out
.
write
(
"<a href=\""
);
out
.
write
(
urlPrefix
);
out
.
write
(
"path="
);
974
N/A
out
.
write
(s);
appendProject
();
out
.
write
(
"\">"
);
974
N/A
out
.
write
(s);
out
.
write
(
"</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
171
N/A
{
FNameChar
}+
"@"
{
FNameChar
}+
"."
{
FNameChar
}+
974
N/A
{
1122
N/A
writeEMailAddress
(
yytext
());
974
N/A
}
0
N/A
923
N/A
// Bug #13362: If there's a very long sequence that matches {FNameChar}+,
923
N/A
// parsing the file will take forever because of all the backtracking. With
923
N/A
// this rule, we avoid much of the backtracking and speed up the parsing
923
N/A
// (in some cases from hours to seconds!). This rule will not interfere with
923
N/A
// the rules above because JFlex always picks the longest match.
923
N/A
{
FNameChar
}+ {
out
.
write
(
yytext
()); }
923
N/A
974
N/A
"&"
{
out
.
write
(
"&"
);}
974
N/A
"<"
{
out
.
write
(
"<"
);}
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)); }