RE: [cedet-semantic] Some more Qt stuff
Brought to you by:
zappo
From: Berndl, K. <kla...@sd...> - 2003-09-17 08:09:02
|
>I've pretty much realized how the bnf format works, but not mastered >it -- yet: >class Q_EXPORT QLCDNumber : public QFrame // LCD number widget >{ > : > : >} >I've simply no idea where to put stuff for the Q_EXPORT macro ;/ Ok, here comes how to handle this Q_EXPORT stuff - i assume that you do not need the info that here Q_EXPORT is used but that it is ok, if the parser/lexer handles "class Q_EXPORT classname" as if "class classname" would be written...if this is right, then you can do: (defun semantic-flex-Q_EXPORT () "Check if we found \"class Q_EXPORT \" and if yes treat it as whitespace" (let (found) (save-excursion (goto-char (match-beginning 1)) ;; (skip-syntax-backward " ") (save-match-data (if (re-search-backward "class[ \t]+" nil t) (setq found t)))) (when found (goto-char (match-end 1)) nil))) Add then this to semantic-flex-c-extensions: (add-to-list 'semantic-flex-c-extensions ("^\\s-*#if\\s-*0$" . semantic-flex-c-if-0)) You should do this in the c++-mode-hook. I have tested it by adding this code to semantic-c.el itself but it should also work if coded outside.... It only a fast hack but it can demonstrate you the principle... Ciao, klaus |