From e698dc189984301a33558bd90dab7dea55c18e50 Mon Sep 17 00:00:00 2001 From: David Engster Date: Sun, 25 Jan 2015 23:10:13 +0100 Subject: [PATCH] semantic: Add support for typedef references * admin/grammars/c.by (typedefname): Also parse optional reference qualifier. * lisp/cedet/semantic/bovine/c.el (semantic-expand-c-tag-namelist): Add :reference attribute for typedefs. --- admin/grammars/c.by | 4 ++-- lisp/cedet/semantic/bovine/c.el | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/admin/grammars/c.by b/admin/grammars/c.by index c312fd636df..b8c150a9e6c 100644 --- a/admin/grammars/c.by +++ b/admin/grammars/c.by @@ -450,8 +450,8 @@ typedef-symbol-list ;; TODO: Klaus Berndl: symbol -> namespace-symbol?! Answer: Probably ;; symbol is correct here! typedefname - : opt-stars symbol opt-bits opt-array - ( $1 $2 ) + : opt-stars opt-ref symbol opt-bits opt-array + ( $1 $2 $3 ) ; struct-or-class diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index 5d7d5a6af5f..47a54579956 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -1187,13 +1187,16 @@ is its own toplevel tag. This function will return (cons A B)." (while names (setq vl (cons (semantic-tag-new-type - (nth 1 (car names)) ; name + (nth 2 (car names)) ; name "typedef" (semantic-tag-type-members tag) nil :pointer (let ((stars (car (car (car names))))) (if (= stars 0) nil stars)) + :reference + (let ((refs (car (nth 1 (car names))))) + (when (> refs 0) refs)) ;; This specifies what the typedef ;; is expanded out as. Just the ;; name shows up as a parent of this -- 2.39.5