Java Code Examples for codemining.java.tokenizers.JavaTokenizer#tokenListFromCode()

The following examples show how to use codemining.java.tokenizers.JavaTokenizer#tokenListFromCode() . 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: JavaAstExtractorTest.java    From api-mining with GNU General Public License v3.0 5 votes vote down vote up
private boolean snippetMatchesAstTokens(final String snippetCode,
		final ASTNode node) {
	final JavaTokenizer tokenizer = new JavaTokenizer();
	final List<String> snippetTokens = tokenizer
			.tokenListFromCode(snippetCode.toCharArray());
	final List<String> astTokens = tokenizer.tokenListFromCode(node
			.toString().toCharArray());
	return astTokens.equals(snippetTokens);
}
 
Example 2
Source File: JavaAstExtractorTest.java    From tassal with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private boolean snippetMatchesAstTokens(final String snippetCode,
		final ASTNode node) {
	final JavaTokenizer tokenizer = new JavaTokenizer();
	final List<String> snippetTokens = tokenizer
			.tokenListFromCode(snippetCode.toCharArray());
	final List<String> astTokens = tokenizer.tokenListFromCode(node
			.toString().toCharArray());
	return astTokens.equals(snippetTokens);
}
 
Example 3
Source File: JavaAstExtractorTest.java    From codemining-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private boolean snippetMatchesAstTokens(final String snippetCode,
		final ASTNode node) {
	final JavaTokenizer tokenizer = new JavaTokenizer();
	final List<String> snippetTokens = tokenizer
			.tokenListFromCode(snippetCode.toCharArray());
	final List<String> astTokens = tokenizer.tokenListFromCode(node
			.toString().toCharArray());
	return astTokens.equals(snippetTokens);
}