Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Problem with the Logic

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Problem with the Logic

    Hi there,
    I have just 6 months familiarity with JAVA so excuse me if I am being foolish sometimes. ..
    My objective is to create an application in Java which should be able to create a flow chart of a Java program once its source code is given as input to the application. It should also be able to generate a basic class hierarchy or functional hierarchy (If there is one) by reading the source code of the application. Now my problem is that I am researching on this since two weeks but didn't get anything significant.......My approach to do this would be

    1. Parse the Java Program..extract as much info as I can
    2. Use tis info to generate the flow chart and all

    now problem with the first is I need to write grammars to parse the java program...and it may complicate the project....so Can you people suggest any other solution or a more elegant approach....

    To generate gramars I am thinking of using Antlr is it the right choice or Is there something better??...and even better can anyone guide me on ow to write full fledged grammar to parse a Java Program So that the stated objectives can be achieved???...
    hanks in advance.....plz help


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Problem with the Logic

    Well, this looks something more related to Artificial Intelligence. You should try to solve it step by step. I'll recommend you to have a notebook and pencil and a piece of code and try to make flowchart with your mind. Now, start reading and understanding your mind as deep as you can.
    How you will see the code?
    From where will you start reading the code?
    How will you behave against each line of code/logic?
    And many other small things, as smaller as you can to simplify your logic into generic one.

    I don't know what do you mean by grammer, but i think you mean, giving terms to some logic... Am i right??
    Anyways, this is the solution that can lead you to solve your problem.
    Don't think of API's in the very start, instead first create a logic and then look over different API's that will help you to accomplish your task in the all possible, efficient manner.

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Problem with the Logic

    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Problem with the Logic

    Damn!!! The main problem is the lost of effort...

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Problem with the Logic

    Quote Originally Posted by Mr.777 View Post
    Damn!!! The main problem is the lost of effort...
    True that, yo.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. whats logic behind this?
    By X0X0 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 26th, 2011, 02:48 PM
  2. Help with java logic
    By dever in forum What's Wrong With My Code?
    Replies: 7
    Last Post: February 7th, 2011, 08:41 AM
  3. Latin square logic
    By Deprogrammer in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 21st, 2010, 09:38 AM
  4. Need Help with Operators/ logic
    By codekiller in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 3rd, 2010, 09:25 AM
  5. Simple recursion logic
    By chronoz13 in forum Algorithms & Recursion
    Replies: 3
    Last Post: December 24th, 2009, 10:53 PM

Tags for this Thread