Re[1]: [cedet-semantic] how to make comments work
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2004-05-07 13:50:47
|
Hi, >>> Joe Corneli <jco...@ma...> seems to think that: > >I have this at the end of my simple.wy: > >(define-lex simple-lexer > "Simple lexical analyzer." > semantic-lex-ignore-whitespace > semantic-lex-ignore-newline > ;; ------------------------- note > semantic-lex-ignore-comments > ;; ------------------------- note > ;;;; Auto-generated analyzers. > simple-wy--<punctuation>-string-analyzer > simple-wy--<symbol>-regexp-analyzer > simple-wy--<string>-sexp-analyzer > simple-wy--<number>-regexp-analyzer > ;;;; > semantic-lex-default-action) > >and this in my simple-mode.el: > >(defun semantic-default-simple-setup () > "Set up a buffer for semantic parsing of a SIMPLE language." > ;; Do some useful things. > (setq > semantic-ignore-comments t > document-comment-start "/\\*" > document-comment-end "\\*/") > ;; Install the parser > (simple-wy--install-parser) > ;; Setup the lexer > (setq semantic-lex-analyzer 'simple-lexer > ;; Do a full depth lexical analysis. > semantic-lex-depth nil)) > > >But yet, the sample text > >/* this is a comment */ > >does not seem to be ignored in any way. How can I get comments to >be ignored? [ ... ] The details needed for comments must all be defined in the originating major mode, or have some corresponding override value that semantic can use. In your originating major mode, if you can use (forward-comment 1) then the semantic will also be able to ignore your comments. If you do not have, or wish to have a major mode, then you can instead set the variable comment-start-skip and tweak the semantic-lex-syntax-modifications according to major mode rules. After this, you must make sure that `semantic-lex-init' is run. If you do those changes in your setup function then the rest of the harness will find them and use them. Eric -- Eric Ludlam: za...@gn..., er...@si... Home: http://www.ludlam.net Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net GNU: www.gnu.org |