[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is intellisense features integration in Emacs technically possible?
From: |
David Engster |
Subject: |
Re: Is intellisense features integration in Emacs technically possible? |
Date: |
Wed, 22 Jan 2014 18:36:00 +0100 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) |
Dmitry Gutov writes:
> David Engster <address@hidden> writes:
>
>>> Writing a C++ parser and semantic analyzer from scratch requires several
>>> man-years of work for world-class compiler writers.
>>
>> You don't need a full parser. For providing completions, it is
>> sufficient to parse only a small subset of the code (declarations, most
>> importantly).
>
> You may not have to parse every line of code, but you should be able to, no?
>
> Otherwise, how would you know which type the variable at point has,
By scanning the function's body for local variable declarations, and
simply ignore everything else. The C++ grammar simply has a bunch of
pretty generic expression rules without any actions, so we can skip over
the uninteresting stuff.
So yes, I wasn't specific enough: technically, we do parse function
bodies. But practically, we ignore most of it.
Of course there's a drawback that we don't fully parse the body - we
might get the local context wrong, for instance. But at least from my
experience it's working very well.
> or the return type of the method it calls
By parsing the declaration of the method.
-David
- Re: Is intellisense features integration in Emacs technically possible?, (continued)
- Re: Is intellisense features integration in Emacs technically possible?, David Kastrup, 2014/01/23
- Re: Is intellisense features integration in Emacs technically possible?, Rüdiger Sonderfeld, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Óscar Fuentes, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Eli Zaretskii, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Stefan Monnier, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, David Engster, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, David Engster, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Eli Zaretskii, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, David Engster, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Dmitry Gutov, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?,
David Engster <=
- Re: Is intellisense features integration in Emacs technically possible?, Óscar Fuentes, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, David Engster, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Andreas Röhler, 2014/01/21
- Re: Is intellisense features integration in Emacs technically possible?, Eli Zaretskii, 2014/01/21
- Re: Is intellisense features integration in Emacs technically possible?, Stephen J. Turnbull, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Eli Zaretskii, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Stephen J. Turnbull, 2014/01/23
- Re: Is intellisense features integration in Emacs technically possible?, Phillip Lord, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Jorgen Schaefer, 2014/01/22
- Re: Is intellisense features integration in Emacs technically possible?, Andreas Röhler, 2014/01/23