Cross Reference: VBXref.lex
xref
: /
opengrok-jel
/
src
/
org
/
opensolaris
/
opengrok
/
analysis
/
vb
/
VBXref.lex
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
1256
N/A
/*
1256
N/A
* CDDL HEADER START
1256
N/A
*
1256
N/A
* The contents of this file are subject to the terms of the
1256
N/A
* Common Development and Distribution License (the "License").
1256
N/A
* You may not use this file except in compliance with the License.
1256
N/A
*
1256
N/A
* See
LICENSE.txt
included in this distribution for the specific
1256
N/A
* language governing permissions and limitations under the License.
1256
N/A
*
1256
N/A
* When distributing Covered Code, include this CDDL HEADER in each
1256
N/A
* file and include the License file at
LICENSE.txt
.
1256
N/A
* If applicable, add the following below this CDDL HEADER, with the
1256
N/A
* fields enclosed by brackets "[]" replaced with your own identifying
1256
N/A
* information: Portions Copyright [yyyy] [name of copyright owner]
1256
N/A
*
1256
N/A
* CDDL HEADER END
1256
N/A
*/
1256
N/A
1256
N/A
/*
1256
N/A
* Copyright (c) 2006, 2010, Oracle
and
/
or
its affiliates. All rights reserved.
1256
N/A
*/
1256
N/A
1256
N/A
/*
1256
N/A
* Cross reference a Java file
1256
N/A
*/
1256
N/A
1256
N/A
package
org
.
opensolaris
.
opengrok
.
analysis
.
vb
;
1256
N/A
import
org
.
opensolaris
.
opengrok
.
analysis
.
JFlexXref
;
1256
N/A
import
java
.
io
.
IOException
;
1256
N/A
import
java
.
io
.
Writer
;
1256
N/A
import
java
.
io
.
Reader
;
1256
N/A
import
org
.
opensolaris
.
opengrok
.
web
.
Util
;
1256
N/A
1256
N/A
%%
1256
N/A
%
public
1256
N/A
%
class
VBXref
1256
N/A
%
extends
JFlexXref
1256
N/A
%
unicode
1256
N/A
%
ignorecase
1256
N/A
%
int
1256
N/A
%{
1256
N/A
/* Must match WhiteSpace regex */
1256
N/A
private
final
static
String
WHITE_SPACE
=
"[ \t\f\r]+"
;
1256
N/A
1256
N/A
// TODO move this into an include file when bug #16053 is fixed
1256
N/A
@
Override
1256
N/A
protected
int
getLineNumber
() {
return
yyline
; }
1256
N/A
@
Override
1256
N/A
protected
void
setLineNumber
(
int
x) {
yyline
= x; }
1256
N/A
%}
1256
N/A
1256
N/A
/* Must match WHITE_SPACE constant */
1256
N/A
WhiteSpace
= [ \t\f]+
1256
N/A
EOL
= \r|\n|\r\n
1256
N/A
Identifier
= [a-
zA
-
Z_
] [a-
zA
-
Z0
-
9
_]+
1256
N/A
1256
N/A
URIChar
= [\?\+\%\&\:\/\.\@\_\;\=\$\,\-\!\~\*\\]
1256
N/A
FNameChar
= [a-
zA
-
Z0
-
9
_\-\.]
1256
N/A
File
= [a-
zA
-Z]{
FNameChar
}*
"."
(
"vb"
|
"cls"
|
"frm"
|
"vbs"
|
"bas"
|
"ctl"
)
1256
N/A
Path
=
"/"
? [a-
zA
-Z]{
FNameChar
}* (
"/"
[a-
zA
-Z]{
FNameChar
}*[a-
zA
-
Z0
-
9
])+
1256
N/A
1256
N/A
Number
= (0[
xX
][0-
9
a-
fA
-F]+|[0-
9
]+\.[0-
9
]+|[0-
9
]+)(([
eE
][+-]?[0-
9
]+)?[
ufdlUFDL
]*)?
1256
N/A
1256
N/A
1256
N/A
%
state
STRING
COMMENT
1256
N/A
1256
N/A
%%
1256
N/A
<
YYINITIAL
>{
1256
N/A
1256
N/A
{
Identifier
} {
1256
N/A
String
id
=
yytext
();
1469
N/A
writeSymbol
(
id
,
Consts
.
getReservedKeywords
(),
yyline
,
false
);
1256
N/A
}
1256
N/A
1256
N/A
"<"
({
File
}|{
Path
})
">"
{
1256
N/A
out
.
write
(
"<"
);
1256
N/A
String
path
=
yytext
();
1256
N/A
path
=
path
.
substring
(
1
,
path
.
length
() -
1
);
1256
N/A
out
.
write
(
"<a href=\""
+
urlPrefix
+
"path="
);
1256
N/A
out
.
write
(
path
);
1256
N/A
appendProject
();
1256
N/A
out
.
write
(
"\">"
);
1256
N/A
out
.
write
(
path
);
1256
N/A
out
.
write
(
"</a>"
);
1256
N/A
out
.
write
(
">"
);
1256
N/A
}
1256
N/A
1256
N/A
/*{Hier}
1256
N/A
{ out.write(Util.breadcrumbPath(urlPrefix+"defs=",yytext(),'.'));}
1256
N/A
*/
1256
N/A
{
Number
} {
out
.
write
(
"<span class=\"n\">"
);
out
.
write
(
yytext
());
out
.
write
(
"</span>"
); }
1256
N/A
1370
N/A
\
" { yybegin(STRING);out.write("
<
span
class
=\
"s\">\""
);
spans
.
push
(
"s"
); }
1370
N/A
\
' { yybegin(COMMENT);out.write("<span class=\"c\">\'"); spans.push("c"); }
1256
N/A
}
1256
N/A
1256
N/A
<STRING> {
1256
N/A
\" {WhiteSpace} \" { out.write(yytext());}
1370
N/A
\" { yybegin(YYINITIAL); out.write("\"</span>"); spans.pop(); }
1256
N/A
\\\\ { out.write("\\\\"); }
1370
N/A
\\\" { yybegin(YYINITIAL); out.write("\\\"</span>"); spans.pop(); }
1256
N/A
1256
N/A
}
1256
N/A
1256
N/A
<COMMENT> {
1256
N/A
{WhiteSpace}*{EOL} {
1370
N/A
yybegin(YYINITIAL); out.write("</span>"); spans.pop();
1256
N/A
startNewLine();
1256
N/A
}
1256
N/A
}
1256
N/A
1256
N/A
1256
N/A
<YYINITIAL, STRING, COMMENT> {
1256
N/A
"&" {out.write( "&");}
1256
N/A
"<" {out.write( "<");}
1256
N/A
">" {out.write( ">");}
1256
N/A
{WhiteSpace}*{EOL} { startNewLine(); }
1256
N/A
{WhiteSpace} { out.write(yytext()); }
1256
N/A
[!-~] { out.write(yycharat(0)); }
1256
N/A
. { writeUnicodeChar(yycharat(0)); }
1256
N/A
}
1256
N/A
1256
N/A
<STRING, COMMENT> {
1256
N/A
{Path}
1256
N/A
{ out.write(Util.breadcrumbPath(urlPrefix+"path=",yytext(),'
/
'));}
1256
N/A
1256
N/A
{File}
1256
N/A
{
1256
N/A
String path = yytext();
1256
N/A
out.write("<a href=\""+urlPrefix+"path=");
1256
N/A
out.write(path);
1256
N/A
appendProject();
1256
N/A
out.write("\">");
1256
N/A
out.write(path);
1256
N/A
out.write("</a>");}
1256
N/A
1256
N/A
("http" | "https" | "ftp" ) "://" ({FNameChar}|{URIChar})+[a-zA-Z0-9/]
1256
N/A
{
1256
N/A
String url = yytext();
1256
N/A
out.write("<a href=\"");
1472
N/A
out.write(Util.uriEncodeURL(url));out.write("\">");
1469
N/A
out.write(
Util.html
ize(url));out.write("</a>");}
1256
N/A
1256
N/A
{FNameChar}+ "@" {FNameChar}+ "." {FNameChar}+
1256
N/A
{
1256
N/A
writeEMailAddress(yytext());
1256
N/A
}
1256
N/A
}