Hi Andrea,
I'll try to answer some of your questions, though I'm using the latest
from CEDET/CVS, which is slightly ahead of the CEDET in Emacs 23.2.
Answers mixed in below.
On 06/09/2010 07:10 PM, Andrea Crotti wrote:
>
> I'm really loving semantic finally, I still have many things to
> configure but for C/java it's working nicely already.
>
> But now since I'm working quite a lot with tinyos I would like to have
> the same nice things also for NesC.
>
> NesC i a superset of C, so I just did that for now:
>
> --8<---------------cut here---------------start------------->8---
> (add-to-list 'semantic-new-buffer-setup-functions
> '(nesc-mode . semantic-default-c-setup))
> --8<---------------cut here---------------end--------------->8---
You will also need to define nesc-mode as a child of C or C++ mode, like
this line from semantic-c.el:
(define-child-mode c++-mode c-mode
"`c++-mode' uses the same parser as `c-mode'.")
The version I use also doesn't use the hook mechanism you specified
above, so I can't comment much on that as I haven't brought those
changes into my configuration yet.
> Looking at the code if I understand correctly C is now parsed with
> --8<---------------cut here---------------start------------->8---
> /Applications/Emacs.app/Contents/Resources/lisp/cedet/semantic/bovine/c.el
> --8<---------------cut here---------------end--------------->8---
>
> So not yet with the new wisent stuff.
> I look in the file and I understand more or less nothing...
> I just need to add some keywords at least to make it useful for me...
> Any hint or direction in which I should look for to be able to get
> something working??
First, you don't write parsers in Emacs Lisp directly. They are in .by,
and .wy files. Those get compiled into Emacs Lisp. I'm guessing this
may not be clear since you mention above the c.el, and not the .by file.
If you want to start with a simple example for working with wisent, the
wisent-calc.wy file (perhaps calc.wy?) is a great simple working example
for doing stuff with wisent. The wisent parser in srecode is also
pretty simple, and shows how to create tags.
> By the way should not semantic also work for emacs-lisp-mode?
>
> I can enable it but then trying to look for with "semantic-...jump" I
> get
> --8<---------------cut here---------------start------------->8---
> semantic-ctxt-current-symbol-default: Wrong type argument: syntax-table-p, nil
> --8<---------------cut here---------------end--------------->8---
>
> which is also not a very nice message symbol, maybe something more clear
> would be better.
I'm not sure about the Emacs Lisp angle and how it is setup in Emacs
23.2. It works ok with CEDET/CVS.
> Thanks a lot for the great work!
>
> PS. last thing, in C there are also nice things with the header files in
> the menu, but I don't find anywhere what are the names of the functions
> called from the menu.
The imenu menu only shows local tags, not tags you might jump to. It is
an interesting idea though. I don't think it would be hard to write,
though it may be slow due to all the extra parsing and analysis.
> Is it maybe possible some sort of similar jumping also for java and
> python?
Things should be pretty good for Java. The python parser didn't get
into Emacs and is currently only available in the CEDET/CVS repository.
Eric
|