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