CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    10

    Abstract Syntax Tree Generator Tool

    Hello , i need an Open Source AST Generator tool. Can anyone plz specify any tool to which can generate AST .

    I found one named GNU - Profiler tool for the same . But i m not able to Understand that.
    guyz plz help.

  2. #2

    Re: Abstract Syntax Tree Generator Tool

    Most compiler compilers or parser toolkits can be made to output a representation of an AST given the grammar of the language to be parsed. This has very little to do with profiling tools.

    Do you have a grammar for the language you're thinking of, or is it a standard language?

    Do you have a preference for the language the compiler compiler generates, or the parser uses?

  3. #3
    Join Date
    Feb 2009
    Posts
    10

    Re: Abstract Syntax Tree Generator Tool

    Yes i want that tool for 'C language'.

    i want the tool to generate AST for any C code supplied to it.

    Plz help.

    Thanks in advance.

  4. #4

    Re: Abstract Syntax Tree Generator Tool

    There is an option in gcc (-fdump-translation-unit) to dump AST information, but then you have to process that yourself. The Elsa C++ parser has a direct AST interface in C++, which might be suitable unless you're a C purist. Or any other parser will generate a parse tree you can process to an AST, and many have C grammars already available for them.

  5. #5
    Join Date
    Feb 2009
    Posts
    10

    Re: Abstract Syntax Tree Generator Tool

    Hey thnks for the info. can u plz elaborate on more tools please.

    Also what is a GNU - GProfiler.

    Also Can i use the Elsa Code in my project and under which license?

    Thanks in advance.
    Last edited by agutal; February 28th, 2009 at 02:10 AM.

  6. #6

    Re: Abstract Syntax Tree Generator Tool

    There are many other parser tools - google for the names yacc, bison, antlr, rats, javacc, and I'm sure others. Too many to elaborate on without a specific question, and most of them I haven't used.

    I don't know anything about 'GProfiler'. GNU's profiler is called 'gprof', which reports how much time a program spends in each function, and that information lets you improve the running time of the software by targeting your optimisations better.

    The Elsa/Elkhound code is released under the BSD license - see their main page at http://www.cs.berkeley.edu/~smcpeak/elkhound/

  7. #7
    Join Date
    Feb 2009
    Posts
    10

    Smile Re: Abstract Syntax Tree Generator Tool

    Thanks

  8. #8
    Join Date
    Feb 2009
    Posts
    10

    Re: Abstract Syntax Tree Generator Tool

    Please help. Now i want to parse the AST generated by the ELSA Tool.

    How to do that ? Please elaborate on that.

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