Re: Plans to integrate a wisent grammar in php-mode

Eric Ludlam <[email protected]> Sat, 11 Apr 2015 21:26:33 -0400
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
On 04/11/2015 09:44 AM, Steven Rémot wrote:
> Hello,
>
> some people in the PHP-Emacs sphere are showing interest in having a
> proper support of PHP in Semantic.
>
> First of all, ejmr, the maintainer of php-mode, would like to integrate
> semantic support for PHP directly in php-mode [1]. He has been in touch
> with Andrea Turso, who started working on this in his personal
> configuration.
>
> As I am also working on improving Semantic support for PHP, Andrea
> contacted my so that we can join our forces on this project.
>
> Actually I like the plans of ejmr and Andrea. They would like to
> integrate in php-mode a really basic Semantic support for PHP, mainly
> for tagging purposes, and implement the more complex tasks (code
> analysis, type inference, refactoring, etc...) in external packages,
> using minor modes. This would allow people to have simple semantic
> support out of the box, and to easily get other features if needed.
>
> In term of planning, we already thought about short and long term goals :
>
>   * In the short term, we would work in a code base outside of CEDET and
>     php-mode. We would implement a new grammar as close as possible to
>     the PHP specification [2], and free of any shift/reduce -
>     reduce/reduce conflict. This grammar would parse the whole language,
>     so that it can be used for tagging and code analysis.
>   * In the long term, we would separate basic Semantic support for
>     tagging and more complex support for code analysis in different
>     grammars. The basic support could be integrated in php-mode, and the
>     other ones would be in one / several minor modes.
>
>
> As there is already some code for PHP in the CEDET repository, and as
> the CEDET team have obviously more experience than Andrea and I in
> CEDET-related stuffs, we would like to know what you think about it. Do
> you think it is a good idea to implement Semantic support for PHP
> outside of CEDET repository, and to split it like that? And do you think
> it is technically feasible to do so?
>
> Regards,
> Steven Rémot
>
> [1] https://github.com/ejmr/php-mode/issues/235
> [2] https://github.com/php/php-langspec/blob/master/spec/19-grammar.md

Thanks for the details Steven,

Supporting a grammar for a language outside of the CEDET repository is a 
fine thing to do.  Many grammars in CEDET today started outside of our 
repository.  If you would like to keep it separate, that is fine too. 
The specifics around how the grammar compiles and executes has been 
stable for quite some time and would work well for you.

Your idea for adding support for complex tools as minor modes is the 
same pattern CEDET uses, so that should be well supported.

If you choose to start with the php support in the CEDET contrib 
directory, you need to know that it was contributed by someone who 
didn't want his name attached to it, and couldn't get papers assigned. 
If you have a goal of being part of Emacs or one of the other 
repositories that need assignments, you will need to start from scratch. :(

Good Luck!
Eric

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF