org.eclipse.wst.jsdt.core.dom.FunctionDeclaration Java Examples

The following examples show how to use org.eclipse.wst.jsdt.core.dom.FunctionDeclaration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FunctionRetriever.java    From api-mining with GNU General Public License v3.0 5 votes vote down vote up
public static Map<String, FunctionDeclaration> getFunctionNodes(
		final String file) throws Exception {
	final JavascriptASTExtractor astExtractor = new JavascriptASTExtractor(
			false);
	final FunctionRetriever m = new FunctionRetriever();
	final ASTNode cu = astExtractor.getCompilationUnitAstNode(file);
	cu.accept(m);
	return m.functions;
}
 
Example #2
Source File: JavascriptCyclomaticCalculator.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration arg0) {
	/*
	 * if (isConcrete(arg0)) { complexity.startMethod(); return
	 * super.visit(arg0); } return false;
	 */
	complexity++; // TODO: Not exactly true, but we'll use that
	return super.visit(arg0);
}
 
Example #3
Source File: FunctionRetriever.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Map<String, FunctionDeclaration> getFunctionNodes(
		final String file) throws Exception {
	final JavascriptASTExtractor astExtractor = new JavascriptASTExtractor(
			false);
	final FunctionRetriever m = new FunctionRetriever();
	final ASTNode cu = astExtractor.getCompilationUnitAstNode(file);
	cu.accept(m);
	return m.functions;
}
 
Example #4
Source File: FunctionRetriever.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Map<String, FunctionDeclaration> getFunctionNodes(
		final File file) throws IOException {
	final JavascriptASTExtractor astExtractor = new JavascriptASTExtractor(
			false);
	final FunctionRetriever m = new FunctionRetriever();
	final JavaScriptUnit cu = astExtractor.getAST(file);
	cu.accept(m);
	return m.functions;
}
 
Example #5
Source File: JavascriptCyclomaticCalculator.java    From tassal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration arg0) {
	/*
	 * if (isConcrete(arg0)) { complexity.startMethod(); return
	 * super.visit(arg0); } return false;
	 */
	complexity++; // TODO: Not exactly true, but we'll use that
	return super.visit(arg0);
}
 
Example #6
Source File: FunctionRetriever.java    From tassal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Map<String, FunctionDeclaration> getFunctionNodes(
		final String file) throws Exception {
	final JavascriptASTExtractor astExtractor = new JavascriptASTExtractor(
			false);
	final FunctionRetriever m = new FunctionRetriever();
	final ASTNode cu = astExtractor.getCompilationUnitAstNode(file);
	cu.accept(m);
	return m.functions;
}
 
Example #7
Source File: FunctionRetriever.java    From tassal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Map<String, FunctionDeclaration> getFunctionNodes(
		final File file) throws IOException {
	final JavascriptASTExtractor astExtractor = new JavascriptASTExtractor(
			false);
	final FunctionRetriever m = new FunctionRetriever();
	final JavaScriptUnit cu = astExtractor.getAST(file);
	cu.accept(m);
	return m.functions;
}
 
Example #8
Source File: JavascriptCyclomaticCalculator.java    From api-mining with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration arg0) {
	/*
	 * if (isConcrete(arg0)) { complexity.startMethod(); return
	 * super.visit(arg0); } return false;
	 */
	complexity++; // TODO: Not exactly true, but we'll use that
	return super.visit(arg0);
}
 
Example #9
Source File: FunctionRetriever.java    From api-mining with GNU General Public License v3.0 5 votes vote down vote up
public static Map<String, FunctionDeclaration> getFunctionNodes(
		final File file) throws IOException {
	final JavascriptASTExtractor astExtractor = new JavascriptASTExtractor(
			false);
	final FunctionRetriever m = new FunctionRetriever();
	final JavaScriptUnit cu = astExtractor.getAST(file);
	cu.accept(m);
	return m.functions;
}
 
Example #10
Source File: JavascriptASTExtractor.java    From api-mining with GNU General Public License v3.0 4 votes vote down vote up
private final FunctionDeclaration getFirstFunctionDeclaration(
		final ASTNode node) {
	final TopFunctionRetriever visitor = new TopFunctionRetriever();
	node.accept(visitor);
	return visitor.topDcl;
}
 
Example #11
Source File: FunctionRetriever.java    From tassal with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	functions.put(node.getName().toString(), node);
	return super.visit(node);
}
 
Example #12
Source File: NodeFinder.java    From tassal with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	return visitNode(node);
}
 
Example #13
Source File: JavascriptASTExtractor.java    From tassal with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	topDcl = node;
	return false;
}
 
Example #14
Source File: JavascriptASTExtractor.java    From tassal with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private final FunctionDeclaration getFirstFunctionDeclaration(
		final ASTNode node) {
	final TopFunctionRetriever visitor = new TopFunctionRetriever();
	node.accept(visitor);
	return visitor.topDcl;
}
 
Example #15
Source File: JavascriptASTExtractor.java    From api-mining with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	topDcl = node;
	return false;
}
 
Example #16
Source File: NodeFinder.java    From api-mining with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	return visitNode(node);
}
 
Example #17
Source File: FunctionRetriever.java    From api-mining with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	functions.put(node.getName().toString(), node);
	return super.visit(node);
}
 
Example #18
Source File: FunctionRetriever.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	functions.put(node.getName().toString(), node);
	return super.visit(node);
}
 
Example #19
Source File: NodeFinder.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	return visitNode(node);
}
 
Example #20
Source File: JavascriptASTExtractor.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public boolean visit(final FunctionDeclaration node) {
	topDcl = node;
	return false;
}
 
Example #21
Source File: JavascriptASTExtractor.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private final FunctionDeclaration getFirstFunctionDeclaration(
		final ASTNode node) {
	final TopFunctionRetriever visitor = new TopFunctionRetriever();
	node.accept(visitor);
	return visitor.topDcl;
}