Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add support for execution/control flow analysis #2734

Closed
tempuser1909 opened this issue Nov 1, 2018 · 13 comments
Closed

feature: add support for execution/control flow analysis #2734

tempuser1909 opened this issue Nov 1, 2018 · 13 comments
Labels

Comments

@tempuser1909
Copy link
Contributor

tempuser1909 commented Nov 1, 2018

Hi,

I would like to ask if it has been proposed to have execution/control flow analysis?

For example, instead having just one CtModel when you call launcher#buildModel(), Spoon can have another model (maybe something like CtExecutionModel/CtExecutionGraph) that is still tied to CtModel but allows user to analyze the parsed code in a different way.

Or maybe Spoon is just meant to be purely for AST analysis?

Thank you.

@pvojtechovsky
Copy link
Collaborator

There is an experimental project on github which contains such spoon extension for control flow analysis. But it is actually not up to date with latest Spoon and it is not finished. But I am sure it would be good starting point. I agree that it would be nice to have it as part of Spoon core too.
@monperrus what is the link to that project?

@nharrand
Copy link
Collaborator

nharrand commented Nov 1, 2018

Maybe this one?
But I agree it would be nice to have!

@monperrus
Copy link
Collaborator

@monperrus
Copy link
Collaborator

@tempuser1909 such a feature would be welcome, do you plan to contribute with a pull-request?

@monperrus monperrus changed the title Would Spoon have execution/control flow analysis as a feature in the future? feature: add support for execution/control flow analysis Nov 3, 2018
@tempuser1909
Copy link
Contributor Author

tempuser1909 commented Nov 5, 2018

@monperrus, I can try and see if I can implement such a big feature.

I will first try implementing one of the issues I have raised a couple months ago (#2396).

And once I am comfortable with developing/compiling Spoon and with Spoon internals, I will try my hand at implementing this.

@pvojtechovsky
Copy link
Collaborator

I can try and see if I can implement such a big feature.
And once I am comfortable with developing/compiling Spoon and with Spoon internals, I will try my hand at implementing this.

It sounds really great! You have our support! 👍

I will first try implementing one of the issues I have raised a couple months (#2396).

It would be nice to have it too, but may be with sniper printing mode this feature is not so urgent for you?

@tempuser1909
Copy link
Contributor Author

Yes, it is not as urgent with Sniper mode. However, I thought that it would be easier to implement and at the same time get to know Spoon's internals better with that issue first.

@nharrand
Copy link
Collaborator

I guess #2827 implements this feature request. So, I am closing this. Don't hesitate to reopen if it's missing something.

@monperrus
Copy link
Collaborator

FYI:
TinyPDG https://github.com/YoshikiHigo/TinyPDG is a library for building control flow graphs (CFGs) and program dependency graphs (PDGs) from Java source code. It also includes functionality to detect code clones by using the built PDGs. By @YoshikiHigo

@lsafina
Copy link

lsafina commented Oct 23, 2020

Hello! It is probably too late for this post, but I was looking for java to CFG library, and unfortunately haven't found this thread at the beginning (*feeling super dumb*). So I wrote my converter, completely based on Spoon model. I leave the link here, maybe someone will be interested https://gitlab.inria.fr/lsafina/java-cfg-builder

P.S: After finding this thread I wanted to check on control-flow library, but wasn't able to resolve the dependency and to find it at https://mvnrepository.com/artifact/fr.inria.gforge.spoon. Is it alright?

@monperrus
Copy link
Collaborator

thanks for the pointer.

yes, spoon-control-flow is not deployed on Maven Central, you can build and install from source.

@LakshyAAAgrawal
Copy link
Contributor

Shall I create a PR to remove the following lines from https://github.com/INRIA/spoon/tree/master/spoon-control-flow/README.md

To use it with maven, add the following dependency to your pom.xml

    <dependency>
        <groupId>fr.inria.gforge.spoon</groupId>
        <artifactId>spoon-control-flow</artifactId>
        <version>0.0.2</version>
    </dependency>

@monperrus
Copy link
Collaborator

monperrus commented Mar 9, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants