Coder Social home page Coder Social logo

sourcedg's People

Contributors

crrivero avatar victorjmarin avatar

Stargazers

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

Watchers

 avatar

sourcedg's Issues

Get all data sharing dependence

Hi, great work!
I'm trying to extract all data sharing dependence between nodes in the PDG. With data sharing I mean that if I have two statements S1 and S2, if they both appear in the same execution path thus they share some data, for example:
If I have this code

public void main() {
        String str = read();
        boolean valid = isValid(str);
        if (valid) {
            foo(str);
        } else {
            bar(str);
        }
    }

the function read is linked to: isValid, foo and bar because data dependence (i.e. I found and Edge of type Data in the PDG), but I need to track also that the function isValid is linked to foo and bar because data sharing. Indeed the result of isValid choose which function call.
Can you help me with that?
Thank you

Getting exception "com.github.javaparser.ParseProblemException"

Hii,

I am trying to generate Program Dependence Graph using sourcedg. When I tried executing the file Test.java I got the exception "Exception in thread "main" com.github.javaparser.ParseProblemException: (line 1,col 10) Parse error. Found "int", expected one of ";" "@" "class" "enum" "interface" "module" "open""
Below is the code for which I am trying to generate the PDG
`public static int srch()
{
int c, first, last, middle, n, search, array[];
first = 0;
last = n - 1;
middle = (first + last)/2;

while( first <= last )
{
  if ( array[middle] < search )
    first = middle + 1;
  else if ( array[middle] == search )
  {
    return middle+1;
  }
  else
     last = middle - 1;

  middle = (first + last)/2;

}
if ( first > last )
return 0;
}
`

And the stack trace is:

Exception in thread "main" com.github.javaparser.ParseProblemException: (line 1,col 10) Parse error. Found "int", expected one of ";" "@" "class" "enum" "interface" "module" "open"
Problem stacktrace :
com.github.javaparser.GeneratedJavaParser.generateParseException(GeneratedJavaParser.java:10271)
com.github.javaparser.GeneratedJavaParser.jj_consume_token(GeneratedJavaParser.java:10130)
com.github.javaparser.GeneratedJavaParser.CompilationUnit(GeneratedJavaParser.java:179)
com.github.javaparser.JavaParser.parse(JavaParser.java:126)
com.github.javaparser.JavaParser.simplifiedParse(JavaParser.java:325)
com.github.javaparser.JavaParser.parse(JavaParser.java:159)
com.github.javaparser.JavaParser.parse(JavaParser.java:172)
edu.rit.goal.sourcedg.builder.PDGBuilder.build(PDGBuilder.java:48)
edu.rit.goal.sourcedg.Test.main(Test.java:19)

at com.github.javaparser.JavaParser.simplifiedParse(JavaParser.java:329)
at com.github.javaparser.JavaParser.parse(JavaParser.java:159)
at com.github.javaparser.JavaParser.parse(JavaParser.java:172)
at edu.rit.goal.sourcedg.builder.PDGBuilder.build(PDGBuilder.java:48)
at edu.rit.goal.sourcedg.Test.main(Test.java:19)

Process finished with exit code 1

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.