CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Posts
    6

    Diagram Implementation C#

    Hello dear C# programmers,

    I have to create a school project.
    The project will be written in C#. I need to read a text file that contains
    code in 'C language', and create a Diagram based on the code from the text file.
    Basically it should create some sort of tree of 'C commands', so than, I will be able to draw a flow diagram based on that tree using .Net GDI.

    I really need some help on how to implement this,
    or if anyone have any ideas for this "insane" project, please I really need
    your help.

    Sincerely,

    sunny542

  2. #2
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Diagram Implementation C#

    Quote Originally Posted by sunny542
    ...or if anyone have any ideas for this "insane" project, please I really need your help.
    Hi sunny !

    Doesn't look as an insane project looks like a high school project. So better do some basic studies in C# and about OOP and Interfaces.

    The only 'strange' thing on this is the 'tree' of C commands But I think this is maybe depending on what is meant with a 'tree' Maybe its more something like a syntax -semantic analyser.
    to separate syntax tokens from other code.

    So first you need to separate things into different logical parts of your testcode. and find out which elements creates a node.

    E.g. you have to find out words and groups like if (....) {}
    of for(;{} statements and then evaluating them by their significance.

    So when you analyse your code your 'tree' maybee would look like
    Code:
    if (expression )
    |		 |
    yes		 no
    |		 | 
    do A		 do b
    |		 |
    	 |
    	 do anything
    Ant this then can be dawn as a graphic like a flow chart.

    I would suggest you to read MS Visual C# 2005 step by step. There is one example which shows a small part of a Token analyzer as an example for the usage of Interfaces. Studying this could maybe give you some basic ideas how to go into that.
    Last edited by JonnyPoet; October 12th, 2007 at 03:17 PM.
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured