GithubHelp home page GithubHelp logo

gumtreediff / gumtree Goto Github PK

View Code? Open in Web Editor NEW
872.0 25.0 169.0 19.19 MB

An awesome code differencing tool

Home Page: https://github.com/GumTreeDiff/gumtree/wiki

License: GNU Lesser General Public License v3.0

Java 78.44% GAP 3.79% Ruby 0.86% Dockerfile 0.15% JavaScript 0.69% Jupyter Notebook 16.06%
diff abstract-syntax-tree gumtree

gumtree's Introduction

GumTree

An awesome code differencing tool that you can integrate with Git!

Status

Build and Test GumTree

Description

GumTree is a syntax-aware diff tool. It improves text-based diff tools in two important ways:

  • the edit actions are always aligned with the syntax,
  • it can detect moved or renamed elements in addition of deleted and inserted code.

Documentation

To use GumTree, you can start by consulting the Getting Started page from our wiki. If you have a question to ask, please use GitHub's discussions instead of opening an issue.

Screenshots

The directory diff viewer

Directory comparator view

The file diff viewer

Diff view on a CSS file

Diff view on a Java file

Supported languages

We already deal with a wide range of languages: C, Java, JavaScript, Python, R, Ruby. Click here for more details about the language we support.

More languages are coming soon, if you want to help contact me.

Citing GumTree

We are researchers, therefore if you use GumTree in an academic work we would be really glad if you cite our seminal paper using the following bibtex:

