Skip to content

Generate function ASTs from Java code to create type inference dataset

Notifications You must be signed in to change notification settings

neurosyntax/mokuton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mokuton

Generates abstract syntax trees from function source code and then inserts it and the input types and output types back into MongoDB.

Dependencies: javalang, pymongo

Refer to https://docs.mongodb.com/getting-started/python/client/ for more info on pymongo

Note:

  • All strings are returned as unicode
  • javalang parser expects a syntactically correct class, so need a class template to place functions into.

Example:

public class HelloWorld{public static void main(String args[]){if(true){while(true){}}else{}}}

Flattened:
(MethodDeclaration (FormalParameter(ReferenceType))(IfStatement(Literal)(BlockStatement (WhileStatement(Literal)(BlockStatement)))(BlockStatement)))

Expanded:
(MethodDeclaration 
	(FormalParameter
		(ReferenceType)
	)
	(IfStatement
		(Literal)
		(BlockStatement
			(WhileStatement
				(Literal)
				(BlockStatement)
			)
		)
		(BlockStatement)
	)
)

MOKUTON NO JUTSU!!! senju

Releases

No releases published

Packages

No packages published

Languages