From: Ronald Pijnacker <pijnacker@ds...> - 2006-09-19 20:34:37
I would like to add support for Objective-C, to get decent support in ECB for
this languages. As it is a superset of C, I would take the c.bnf as a starting
point. What I was wondering about, was whether creating a bnf file is enough.
It seems to me that I should probably do some additional actions.
Is there a pointer to some documentation that describes exactly which steps to
From: Eric M. Ludlam <eric@si...> - 2006-09-20 02:35:31
>>> Ronald Pijnacker <pijnacker@...> seems to think that:
>I would like to add support for Objective-C, to get decent support in ECB for
>this languages. As it is a superset of C, I would take the c.bnf as a starting
>point. What I was wondering about, was whether creating a bnf file is enough.
>It seems to me that I should probably do some additional actions.
>Is there a pointer to some documentation that describes exactly which steps to
[ ... ]
There are info files on this topic in the semantic doc directory which
will help with the specifics.
You could start with the c.by file, or if objective-c has a handy
language reference it could likely be turned into a wisent parser
In either case, you need to create either a .by or a .wy file. (.bnf
are for older versions of cedet/semantic.) You will also need a
support file that contains the language mode hook, and any specific
Emacs code and overloads needed for your language.
For example, there is c.bnf, and semantic-c.el.
If objective-c mode is a 'derived-mode' to C, then many of the C
customizations for semantic will fall-through to objective-c.
If objective-c's declaration syntax is identical to C (ie, the
differences are exposed only in the code part, not in declarations)
then you could just add objective C to the list of supported modes in
If the differences are very small, you could do the above, and then
tweak c.by and have it support all three. Since semantic is only a
declaration parser, the "bad syntax" highlighting isn't very useful
anyway, so having obj-c syntax work in a C buffer wouldn't be all that
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org