@inproceedings{DBLP:conf/kbse/FalleriMBMM14,
  author    = {Jean{-}R{\'{e}}my Falleri and
               Flor{\'{e}}al Morandat and
               Xavier Blanc and
               Matias Martinez and
               Martin Monperrus},
  title     = {Fine-grained and accurate source code differencing},
  booktitle = {{ACM/IEEE} International Conference on Automated Software Engineering,
               {ASE} '14, Vasteras, Sweden - September 15 - 19, 2014},
  pages     = {313--324},
  year      = {2014},
  url       = {http://doi.acm.org/10.1145/2642937.2642982},
  doi       = {10.1145/2642937.2642982}
}

gumtree's People

Contributors

algomaster99 avatar balzguenat avatar caiusb avatar captainemerson avatar cdmihai avatar duesee avatar florianlehmann avatar glgarg avatar jpienaar avatar jrfaller avatar koppor avatar lmove avatar logsec avatar macsj200 avatar mahtab-nejati avatar martinezmatias avatar monperrus avatar morandat avatar narmion avatar npalix avatar pouryafard75 avatar pvojtechovsky avatar rpau avatar staslev avatar symbolk avatar tnoalex avatar ulrichthomasgabor avatar usr-sse2 avatar vhellendoorn avatar yanamal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gumtree's Issues

C# Detailed Source Code change

Ran GumTree on the following two source files

left.cs.zip
right.cs.zip

Got the following output.
screen shot 2016-10-25 at 4 19 06 pm

As one can see there is "Comment Change" (deletion) and "Condition Change" (deletion),GumTree labels both of them as "function/block". To my knowledge GumTree uses srcML for generating AST for C# , and I do see tags line "comment" , "condition" in their documentation . Is it possible to show the changes in more details ?

The resulting actions do not transform the original documento into the modified one

Hi,

I think this could be an implementation error. Focus the attention on the actions affecting the "Decode" method. They do not transform well the original source code into its modified version. The statement

"result = Regex.Replace(result, "&", "&", RegexOptions.IgnoreCase);" (line 106 in the original and 105 in the modified)

was deleted, but it was never recovered again (e.g., reinserted)

Analysis.zip

Strange diff output for C++

I get a strange output when using gumtree diff on these input files. The output from gumtree jsondiff seems normal, so this is most likely a bug. Note that I didn't minimize the test example, so it could be smaller.

I'm using commit 786aa9f

left.cpp

class Foo {
  void bar() { ; }
};

right.cpp

class Foo {
  void bar() {
    if (1) {
      ;
    }
  }
};

$ gumtree diff left.cpp right.cpp
yields

Insert block(12) into function(13) at 3
Insert 3357(11) into block(12) at 0
Insert -861311717(7) into 3357(11) at 0
Insert 3558941(10) into 3357(11) at 1
Insert 3127797(6) into -861311717(7) at 0
Insert block(9) into 3558941(10) at 0
Insert 182460591: 1(5) into 3127797(6) at 0
Move empty_stmt(5) into block(9) at 0
Delete block(6)

Implement Custom Data for Parsers in Tree

It would be very helpful for certain applications for the Gumtree node to have a link back to the native tree. This would be needed when someone wants to edit the original code based on what they have learned from the AST tree.

"The input line is too long." error on Windows 7 when trying to run built gumtree.bat

I followed instructions from here, got gumtree-20171214-2.1.0-SNAPSHOT.zip built, unzipped it in a folder and tried to run gumtree.bat without any arguments. That was the output:

The input line is too long.
The syntax of the command is incorrect.

While I was expecting to get some kind of a message from gumtree (e.g. help).

I believe that happens because of Gradle issue 1989 - it basically appends all libraries used as a command line argument, which the maximal length of a command line in Windows is capped by 8191.

One change is reported in the DIFF output, but it is not reported in the JSON variant...

Hi Guys,

I am collecting GumTreeโ€™s deltas over C# file pairs. I started by parsing the JSON output, but I am needing further information that is not available for this variant (e.g., label of each involved element). To do that, I am getting the DIFF output now and completing the information for the existing delta (the JSON initially stored). However, I have a case where the DIFF variant reports a change (move expr(853) to expr_stmt(1220)) that was not reported with the JSON variant.

I am moving to store the DIFF delta instead of the JSON one, but I am reporting this problem for your consideration.

Regards, Guillermo.

PD: I am attaching the revision pair.

RevisionPair.zip

Type Binding, Dependencies, and Line Binding

Hi,

Does gumtree bind types for an object in the AST? If so, what is the correct way to load dependencies for it to bind to?

Is there a way to get from a node in the AST to the line in the source file? I'm assuming there must be for IDEs to implement clicking on items.

Also, was there a particular reason you chose Eclipe's parser for Java over JavaParser (https://github.com/javaparser/javaparser)?

srcml process hangs in infinite loop causing system to get stuck

Hi,
We have found an interesting issue with srcml, because I could not find srcml git project I think you guys can help me.

When running Generators.getInstance().getTree(file) the process hangs and never finishs, I traced down to srcml call and discovered that the srcml command was in infinite loop, the .cs file was big and tooke me some time to discover which part of the file was causing the issue but here are the snippets to reproduce it, the first one hangs and the second works, the only differece is replacing new PublishingServices.PublishedPackageToken[template.Tokens.Count] by new PublishingServices.PublishedPackageToken[1]

srcml -l C# --position code1.cs

namespace AnyNamespace
{
	public class AnyClass
	{
        public static PublishResult PublishPackage()
		{
			PublishResult result = new PublishResult();
			PublishingServices.SinglePublishedPackageRequest initRequest = new PublishingServices.SinglePublishedPackageRequest();
			initRequest.Tokens = new PublishingServices.PublishedPackageToken[template.Tokens.Count];
			return result;
		}
    }
}

srcml -l C# --position code2.cs

namespace AnyNamespace
{
	public class AnyClass
	{
        public static PublishResult PublishPackage()
		{
			PublishResult result = new PublishResult();
			PublishingServices.SinglePublishedPackageRequest initRequest = new PublishingServices.SinglePublishedPackageRequest();
			initRequest.Tokens = new PublishingServices.PublishedPackageToken[1];
			return result;
		}
    }
}

Explanation on the numbers shown in the diff

Hello,
I have a question regarding the output.
When computing the diff, there are numbers in the bracket, for example "tasks(6)", "tasks(18)".
Can you explain what is the meaning of those numbers?


$ /Users/chen/Repository/gumtree/dist/build/distributions/gumtree-20170926-2.1.0-SNAPSHOT/bin/gumtree diff /Users/chen/Library/Mobile\ Documents/com~apple~CloudDocs/CS846/Project/Experiments/helloworld.java /Users/chen/Library/Mobile\ Documents/com~apple~CloudDocs/CS846/Project/Experiments/helloworld2.java
Match SimpleName: tasks(6) to SimpleName: tasks(18)
Match Block(11) to Block(30)
Match SimpleName: t(7) to SimpleName: t(19)
Match ExpressionStatement(10) to ExpressionStatement(22)
Match SimpleName: execute(8) to SimpleName: execute(20)
Match SingleVariableDeclaration(5) to SingleVariableDeclaration(17)
Match SimpleType: Task(3) to SimpleType: Task(15)
Match CompilationUnit(16) to CompilationUnit(35)
Match SimpleName: t(4) to SimpleName: t(16)
Match MethodInvocation(9) to MethodInvocation(21)
Match EnhancedForStatement(12) to EnhancedForStatement(31)
Match SimpleName: Task(2) to SimpleName: Task(14)
Match Block(13) to Block(32)
Match Modifier: public(0) to Modifier: public(0)
Match SimpleName: main(1) to SimpleName: main(1)
Match Initializer(14) to Initializer(33)
Match TypeDeclaration(15) to TypeDeclaration(34)

Matcher algorithms

Hi,

I could not find any documentation with regarding the Matchers, I would like to know about performance and why the results may differ from one to another.

I've been running the Matchers.getInstance().getMatcher(src, dst) and it always returns ZsMatcher as default, but this algorithm in some cases enters in infinite loop and never finishes.

I can provide more details about the scenario that ZsMatcher enters in infinite loop, but by now I would like to have more information about the available algorithms to help me decide which one to use.

Thanks.

Server internal error when viewing a diff via git

I am trying to use gumtree with git. After launching gumtree via difftool, I am able to browse to localhost:4754 but when trying to view the diff via this URL: http://127.0.0.1:4754/fr/labri/gumtree/client/diff0, it just returns this message:

SERVER INTERNAL ERROR: Serve() returned a null response.

There is no message in the terminal.

Problem because I cannot sign the release

When I try to build Gumtree I get an error saying:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project gumtree: Exit code: 127 -> [Help 1]

We probably don't want everyone to have to sign every time. There is a stack overflow that has a suggestion here:
http://stackoverflow.com/questions/14825039/suppressing-gpg-signing-for-maven-based-continous-integration-builds-travis-ci

We can do something else if need be as well.

Unintuitive node numbering in C edit scripts

I've noticed that the "jsondiff" and "diff" outputs of the gumtree executable produce edit scripts containing seemingly incorrect and inconsistent node IDs / numbers. Unfortunately, I don't seem to be able to find any documentation regarding the encoding used in the edit scripts? Based on my intuition, and the description given in the paper, the outputs certainly seem to be incorrect.

My assumption is that the node IDs used in the edit scripts are generated using a depth-first search of the tree, starting at 0 (at the Program node). Any "Update" edits I make seem to validate this assumption, but "Move", "Delete" and "Insert" commands all seem to either use a different ID scheme, or they're incorrect.

Example of incorrect(?) behaviour:
Take the program P, given by the source below:

int main() {
  printf("Hello");
  printf("world!");
}

Together with a modified form of the program P', given by the source code:

int main() {
  printf("Hello");
  printf("small");
  printf("universe!");
}

We yield the following diff from GumTree (gumtree diff P P'):

Insert ExprStatement(19) into Compound(29) at 1
Insert Some(18) into ExprStatement(19) at 0
Insert FunCall(16) into Some(18) at 0
Insert GenericString: ;(17) into Some(18) at 1
Insert Ident(12) into FunCall(16) at 0
Insert GenericList(15) into FunCall(16) at 1
Insert GenericString: printf(11) into Ident(12) at 0
Insert Left(14) into GenericList(15) at 0
Insert Constant: "small"(13) into Left(14) at 0
Update Constant: "world!"(13) to "universe!"

Using a little script I wrote, we get the following node numbers for P (where the second number is the position of the node in the corresponding file):

Assigning number 0 to Program at 0
Assigning number 1 to Definition at 0
Assigning number 2 to Definition at 0
Assigning number 3 to ParamList at 8
Assigning number 4 to GenericString at 4
Assigning number 5 to Compound at 11
Assigning number 6 to ExprStatement at 15
Assigning number 7 to Some at 15
Assigning number 8 to FunCall at 15
Assigning number 9 to Ident at 15
Assigning number 10 to GenericString at 15
Assigning number 11 to GenericList at 21
Assigning number 12 to Left at 22
Assigning number 13 to Constant at 22
Assigning number 14 to GenericString at 30
Assigning number 15 to ExprStatement at 34
Assigning number 16 to Some at 34
Assigning number 17 to FunCall at 34
Assigning number 18 to Ident at 34
Assigning number 19 to GenericString at 34
Assigning number 20 to GenericList at 40
Assigning number 21 to Left at 41
Assigning number 22 to Constant at 41
Assigning number 23 to GenericString at 50
Assigning number 24 to FinalDef at 54

and the following numbers for P'

Assigning number 0 to Program at 0
Assigning number 1 to Definition at 0
Assigning number 2 to Definition at 0
Assigning number 3 to ParamList at 8
Assigning number 4 to GenericString at 4
Assigning number 5 to Compound at 11
Assigning number 6 to ExprStatement at 15
Assigning number 7 to Some at 15
Assigning number 8 to FunCall at 15
Assigning number 9 to Ident at 15
Assigning number 10 to GenericString at 15
Assigning number 11 to GenericList at 21
Assigning number 12 to Left at 22
Assigning number 13 to Constant at 22
Assigning number 14 to GenericString at 30
Assigning number 15 to ExprStatement at 34
Assigning number 16 to Some at 34
Assigning number 17 to FunCall at 34
Assigning number 18 to Ident at 34
Assigning number 19 to GenericString at 34
Assigning number 20 to GenericList at 40
Assigning number 21 to Left at 41
Assigning number 22 to Constant at 41
Assigning number 23 to GenericString at 49
Assigning number 24 to ExprStatement at 53
Assigning number 25 to Some at 53
Assigning number 26 to FunCall at 53
Assigning number 27 to Ident at 53
Assigning number 28 to GenericString at 53
Assigning number 29 to GenericList at 59
Assigning number 30 to Left at 60
Assigning number 31 to Constant at 60
Assigning number 32 to GenericString at 72
Assigning number 33 to FinalDef at 76

Notice, there is no Compound at 29. In fact, there is no node at 29 at all. But the Update constants refer to the correct nodes. Also, where are the IDs for the inserted elements coming from? Intuitively, I would expect the diff to provide a edit script that I could theoretically execute, using only the parsed AST of P.

All help would be much appreciated! Deepest apologies if the misunderstanding is on my part.

Many thanks,

Chris

Update: I now realise that GumTree is assigning numbers in post-order, rather than pre-order, as I had assumed. The insertion IDs are still off (they're the IDs after the event, not before; i.e. it's not a script from X to Y). I'm going to write a script to correct the IDs to produce the script I want :-)

Make a clear manual how to use it

I have dowloaded jar from releases page and then tried to launch and got nothing. Tried ``--help` and aalso got nothing. Is it missing some modules? Please, give a clear manual how to install and use it.

Use gumtree on C files -- cannot run 'cgum'

Hello! I am trying to use Gumtree to diff 2 C files. I followed the steps in the Getting Started page but I get an error (pasted below). Using Gumtree on 2 Java files works just fine. From what I can understand, it is unable to locate and run "cgum". Can someone help me resolve the problem? Is there any other way of using Gumtree on C files? I am not experienced in Java hence don't know where to start.

The command I used was gumtree diff a.c b.c

java.io.IOException: Cannot run program "cgum" (in directory "/tmp"): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at com.github.gumtreediff.gen.c.CTreeGenerator.generate(CTreeGenerator.java:72)
    at com.github.gumtreediff.gen.TreeGenerator.generateFromReader(TreeGenerator.java:32)
    at com.github.gumtreediff.gen.TreeGenerator.generateFromFile(TreeGenerator.java:38)
    at com.github.gumtreediff.gen.Generators.getTree(Generators.java:48)
    at com.github.gumtreediff.client.diff.AbstractDiffClient.getTreeContext(AbstractDiffClient.java:125)
    at com.github.gumtreediff.client.diff.AbstractDiffClient.getSrcTreeContext(AbstractDiffClient.java:113)
    at com.github.gumtreediff.client.diff.AbstractDiffClient.matchTrees(AbstractDiffClient.java:105)
    at com.github.gumtreediff.client.diff.TextDiff.run(TextDiff.java:98)
    at com.github.gumtreediff.client.Run.startClient(Run.java:89)
    at com.github.gumtreediff.client.Run.main(Run.java:117)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 10 more
** Error while running client diff: java.lang.NullPointerException

java.lang.OutOfMemoryError: Java heap space analyzing php file with gen-antlr.php

Hi there, I think there is a bug while analyzing this php file, do you think it is related to the fact that it has html and php in the same file?

Generators.getInstance().getTree("404.php")

the exception

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:3181)
	at java.util.ArrayList.grow(ArrayList.java:261)
	at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:235)
	at java.util.ArrayList.ensureCapacityInternal(ArrayList.java:227)
	at java.util.ArrayList.add(ArrayList.java:458)
	at org.antlr.runtime.BufferedTokenStream.fetch(BufferedTokenStream.java:146)
	at org.antlr.runtime.BufferedTokenStream.sync(BufferedTokenStream.java:137)
	at org.antlr.runtime.CommonTokenStream.consume(CommonTokenStream.java:71)
	at org.antlr.runtime.DFA.predict(DFA.java:120)
	at com.github.gumtreediff.gen.php.PhpParser.statement(PhpParser.java:309)
	at com.github.gumtreediff.gen.php.PhpParser.prog(PhpParser.java:231)
	at com.github.gumtreediff.gen.php.PhpTreeGenerator.getStartSymbol(PhpTreeGenerator.java:41)
	at com.github.gumtreediff.gen.antlr.AbstractAntlrTreeGenerator.generate(AbstractAntlrTreeGenerator.java:56)
	at com.github.gumtreediff.gen.TreeGenerator.generateFromReader(TreeGenerator.java:32)
	at com.github.gumtreediff.gen.TreeGenerator.generateFromFile(TreeGenerator.java:38)
	at com.github.gumtreediff.gen.Generators.getTree(Generators.java:43)

the content of the file to be analyzed

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>404 - Not Found</title>

	<link href='http://fonts.googleapis.com/css?family=Ubuntu&amp;subset=latin' rel='stylesheet' type='text/css'>

	<style type="text/css">
		body {
			background-color: #fff;
			margin: 45px 0 0 0;
			font-family: 'Ubuntu', sans-serif;
			font-size: 16px;
			color: #3f3f3f;
		}

		h1 {
			font-size: 40px;
			margin: 0 0 10px 0;
		}

		a {
			color: #000;
		}

		#wrapper {
			width: 740px;
			margin: 0 auto;
		}

		#content {
			padding: 10px 10px 10px 10px;
			background-color: #ffebe8;
			border: 1px solid #dd3c10;
			border-radius: 10px;
		}
	</style>
</head>
<body>
	<div id="wrapper">
		<?php
			$messages = array('Should we ask for directions?', 'This doesn\'t look familiar.', 'We need a map.');
			$message = $messages[mt_rand(0, 2)];
		?>

		<h1><?php echo $message; ?></h1>

		<div id="content">
			The resource you requested was not found.
			<br /><br />
			Would you like go to our <a href="<?php echo System\Config::get('application.url'); ?>">home page</a> instead?
		</div>
	</div>
</body>
</html>

Formal definition of edit script language

Please can you provide a more formal definition of the edit script operations and their encodings (with respect to any action serialiser), similar to the (incredibly useful) language definition for DUL. In particular, please could you clarify the node numberings used in the edit script operations, and if/how the order of operations affect the result?

At present time, it looks as if the output for certain operations is inconsistent, but without a clear, formal definition of the language, I can't be sure (and I can't use GumTree for my research until that point).

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" on webdiff

I am unable to run webdiff from the binary, getting the following error:

./gumtree webdiff tmp1.java tmp2.java

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

slf4j-api-1.7.25.jar and slf4j-simple-1.7.25.jar are in the lib folder, so I don't know what's going wrong.

Thanks!

how to get mappings between TreeNode and Source file??

My goal is to find matching line number of old file in new file. However, I go through the code base and read the apis, I fail to figure out any clue about source file location info. Can you be so nice to give me some recommendation ?

How can I use the API?

Hi all,
I want to call the GumTree API in Java to analyze the AST differences between two Java files, while it seems that the API document is not specific enough. So what are the specific methods? Or is there a demo? Thanks~

getting started

For a non Java person, the getting started web page is quite unhelpful.

"You will have a tar.gz distribution of GumTree in the dist/build/distributions folder."
Actually I got a .zip file.

"This server is accessible via the URL http://localhost:4754/."
Actually, I got http://127.0.0.1:4567

"java fr.labri.gumtree.client.Run webdiff file1.java file2.java"
This command doesn't work at all. It says "Error: Could not find or load main class fr.labri.gumtree.client.Run".

"You can check out the help of this class to discover the main commands."
I have no idea how to check out the help of a Java class. Running gumtree-20170215-2.1.0-SNAPSHOT/bin/gumtree --help did not really give any useful information. It seems that more information is available if one actually gives an invalid command.

Is there any way to get output that contains only the differences?

thanks,
julia

node name

Hello, could you please show me where I can get a node's name?
I mean, with jdt, I can use getName() to get my method name, e.g. "((MethodDeclaration) m).getName()".
But how to get it with gumtree?

Thank you very much. I'm waiting for your reply anxiously.

Return JSON Array of Actions

Hello-
I am totally willing to implement this, I just wanted to get some input about where should be the best place for it.
I could add a function called something like getJSONActions in ActionGenerator?
Perhaps Action should have a "toJSON" method that every action should then implement as well?

Does this sounds like a good plan, or do you have another suggestion?

direct processing of xml

It could be useful to take xml abstract syntax trees directly as input, for example, if one wants to work on a language for which a parser does not already exist.

Gumtree usage for c# source files

I am trying to use Gumtree to get source code differences between c# files. As mentioned in the Quickguide I have downloaded scrML and added it to the system path.
When I execute the command -
./gumtree-20160905 webdiff left.cs right.cs
It shows java.lang.UnsupportedOperationException: No generator found for file:
How to resolve this issue ?
Thanks

Verbosity control

When running Gumtree, there should be a way to avoid having it send its output to standard out.
This is an issue when running it as a library as then the output must be filtered out of standard out

Support for Python

Python has a rich AST module. We can most likely render this into an abstract representation pipe it into the existing infrastructure in this library. How might one go about adapting your code to do this?

Edit:
I saw your emailed suggestion to use a serialization format to read it into Java. I think I can render the tree into JSON, could I hand that off to your library?

I found ast2json, but it looks a little outdated. There's also this python-astexport github project, I'll look into these.

Getting Started

I cannot run the project since environment configuration problems have happened. Even setting up all dependencies, when I try to run the project, it always returns the same 'available commands.'
Even for this limited list, if I request to use the 'parse' command, for example, 'No generator found for file' could be identified.

It would be nice if the "Getting Started" page could provide solutions or insights of how to deal with problems.

Generate source code from a given GumTree AST

Is it possible to generate valid source code (not necessarily the original source code) from a GumTree AST? In particular, I'm interested in doing this for C. Ideally, it would be great if I could provide a JSON or XML GumTree AST file, to the gumtree binary, together with the language that the AST belongs to.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.