Cross Reference: TclXref.lex
xref
: /
opengrok-jel
/
src
/
org
/
opensolaris
/
opengrok
/
analysis
/
tcl
/
TclXref.lex
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
244
N/A
/*
244
N/A
* CDDL HEADER START
244
N/A
*
244
N/A
* The contents of this file are subject to the terms of the
244
N/A
* Common Development and Distribution License (the "License").
244
N/A
* You may not use this file except in compliance with the License.
244
N/A
*
244
N/A
* See
LICENSE.txt
included in this distribution for the specific
244
N/A
* language governing permissions and limitations under the License.
244
N/A
*
244
N/A
* When distributing Covered Code, include this CDDL HEADER in each
244
N/A
* file and include the License file at
LICENSE.txt
.
244
N/A
* If applicable, add the following below this CDDL HEADER, with the
244
N/A
* fields enclosed by brackets "[]" replaced with your own identifying
244
N/A
* information: Portions Copyright [yyyy] [name of copyright owner]
244
N/A
*
244
N/A
* CDDL HEADER END
244
N/A
*/
244
N/A
244
N/A
/*
1058
N/A
* Copyright (c) 2008, 2010, Oracle
and
/
or
its affiliates. All rights reserved.
244
N/A
*/
244
N/A
244
N/A
/*
244
N/A
* Cross reference a Tcl file
244
N/A
*/
244
N/A
244
N/A
package
org
.
opensolaris
.
opengrok
.
analysis
.
tcl
;
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
;
244
N/A
import
org
.
opensolaris
.
opengrok
.
web
.
Util
;
244
N/A
244
N/A
%%
244
N/A
%
public
244
N/A
%
class
TclXref
850
N/A
%
extends
JFlexXref
244
N/A
%
unicode
244
N/A
%
ignorecase
244
N/A
%
int
244
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; }
244
N/A
%}
244
N/A
936
N/A
WhiteSpace
= [ \t\f]+
1020
N/A
EOL
= \r|\n|\r\n
244
N/A
Identifier
= [\:\=a-
zA
-
Z0
-
9
_]+
244
N/A
244
N/A
URIChar
= [\?\+\%\&\:\/\.\@\_\;\=\$\,\-\!\~\*\\]
244
N/A
FNameChar
= [a-
zA
-
Z0
-
9
_\-\.]
244
N/A
File
= [a-
zA
-Z] {
FNameChar
}+
"."
([a-
zA
-Z]+)
244
N/A
Path
=
"/"
? [a-
zA
-Z]{
FNameChar
}* (
"/"
[a-
zA
-Z]{
FNameChar
}*[a-
zA
-
Z0
-
9
])+
244
N/A
1074
N/A
Number
= ([0-
9
]+\.[0-
9
]+|[0-
9
][0-
9
]*|
"#"
[
boxBOX
] [0-
9
a-
fA
-F]+)
244
N/A
244
N/A
%
state
STRING
COMMENT
SCOMMENT
244
N/A
244
N/A
%%
244
N/A
<
YYINITIAL
>{
943
N/A
943
N/A
{
Identifier
} {
943
N/A
String
id
=
yytext
();
1469
N/A
writeSymbol
(
id
,
Consts
.
kwd
,
yyline
,
true
);
943
N/A
}
244
N/A
244
N/A
{
Number
} {
out
.
write
(
"<span class=\"n\">"
);
1013
N/A
out
.
write
(
yytext
());
244
N/A
out
.
write
(
"</span>"
); }
244
N/A
1370
N/A
\
" { yybegin(STRING);out.write("
<
span
class
=\
"s\">\""
);
spans
.
push
(
"s"
); }
1370
N/A
"#"
{
yybegin
(
SCOMMENT
);
out
.
write
(
"<span class=\"c\">#"
);
spans
.
push
(
"c"
); }
244
N/A
}
244
N/A
244
N/A
<
STRING
> {
1013
N/A
\
" {WhiteSpace} \" { out.write(yytext()); }
1370
N/A
\" { yybegin(YYINITIAL); out.write("
\
"</span>"
);
spans
.
pop
(); }
244
N/A
\\\\ {
out
.
write
(
"\\\\"
); }
244
N/A
\\\
" { out.write("
\\\
""
); }
244
N/A
}
244
N/A
244
N/A
<
SCOMMENT
> {
936
N/A
{
EOL
} {
1370
N/A
yybegin
(
YYINITIAL
);
out
.
write
(
"</span>"
);
spans
.
pop
();
1020
N/A
startNewLine
();
244
N/A
}
244
N/A
}
244
N/A
244
N/A
<
YYINITIAL
,
STRING
,
COMMENT
,
SCOMMENT
> {
244
N/A
"&"
{
out
.
write
(
"&"
);}
244
N/A
"<"
{
out
.
write
(
"<"
);}
244
N/A
">"
{
out
.
write
(
">"
);}
1020
N/A
{
WhiteSpace
}*{
EOL
} {
startNewLine
(); }
1013
N/A
{
WhiteSpace
} {
out
.
write
(
yytext
()); }
244
N/A
[!-~] {
out
.
write
(
yycharat
(0)); }
963
N/A
. {
writeUnicodeChar
(
yycharat
(0)); }
244
N/A
}
244
N/A
244
N/A
<
STRING
,
COMMENT
,
SCOMMENT
> {
244
N/A
{
Path
}
244
N/A
{
out
.
write
(
Util
.
breadcrumbPath
(
urlPrefix
+
"path="
,
yytext
(),
'/'
));}
244
N/A
244
N/A
{
File
}
244
N/A
{
1013
N/A
String
path
=
yytext
();
244
N/A
out
.
write
(
"<a href=\""
+
urlPrefix
+
"path="
);
1013
N/A
out
.
write
(
path
);
271
N/A
appendProject
();
271
N/A
out
.
write
(
"\">"
);
1013
N/A
out
.
write
(
path
);
271
N/A
out
.
write
(
"</a>"
);}
244
N/A
244
N/A
(
"http"
|
"https"
|
"ftp"
)
"://"
({
FNameChar
}|{
URIChar
})+[a-
zA
-
Z0
-
9
/]
244
N/A
{
1013
N/A
String
url
=
yytext
();
244
N/A
out
.
write
(
"<a href=\""
);
1472
N/A
out
.
write
(
Util
.
uriEncodeURL
(
url
));
out
.
write
(
"\">"
);
1469
N/A
out
.
write
(
Util
.
htmlize
(
url
));
out
.
write
(
"</a>"
);}
244
N/A
244
N/A
{
FNameChar
}+
"@"
{
FNameChar
}+
"."
{
FNameChar
}+
244
N/A
{
1122
N/A
writeEMailAddress
(
yytext
());
244
N/A
}
244
N/A
}