]> git.eshelyaron.com Git - emacs.git/commitdiff
semantic: Parse C++ override/final correctly
authorRamkumar Ramachandra <artagnon@gmail.com>
Sat, 17 Jan 2015 22:43:57 +0000 (17:43 -0500)
committerDavid Engster <deng@randomsample.de>
Sun, 22 Jan 2017 21:25:16 +0000 (22:25 +0100)
override and final are a perfectly good opt-post-fcn-modifiers in
C++. Parse them correctly.

* admin/grammars/c.by (post-fcn-modifiers): Add tokens OVERRIDE and
  FINAL.
* lisp/cedet/semantic/bovine/c.el (semantic-c-reconstitute-token): Add
  :override-flag and :final-flag.

Copyright-paperwork-exempt: yes

admin/grammars/c.by
lisp/cedet/semantic/bovine/c.el

index 094e8d868f778a198ec987cc4068bb3511228aca..38a33f94593ae53c4ac22e806926db76078fa626 100644 (file)
 %put THROW summary "<type> <methoddef> (<method args>) throw (<exception>) ..."
 %token REENTRANT "reentrant"
 %put REENTRANT summary "<type> <methoddef> (<method args>) reentrant ..."
+%token OVERRIDE "override"
+%put OVERRIDE summary "<type> <methoddef> (<method args>) override ..."
+%token FINAL "final"
+%put FINAL summary "<type> <methoddef> (<method args>) final ..."
 %token TRY "try"
 %token CATCH "catch"
 %put { TRY CATCH } summary "try { <body> } catch { <catch code> }"
@@ -852,6 +856,8 @@ opt-post-fcn-modifiers
 post-fcn-modifiers
   : REENTRANT
   | CONST
+  | OVERRIDE
+  | FINAL
   ;
 
 opt-throw
index 449a7631956f9794b85341aa7e0fb62c22787c96..a72b0ddb5364902b95fc78e3fca69f160fbef385 100644 (file)
@@ -1362,8 +1362,10 @@ Optional argument STAR and REF indicate the number of * and & in the typedef."
            ;; `throws' as a common name for things that toss
            ;; exceptions about.
            :throws (nth 5 tokenpart)
-           ;; Reentrant is a C++ thingy.  Add it here
+           ;; Reentrant, override, final are a C++ things.  Add it here.
            :reentrant-flag (if (member "reentrant" (nth 6 tokenpart)) t)
+           :override-flag (if (member "override" (nth 6 tokenpart)) t)
+           :final-flag (if (member "final" (nth 6 tokenpart)) t)
            ;; A function post-const is funky.  Try stuff
            :methodconst-flag (if (member "const" (nth 6 tokenpart)) t)
            ;; prototypes are functions w/ no body