On 06/12/2011 06:32 PM, Neil Van Dyke wrote:
> I'm considering making Semantic the core of a new Emacs major-mode, and
> had a couple questions:
>
> 1. If Emacs syntax-tables are simply inadequate for, say, the kinds of
> comments in the language of my major-mode, and I have had to implement a
> lexer for them using functions, can CEDET work with that, or does it
> *really* need syntax-tables? (Reason I ask:
> "http://cedet.sourceforge.net/addlang.shtml" says "This major mode must
> have a robust and tested syntax-table that can correctly identify
> strings and comments, and has an accurate representation of all
> parenthetical expressions.")
Hi,
It is ok if your syntax table doesn't support commends and bracketed
lists. I suppose the sentence should be fixed to say something about
performance, since using the syntax table support greatly improves
performance.
I worked on the MATLAB mode and you cannot support comments or strings
in the syntax table, and I added cedet support for that. (matlab-emacs
project on sourceforge.)
> 2. Can the CEDET lexer and parser be used for detailed
> syntax-coloring/fontifying (e.g., making certain lexemes types purple on
> the display, and using parse information to make function names orange
> boldface), or does CEDET still expect the major-mode to do that some
> other way, such as with font-lock?
No one has done that, but it's just code, so I don't see why you
couldn't make it work. The dilemma is that lots and lots of other core
Emacs functionality depends on the syntax tables.
Another possibility is to use the full syntax parser to do your
coloring. That's another project I always wanted to try out, but
haven't had time to do.
Eric
|