]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/wisent/java-tags.el
Update copyright year to 2015
[gnu-emacs] / lisp / cedet / semantic / wisent / java-tags.el
index d0647d8e2710463bb80ab938bbc6106070d803b3..f0496322d20c7a2a7f8f567496d3d6894a52caba 100644 (file)
@@ -1,6 +1,6 @@
 ;;; semantic/wisent/java-tags.el --- Java LALR parser for Emacs
 
-;; Copyright (C) 2001-2006, 2009-201 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2006, 2009-2015 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
 ;; Maintainer: David Ponce <david@dponce.com>
@@ -59,6 +59,7 @@ Parse the current context for `field_declaration' nonterminals to
 collect tags, such as local variables or prototypes.
 This function override `get-local-variables'."
   (let ((vars nil)
+       (ct (semantic-current-tag))
         ;; We want nothing to do with funny syntaxing while doing this.
         (semantic-unmatched-syntax-hook nil))
     (while (not (semantic-up-context (point) 'function))
@@ -71,13 +72,36 @@ This function override `get-local-variables'."
                        'field_declaration
                        0 t)
                       vars))))
+    ;; Add 'this' if in a fcn
+    (when (semantic-tag-of-class-p ct 'function)
+      ;; Append a new tag THIS into our space.
+      (setq vars (cons (semantic-tag-new-variable 
+                       "this" (semantic-tag-name (semantic-current-tag-parent))
+                       nil)
+                      vars)))
     vars))
 
+;;;
+;;; Analyzer and type cache support
+;;;
+(define-mode-local-override semantic-analyze-split-name java-mode (name)
+  "Split up tag names on colon . boundaries."
+  (let ((ans (split-string name "\\.")))
+    (if (= (length ans) 1)
+       name
+      (delete "" ans))))
+
+(define-mode-local-override semantic-analyze-unsplit-name java-mode (namelist)
+  "Assemble the list of names NAMELIST into a namespace name."
+  (mapconcat 'identity namelist "."))
+
+
+
 ;;;;
 ;;;; Semantic integration of the Java LALR parser
 ;;;;
 
-;; In semantic-imenu.el, not part of Emacs.
+;; In semantic/imenu.el, not part of Emacs.
 (defvar semantic-imenu-summary-function)
 
 ;;;###autoload
@@ -109,6 +133,10 @@ Use the alternate LALR(1) parser."
              (package  . "Package")))
    ;; navigation inside 'type children
    senator-step-at-tag-classes '(function variable)
+   ;; Remove 'recursive from the default semanticdb find throttle
+   ;; since java imports never recurse.
+   semanticdb-find-default-throttle
+   (remq 'recursive (default-value 'semanticdb-find-default-throttle))
    )
   ;; Setup javadoc stuff
   (semantic-java-doc-setup))