From 62a81506f802e4824b718cc30321ee3a0057cdf7 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 2 Oct 2012 02:10:29 +0800 Subject: [PATCH] Update CEDET from upstream. --- admin/ChangeLog | 15 + admin/grammars/bovine-grammar.el | 36 +- admin/grammars/c.by | 15 +- admin/grammars/grammar.wy | 12 +- admin/grammars/java-tags.wy | 12 +- admin/grammars/js.wy | 1 + admin/grammars/make.by | 1 + admin/grammars/python.wy | 64 +- admin/grammars/scheme.by | 1 + admin/grammars/srecode-template.wy | 67 +- admin/grammars/wisent-grammar.el | 61 +- doc/misc/ChangeLog | 12 + doc/misc/ede.texi | 845 ++++++++++++++++++++--- doc/misc/eieio.texi | 139 ++-- etc/ChangeLog | 12 + etc/srecode/c.srt | 164 +++++ etc/srecode/cpp.srt | 123 ---- etc/srecode/ede-autoconf.srt | 54 ++ etc/srecode/ede-make.srt | 32 + etc/srecode/el.srt | 2 +- lisp/ChangeLog | 42 ++ lisp/cedet/ChangeLog | 494 +++++++++++++ lisp/cedet/cedet-cscope.el | 2 +- lisp/cedet/cedet-global.el | 2 +- lisp/cedet/cedet-idutils.el | 5 +- lisp/cedet/cedet.el | 21 +- lisp/cedet/data-debug.el | 53 +- lisp/cedet/ede.el | 210 ++++-- lisp/cedet/ede/auto.el | 198 +++++- lisp/cedet/ede/autoconf-edit.el | 50 +- lisp/cedet/ede/base.el | 7 +- lisp/cedet/ede/cpp-root.el | 40 +- lisp/cedet/ede/dired.el | 2 +- lisp/cedet/ede/emacs.el | 52 +- lisp/cedet/ede/files.el | 26 +- lisp/cedet/ede/generic.el | 80 ++- lisp/cedet/ede/linux.el | 95 ++- lisp/cedet/ede/makefile-edit.el | 3 +- lisp/cedet/ede/pmake.el | 13 +- lisp/cedet/ede/proj-comp.el | 21 +- lisp/cedet/ede/proj-elisp.el | 92 ++- lisp/cedet/ede/proj.el | 87 ++- lisp/cedet/ede/project-am.el | 2 +- lisp/cedet/ede/util.el | 2 +- lisp/cedet/inversion.el | 62 +- lisp/cedet/semantic.el | 71 +- lisp/cedet/semantic/analyze/debug.el | 2 +- lisp/cedet/semantic/analyze/fcn.el | 22 +- lisp/cedet/semantic/analyze/refs.el | 19 +- lisp/cedet/semantic/bovine/c-by.el | 31 +- lisp/cedet/semantic/bovine/c.el | 515 +++++++++++--- lisp/cedet/semantic/bovine/el.el | 4 +- lisp/cedet/semantic/bovine/gcc.el | 52 +- lisp/cedet/semantic/bovine/make-by.el | 10 +- lisp/cedet/semantic/bovine/make.el | 1 + lisp/cedet/semantic/bovine/scm-by.el | 12 +- lisp/cedet/semantic/bovine/scm.el | 5 +- lisp/cedet/semantic/complete.el | 337 +++++---- lisp/cedet/semantic/db-el.el | 55 +- lisp/cedet/semantic/db-file.el | 7 +- lisp/cedet/semantic/db-find.el | 15 +- lisp/cedet/semantic/db-global.el | 41 +- lisp/cedet/semantic/db-typecache.el | 11 +- lisp/cedet/semantic/db.el | 57 +- lisp/cedet/semantic/debug.el | 4 +- lisp/cedet/semantic/decorate/include.el | 126 +++- lisp/cedet/semantic/decorate/mode.el | 2 + lisp/cedet/semantic/doc.el | 5 +- lisp/cedet/semantic/ede-grammar.el | 115 +-- lisp/cedet/semantic/find.el | 14 +- lisp/cedet/semantic/fw.el | 195 +++++- lisp/cedet/semantic/grammar-wy.el | 66 +- lisp/cedet/semantic/grammar.el | 53 +- lisp/cedet/semantic/ia.el | 44 +- lisp/cedet/semantic/idle.el | 78 ++- lisp/cedet/semantic/java.el | 26 +- lisp/cedet/semantic/lex-spp.el | 46 +- lisp/cedet/semantic/lex.el | 40 +- lisp/cedet/semantic/mru-bookmark.el | 1 + lisp/cedet/semantic/scope.el | 13 +- lisp/cedet/semantic/symref.el | 10 +- lisp/cedet/semantic/symref/filter.el | 21 + lisp/cedet/semantic/symref/list.el | 1 + lisp/cedet/semantic/tag-ls.el | 268 ++++++- lisp/cedet/semantic/tag-write.el | 6 +- lisp/cedet/semantic/tag.el | 110 ++- lisp/cedet/semantic/texi.el | 6 + lisp/cedet/semantic/util.el | 1 + lisp/cedet/semantic/wisent/comp.el | 15 +- lisp/cedet/semantic/wisent/java-tags.el | 28 + lisp/cedet/semantic/wisent/javascript.el | 52 +- lisp/cedet/semantic/wisent/javat-wy.el | Bin 19144 -> 19301 bytes lisp/cedet/semantic/wisent/js-wy.el | 47 +- lisp/cedet/semantic/wisent/python-wy.el | 83 ++- lisp/cedet/semantic/wisent/python.el | 325 ++++++++- lisp/cedet/srecode.el | 1 - lisp/cedet/srecode/compile.el | 13 +- lisp/cedet/srecode/cpp.el | 55 +- lisp/cedet/srecode/dictionary.el | 43 +- lisp/cedet/srecode/find.el | 45 +- lisp/cedet/srecode/getset.el | 8 +- lisp/cedet/srecode/insert.el | 179 +++-- lisp/cedet/srecode/java.el | 20 +- lisp/cedet/srecode/map.el | 2 +- lisp/cedet/srecode/mode.el | 20 +- lisp/cedet/srecode/semantic.el | 6 + lisp/cedet/srecode/srt-mode.el | 8 +- lisp/cedet/srecode/srt-wy.el | 64 +- lisp/cedet/srecode/table.el | 59 +- lisp/emacs-lisp/eieio-base.el | 177 ++++- lisp/emacs-lisp/eieio-custom.el | 16 +- lisp/emacs-lisp/eieio-datadebug.el | 7 +- lisp/emacs-lisp/eieio-opt.el | 139 +++- lisp/emacs-lisp/eieio-speedbar.el | 18 +- lisp/emacs-lisp/eieio.el | 75 +- 115 files changed, 5698 insertions(+), 1654 deletions(-) create mode 100644 etc/srecode/c.srt create mode 100644 etc/srecode/ede-autoconf.srt diff --git a/admin/ChangeLog b/admin/ChangeLog index b5b1b75c55..2da6552311 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,18 @@ +2012-10-01 David Engster + + * grammars/bovine-grammar.el (bovine--grammar-newstyle-unquote): + Remove. + (bovine-grammar-expand-form): Test for emacs-major-version. + + * grammars/c.by: Add EXPLICIT to keyword tokens. + + * grammars/f90.by: Add %provide token. + + * grammar/grammar.wy (semantic-grammar-lexer): Remove, since it + was copied to grammar.el. New %provide token to generate prefix + which conforms with Emacs conventions. Remove lexer definition, + which is now in grammar.el. + 2012-09-27 Glenn Morris * admin.el (set-version): Set msdos.c's Vwindow_system_version. diff --git a/admin/grammars/bovine-grammar.el b/admin/grammars/bovine-grammar.el index efe4db039c..a7289f6baf 100644 --- a/admin/grammars/bovine-grammar.el +++ b/admin/grammars/bovine-grammar.el @@ -109,14 +109,6 @@ NAME, ALIASCLASS, DEFINITION and ATTRIBUTES." ;; Cache of macro definitions currently in use. (defvar bovine--grammar-macros nil) -;; Detect if we have an Emacs with newstyle unquotes allowed outside -;; of backquote. -;; This should probably be changed to a test to (= emacs-major-version 24) -;; when it is released, but at the moment it might be possible that people -;; are using an older snapshot. -(defvar bovine--grammar-newstyle-unquote - (equal '(\, test) (read ",test"))) - (defun bovine-grammar-expand-form (form quotemode &optional inplace) "Expand FORM into a new one suitable to the bovine parser. FORM is a list in which we are substituting. @@ -152,7 +144,7 @@ expanded from elsewhere." form (cdr form)) ;; Hack for dealing with new reading of unquotes outside of ;; backquote (introduced in rev. 102591 in emacs-bzr). - (when (and bovine--grammar-newstyle-unquote + (when (and (>= emacs-major-version 24) (listp first) (or (equal (car first) '\,) (equal (car first) '\,@))) @@ -456,6 +448,7 @@ Menu items are appended to the common grammar menu.") (defun bovine-make-parsers () "Generate Emacs' built-in Bovine-based parser files." + (interactive) (semantic-mode 1) ;; Loop through each .by file in current directory, and run ;; `semantic-grammar-batch-build-one-package' to build the grammar. @@ -465,13 +458,14 @@ Menu items are appended to the common grammar menu.") (with-current-buffer (find-file-noselect f) (semantic-grammar-create-package)) (error (message "%s" (error-message-string err)) nil))) - lang) + lang filename) (when (and packagename - (string-match "^semantic-\\(.*\\)-by\\.el\\'" packagename)) + (string-match "^.*/\\(.*\\)-by\\.el\\'" packagename)) (setq lang (match-string 1 packagename)) + (setq filename (concat lang "-by.el")) (with-temp-buffer - (insert-file-contents packagename) - (setq buffer-file-name (expand-file-name packagename)) + (insert-file-contents filename) + (setq buffer-file-name (expand-file-name filename)) ;; Fix copyright header: (goto-char (point-min)) (re-search-forward "^;; Author:") @@ -500,20 +494,14 @@ Menu items are appended to the common grammar menu.") lang ".by. ;;; Code: - -\(require 'semantic/lex) -\(eval-when-compile (require 'semantic/bovine))\n") +") (goto-char (point-min)) (delete-region (point-min) (line-end-position)) - (insert ";;; semantic/bovine/" lang - "-by.el --- Generated parser support file") + (insert ";;; " packagename + " --- Generated parser support file") (delete-trailing-whitespace) - ;; Fix footer: - (goto-char (point-max)) - (re-search-backward ".\n;;; Analyzers") - (delete-region (point) (point-max)) - (insert "(provide 'semantic/bovine/" lang "-by)\n\n") - (insert ";;; semantic/bovine/" lang "-by.el ends here\n") + (re-search-forward ";;; \\(.*\\) ends here") + (replace-match packagename nil nil nil 1) (save-buffer)))))) ;;; bovine-grammar.el ends here diff --git a/admin/grammars/c.by b/admin/grammars/c.by index 1bdaf8f447..dfced9813d 100644 --- a/admin/grammars/c.by +++ b/admin/grammars/c.by @@ -1,5 +1,4 @@ ;;; c.by -- LL grammar for C/C++ language specification - ;; Copyright (C) 1999-2012 Free Software Foundation, Inc. ;; ;; Author: Eric M. Ludlam @@ -39,6 +38,13 @@ ;; > * Can't parse signature element: "RmcBucStatus* rftBucStatus" %package semantic-c-by +%provide semantic/bovine/c-by + +%{ +(declare-function semantic-c-reconstitute-token "semantic/bovine/c") +(declare-function semantic-c-reconstitute-template "semantic/bovine/c") +(declare-function semantic-expand-c-tag "semantic/bovine/c") +} %languagemode c-mode c++-mode %start declaration @@ -98,6 +104,8 @@ %put VIRTUAL summary "Method Modifier: virtual (...) ..." %token MUTABLE "mutable" %put MUTABLE summary "Member Declaration Modifier: mutable ..." +%token EXPLICIT "explicit" +%put EXPLICIT summary "Forbids implicit type conversion: explicit " %token STRUCT "struct" %put STRUCT summary "Structure Type Declaration: struct [name] { ... };" @@ -370,6 +378,9 @@ namespacesubparts ;; PUBLIC or PRIVATE bits. Ignore them for now. | template | using + ;; Includes inside namespaces + | spp-include + (TAG $1 'include :inside-ns t) | ;;EMPTY ; @@ -1098,6 +1109,8 @@ functionname function-pointer : LPAREN STAR symbol RPAREN ( (concat "*" $3) ) + | LPAREN symbol RPAREN + ( $2 ) ; fun-or-proto-end diff --git a/admin/grammars/grammar.wy b/admin/grammars/grammar.wy index 1189d6b088..f89fe6220f 100644 --- a/admin/grammars/grammar.wy +++ b/admin/grammars/grammar.wy @@ -23,6 +23,9 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +%package semantic-grammar-wy +%provide semantic/grammar-wy + %{ (defvar semantic-grammar-lex-c-char-re) @@ -32,8 +35,6 @@ (defvar semantic-grammar-wy--rindx nil) } -%package semantic-grammar-wy - %languagemode wy-mode ;; Main @@ -52,6 +53,7 @@ %keyword LEFT "%left" %keyword NONASSOC "%nonassoc" %keyword PACKAGE "%package" +%keyword PROVIDE "%provide" %keyword PREC "%prec" %keyword PUT "%put" %keyword QUOTEMODE "%quotemode" @@ -134,6 +136,7 @@ decl: | no_default_prec_decl | languagemode_decl | package_decl + | provide_decl | precedence_decl | put_decl | quotemode_decl @@ -165,6 +168,11 @@ package_decl: `(PACKAGE-TAG ',$2 nil) ; +provide_decl: + PROVIDE SYMBOL + `(TAG ',$2 'provide) + ; + precedence_decl: associativity token_type_opt items `(TAG ',$1 'assoc :type ',$2 :value ',$3) diff --git a/admin/grammars/java-tags.wy b/admin/grammars/java-tags.wy index b58b96c6bf..708715533f 100644 --- a/admin/grammars/java-tags.wy +++ b/admin/grammars/java-tags.wy @@ -23,6 +23,7 @@ ;; along with GNU Emacs. If not, see . %package wisent-java-tags-wy +%provide semantic/wisent/javat-wy %languagemode java-mode @@ -444,7 +445,7 @@ class_member_declaration ;;; Type Declaration token ;; ("NAME" type "TYPE" ( PART-LIST ) ( PARENTS ) EXTRA-SPEC "DOCSTRING") interface_declaration - : modifiers_opt INTERFACE IDENTIFIER extends_interfaces_opt interface_body + : modifiers_opt INTERFACE qualified_name extends_interfaces_opt interface_body (TYPE-TAG $3 $2 $5 (if $4 (cons nil $4)) :typemodifiers $1) ; @@ -547,7 +548,7 @@ formal_parameters ;;; Variable token ;; ("NAME" variable "TYPE" DEFAULT-VALUE EXTRA-SPEC "DOCSTRING") formal_parameter - : formal_parameter_modifier_opt type variable_declarator_id + : formal_parameter_modifier_opt type opt_variable_declarator_id (VARIABLE-TAG $3 $2 nil :typemodifiers $1) ; @@ -582,6 +583,13 @@ variable_declarator (cons $1 $region) ; +opt_variable_declarator_id + : ;; EMPTY + (identity "") + | variable_declarator_id + (identity $1) + ; + variable_declarator_id : IDENTIFIER dims_opt (concat $1 $2) diff --git a/admin/grammars/js.wy b/admin/grammars/js.wy index c6b3a58aac..7b55f5c383 100644 --- a/admin/grammars/js.wy +++ b/admin/grammars/js.wy @@ -58,6 +58,7 @@ ;; DAMAGE. %package wisent-javascript-jv-wy +%provide semantic/wisent/js-wy ;; JAVE I prefere ecmascript-mode %languagemode ecmascript-mode javascript-mode diff --git a/admin/grammars/make.by b/admin/grammars/make.by index ee933805cf..6cff4716f8 100644 --- a/admin/grammars/make.by +++ b/admin/grammars/make.by @@ -22,6 +22,7 @@ ;; along with GNU Emacs. If not, see . %package semantic-make-by +%provide semantic/bovine/make-by %languagemode makefile-mode %start Makefile diff --git a/admin/grammars/python.wy b/admin/grammars/python.wy index f7808fd20b..f17f41c9b1 100644 --- a/admin/grammars/python.wy +++ b/admin/grammars/python.wy @@ -88,6 +88,12 @@ ;; -------- %package wisent-python-wy +%provide semantic/wisent/python-wy + +%{ +(declare-function wisent-python-reconstitute-function-tag "semantic/wisent/python") +(declare-function wisent-python-reconstitute-class-tag "semantic/wisent/python") +} %languagemode python-mode @@ -173,6 +179,7 @@ %token COMMA "," %token ASSIGN "=" %token BACKQUOTE "`" +%token AT "@" ;; ----------------- @@ -307,6 +314,10 @@ %put WHILE summary "Start a 'while' loop" +%keyword WITH "with" +%put WITH summary +"Start statement with an associated context object" + %keyword YIELD "yield" %put YIELD summary "Create a generator function" @@ -545,8 +556,10 @@ import_stmt ;; dotted_as_name (',' dotted_as_name)* dotted_as_name_list - : dotted_as_name - | dotted_as_name_list COMMA dotted_as_name + : dotted_as_name_list COMMA dotted_as_name + (cons $3 $1) + | dotted_as_name + (list $1) ; ;; ('*' | import_as_name (',' import_as_name)*) @@ -649,6 +662,7 @@ compound_stmt | while_stmt | for_stmt | try_stmt + | with_stmt | funcdef | class_declaration ; @@ -755,14 +769,47 @@ zero_one_or_two_test () ; +;;;============================================================================ +;;@@ with_stmt +;;;============================================================================ + +;; with_stmt: 'with' test [ with_var ] ':' suite +with_stmt + : WITH test COLON suite + (CODE-TAG $1 nil) + | WITH test with_var COLON suite + (CODE-TAG $1 nil) ;; TODO capture variable + ; + +with_var + : AS expr + () ;; TODO capture + ; + ;;;============================================================================ ;;;@@ funcdef ;;;============================================================================ -;; funcdef: 'def' NAME parameters ':' suite +decorator + : AT dotted_name varargslist_opt NEWLINE + (FUNCTION-TAG $2 "decorator" $3) + ; + +decorators + : decorator + (list $1) + | decorator decorators + (cons $1 $2) + ; + +;; funcdef: [decorators] 'def' NAME parameters ':' suite funcdef : DEF NAME function_parameter_list COLON suite - (FUNCTION-TAG $2 nil $3) + (wisent-python-reconstitute-function-tag + (FUNCTION-TAG $2 nil $3) $5) + | decorators DEF NAME function_parameter_list COLON suite + (wisent-python-reconstitute-function-tag + (FUNCTION-TAG $3 nil $4 :decorators $1) $6) ; function_parameter_list @@ -798,10 +845,11 @@ function_parameter ;; classdef: 'class' NAME ['(' testlist ')'] ':' suite class_declaration : CLASS NAME paren_class_list_opt COLON suite - (TYPE-TAG $2 $1 ;; Name "class" - $5 ;; Members - (cons $3 nil) ;; (SUPERCLASSES . INTERFACES) - ) + (wisent-python-reconstitute-class-tag + (TYPE-TAG $2 $1 ;; Name "class" + $5 ;; Members + (cons $3 nil) ;; (SUPERCLASSES . INTERFACES) + )) ; ;; ['(' testlist ')'] diff --git a/admin/grammars/scheme.by b/admin/grammars/scheme.by index 3925f03c28..98e75901a7 100644 --- a/admin/grammars/scheme.by +++ b/admin/grammars/scheme.by @@ -18,6 +18,7 @@ ;; along with GNU Emacs. If not, see . %package semantic-scm-by +%provide semantic/bovine/scm-by %languagemode scheme-mode %start scheme diff --git a/admin/grammars/srecode-template.wy b/admin/grammars/srecode-template.wy index f38d7eaa2a..95ac8a0730 100644 --- a/admin/grammars/srecode-template.wy +++ b/admin/grammars/srecode-template.wy @@ -28,6 +28,9 @@ ;; Semantic Recoder templates are based on Google Templates ;; and are at the bottom of the Semantic Recoder API. +%package srecode-template-wy +%provide srecode/srt-wy + %languagemode srecode-mode %start template_file @@ -46,6 +49,15 @@ %put TEMPLATE summary "template \\n