[cfe-dev] [llvm-dev] Source to Source

mats petersson via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 6 10:55:47 PDT 2016


On 6 April 2016 at 17:17, David Castells Rufas <david.castells at gmail.com>
wrote:

> I would like to manipulate the AST from a C++ source code from a Java
> application. As far as I know there are no good and open source methods to
> get a detailed AST from C++ in Java.
>
> May it be that clang (as it happens in gcc) try to discourage people to
> work with the AST outside llvm tools because of uninteded license use fears?
>
>
> That isn't my understanding, but I'm not sure, if someone knows more
please comment - I'm reasonably sure the emit-ast is not intended to be
used as input to other programs, it is intended to help with development of
the clang tool itself.

I'm not familiar with what support there is in Java to use Clang/LLVM
tools, but I'd be surprised if there isn't someone that has built a set of
Java bindings to the Clang tools. [But google seems to make me surprised,
since I can't find a good, fresh variant - there are some for 3.3, but
that's like 3-4 years ago].

--
Mats

>
> On Wed, Apr 6, 2016 at 1:53 PM, mats petersson <mats at planetcatfish.com>
> wrote:
>
>> What do you want to "do" with the file generated? In general, I would
>> have thought the tools provided by Clang would be more suitable than trying
>> to parse the output from clang with this option - it's more of a tool to
>> debug the compiler than something intended to use for further processing.
>> Clang already comes with several sets of tools for reformatting,
>> modifying/matching code patterns, etc.
>>
>> I'm also copying the reply to "cfe-dev" that is the mailing list for
>> Clang and related tools, rather than the llvm-dev, which is the mailing
>> list for the LLVM part of the clang+llvm set of tools/products.
>>
>> --
>> Mats
>>
>> On 6 April 2016 at 11:26, David Castells Rufas via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>
>>> Dear all,
>>>
>>> I'm new to the mailing list.
>>>
>>> I'm trying to find the file format description of the AST files
>>> generated with
>>> >clang -emit-ast ...
>>>
>>>
>>> Could you give me any pointer? Thanks
>>>
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> llvm-dev at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160406/4dbede73/attachment.html>


More information about the cfe-dev mailing list