From f3674d05e58768c41ed2383563ccb44300bd5d49 Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Sat, 17 Jan 2015 17:43:57 -0500 Subject: [PATCH] semantic: Parse C++ override/final correctly 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 | 6 ++++++ lisp/cedet/semantic/bovine/c.el | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/admin/grammars/c.by b/admin/grammars/c.by index 094e8d868f7..38a33f94593 100644 --- a/admin/grammars/c.by +++ b/admin/grammars/c.by @@ -143,6 +143,10 @@ %put THROW summary " () throw () ..." %token REENTRANT "reentrant" %put REENTRANT summary " () reentrant ..." +%token OVERRIDE "override" +%put OVERRIDE summary " () override ..." +%token FINAL "final" +%put FINAL summary " () final ..." %token TRY "try" %token CATCH "catch" %put { TRY CATCH } summary "try { } catch { }" @@ -852,6 +856,8 @@ opt-post-fcn-modifiers post-fcn-modifiers : REENTRANT | CONST + | OVERRIDE + | FINAL ; opt-throw diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index 449a7631956..a72b0ddb536 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -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 -- 2.39.5