-
Notifications
You must be signed in to change notification settings - Fork 174
GumTree API
Jean-Rémy Falleri edited this page Jun 18, 2015
·
14 revisions
It is possible to process source code file directly from the Java code. Here are some examples.
String file = "myfile.java"
TreeContext tc = TreeGeneratorRegistry.getInstance().getGenerator(file).generateFromFile(file);
ITree t = tc.getRoot() // return the root of the tree
ITree src, dst;
...
Matcher m = GumtreeMatchers.CompleteGumtreeMatcherFactory.newMatcher(src, dst);
m.match();
MappingStore m = m.getMappings();
ITree src, dst;
...
Matcher m = GumtreeMatchers.CompleteGumtreeMatcherFactory.newMatcher(src, dst);
m.match();
ActionGenerator g = new ActionGenerator(src, dst, m);
g.generate();
List<Action> actions = g.getActions();