How do I access an AST of parsed C++ code?

Discussion in 'C++' started by ssaammee@gmail.com, May 23, 2006.

  1. Guest

    I have legacy ADA and C++ code, and I need to export this code into an
    XML format so I can create a tool to analyze and work with it. I tried
    various tree-dump-* commands with g++ and didn't find anything that
    looked to be read-able or anything that was at a high level like my
    code (GIMPLE was much to low level for me because I want to maintain
    variable names and such).

    Is there a way I can access the parser for either C++ or ADA so that I
    can access a high level parsed version of my code (such as an AST)? If
    not, can a parser dump command be recommended?

    Any help would be appreciated!

    Thank you,
    -Sam Edwards
    Sedwards At Harmonia Dot Com
     
    , May 23, 2006
    #1
    1. Advertising

  2. Jim Langston Guest

    <> wrote in message
    news:...
    >I have legacy ADA and C++ code, and I need to export this code into an
    > XML format so I can create a tool to analyze and work with it. I tried
    > various tree-dump-* commands with g++ and didn't find anything that
    > looked to be read-able or anything that was at a high level like my
    > code (GIMPLE was much to low level for me because I want to maintain
    > variable names and such).
    >
    > Is there a way I can access the parser for either C++ or ADA so that I
    > can access a high level parsed version of my code (such as an AST)? If
    > not, can a parser dump command be recommended?
    >
    > Any help would be appreciated!


    I'm not sure I understand your problem. Do you have the actual ADA and C++
    source files as text files? And you are trying to convert them to XML?
    What do you mean by a "high level parsed version"?
     
    Jim Langston, May 23, 2006
    #2
    1. Advertising

  3. Guest

    I have actual source files as text files. I want to put this into a
    xml representation though, and in order to get things like mathematical
    operations to execute in the correct order, I want to use an AST to try
    and accomplish this.
     
    , May 23, 2006
    #3
  4. Ira Baxter Guest

    <> wrote in message
    news:...
    > I have legacy ADA and C++ code, and I need to export this code into an
    > XML format so I can create a tool to analyze and work with it. I tried
    > various tree-dump-* commands with g++ and didn't find anything that
    > looked to be read-able or anything that was at a high level like my
    > code (GIMPLE was much to low level for me because I want to maintain
    > variable names and such).
    >
    > Is there a way I can access the parser for either C++ or ADA so that I
    > can access a high level parsed version of my code (such as an AST)? If
    > not, can a parser dump command be recommended?


    >Thank you,
    >-Sam Edwards
    >Sedwards At Harmonia Dot Com



    The DMS Software Reengineering Toolkit has robust parsers for Ada83, Ada95
    and a wide variety of C++ dialects including Visual Studion 2005.
    It has an option to export its ASTs as XML.

    See http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html


    --
    Ira Baxter, CTO
    www.semanticdesigns.com
     
    Ira Baxter, May 23, 2006
    #4
  5. Ira Baxter Guest

    <> wrote in message
    news:...
    > I have legacy ADA and C++ code, and I need to export this code into an
    > XML format so I can create a tool to analyze and work with it. I tried
    > various tree-dump-* commands with g++ and didn't find anything that
    > looked to be read-able or anything that was at a high level like my
    > code (GIMPLE was much to low level for me because I want to maintain
    > variable names and such).
    >
    > Is there a way I can access the parser for either C++ or ADA so that I
    > can access a high level parsed version of my code (such as an AST)? If
    > not, can a parser dump command be recommended?
    >
    > Any help would be appreciated!
    >
    > Thank you,
    > -Sam Edwards
    > Sedwards At Harmonia Dot Com


    The DMS Software Reengineering Toolkit provides generalized compiler
    technology
    for parsing, analysing and transforming source langauges. It can parse to
    ASTs
    and produce XML as an optoin. It has robust front ends for Ada83 and 95,
    and a variety of dialects of C++, including ANSI, GNU, and MS Visual Studio
    2005.
    See http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html


    --
    Ira Baxter, CTO
    www.semanticdesigns.com

    [Sorry if this is a duplicate. MS Outlook choked on the first reply,
    so I don't know if it went out.]
     
    Ira Baxter, May 23, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yermat

    Ast tree and python code

    Yermat, Mar 3, 2004, in forum: Python
    Replies:
    1
    Views:
    413
    Ira Baxter
    Mar 6, 2004
  2. Robert Brewer

    RE: Ast tree and python code

    Robert Brewer, Mar 3, 2004, in forum: Python
    Replies:
    1
    Views:
    348
    Yermat
    Mar 4, 2004
  3. Ricardo Santos

    Python AST -> source code

    Ricardo Santos, Jul 16, 2004, in forum: Python
    Replies:
    4
    Views:
    704
    Michael Hudson
    Jul 20, 2004
  4. Kenneth McDonald
    Replies:
    1
    Views:
    409
    =?iso-8859-1?Q?Fran=E7ois?= Pinard
    Oct 10, 2004
  5. Glich
    Replies:
    2
    Views:
    257
    Glich
    Oct 29, 2007
Loading...

Share This Page