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.
Printable View
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.
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?
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.
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.
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.
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/
Thanks
Please help. Now i want to parse the AST generated by the ELSA Tool.
How to do that ? Please elaborate on that.