Ctags.java revision 04eceded116c11ab5ed16e40196adbe969b94aab
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/**
* Provides Ctags by having a running instance of ctags
*
* @author Chandan
*/
public class Ctags {
private OutputStreamWriter ctagsIn;
private BufferedReader ctagsOut;
public Ctags() throws IOException {
initialize();
}
public void close() throws IOException {
}
private void initialize() throws IOException {
"--c-kinds=+l",
"--java-kinds=+l",
"--sql-kinds=+l",
"--Fortran-kinds=+L",
"--C++-kinds=+l",
"--file-scope=yes",
"-u",
"--filter=yes",
"--filter-terminator=__ctags_done_with_file__" + '\n',
"--fields=-anf+iKnS",
"--excmd=pattern",
"--regex-Asm=/^[ \\t]*(ENTRY|ENTRY2|ALTENTRY)[ \\t]*\\(([a-zA-Z0-9_]+)/\\2/f,function/" // for assmebly definitions
});
}
boolean ctagsRunning = true;
try {
ctagsRunning = false;
// ctags is dead! we must restart!!!
} catch (IllegalThreadStateException exp) {
// ctags is still running :)
}
if (!ctagsRunning) {
initialize();
}
//log.fine("doing >" + file + "<");
return defs;
//log.fine("DONE >" + file + "<");
}
return null;
}
try {
do {
//log.fine("Tagline:-->" + tagLine+"<----ONELINE");
try {
} catch (Exception e) {
}
return ;
}
return;
}
if (p <= 0) {
//log.fine("SKIPPING LINE - NO TAB");
continue;
}
//log.fine(" p = " + p + " lp = " + lp);
//log.fine("FIELD===" + fld);
lp = p;
break;
} else {
}
}
} else {
continue;
}
//log.fine("Param = "+ arg);
if (ptr > 0) {
}
}
//log.fine("Param Def = "+ argDef);
}
}
}
//log.fine("Read = " + def + " : " + lnum + " = " + kind + " IS " + inher + " M " + match);
} while (true);
} catch (Exception e) {
}
}
}