emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IDE


From: Evgeniy Dushistov
Subject: Re: IDE
Date: Fri, 23 Oct 2015 18:51:01 +0300
User-agent: Mutt/1.5.24 (2015-08-30)

On Fri, Oct 23, 2015 at 04:55:06PM +0200, David Engster wrote:
> Evgeniy Dushistov writes:
> > On Wed, Oct 21, 2015 at 06:52:55PM -0400, Eric Ludlam wrote:
> >> 
> >> Semantic doesn't demand it's parsers be in wisent, or even in Emacs at all.
> >> If you have a nice Ruby grammar in Ruby, and you can convert it's internal
> >> data into lisp-like syntax, pulling it into the Semantic system is pretty
> >> easy.  What you would loose is dynamic reparsing without having to save,
> >> thus it may be a bit quirky.
> >> 
> >
> > Is any documentation about this:
> > - format of data that Semantic understand
> 
> See chapter 1 in the Semantic AppDev manual:
> 
>   http://www.randomsample.de/cedetdocs/semantic-appdev/
> 

Thanks, I used 'info semantic' and have no idea that there is also
semantic-appdev


> > So I think it would be good integrate
> > rtags(https://github.com/Andersbakken/rtags) (or some another existing
> > daemon) for such complex language as c++ and cedet.
> 
> AFAIK, rtags solely uses libclang, which does not give you direct access
> to the AST, so I wouldn't know how rtags could be used to export the
> semantic tags of the current buffer. You could hook rtags into Semantic
> purely for the end-user features, like completion/references.
> 
> This is also why I will use libtooling for C++, which lets you walk the
> AST.

Why do you think that libclang not give access to AST?
I used it from python like this:

def callexpr_visitor(node, parent, parser):
# your code here
    for c in node.get_children():
        callexpr_visitor(c, node, parser)
    return 2 # means continue visiting recursively

tu = TranslationUnit.from_source(fname, args)
callexpr_visitor(tu.cursor, None, parser)

and callexpr_visitor  visit each node in AST.
Because of clang's python API just part of C/C++ API,
then it should be possible in rtags to have access to AST.


-- 
/Evgeniy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]