1 ;;; semantic/wisent/java-tags.el --- Java LALR parser for Emacs
3 ;; Copyright (C) 2001-2006, 2009-2011
4 ;; Free Software Foundation, Inc.
6 ;; Author: David Ponce <david@dponce.com>
7 ;; Maintainer: David Ponce <david@dponce.com>
8 ;; Created: 15 Dec 2001
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation, either version 3 of the License, or
16 ;; (at your option) any later version.
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
34 (require 'semantic/wisent)
35 (require 'semantic/wisent/javat-wy)
36 (require 'semantic/java)
39 ;;;; Simple parser error reporting function
42 (defun wisent-java-parse-error (msg)
43 "Error reporting function called when a parse error occurs.
44 MSG is the message string to report."
45 ;; (let ((error-start (nth 2 wisent-input)))
46 ;; (if (number-or-marker-p error-start)
47 ;; (goto-char error-start)))
56 (define-mode-local-override semantic-get-local-variables
58 "Get local values from a specific context.
59 Parse the current context for `field_declaration' nonterminals to
60 collect tags, such as local variables or prototypes.
61 This function override `get-local-variables'."
63 ;; We want nothing to do with funny syntaxing while doing this.
64 (semantic-unmatched-syntax-hook nil))
65 (while (not (semantic-up-context (point) 'function))
69 (append (semantic-parse-region
71 (save-excursion (semantic-end-of-context) (point))
78 ;;;; Semantic integration of the Java LALR parser
81 ;; In semantic-imenu.el, not part of Emacs.
82 (defvar semantic-imenu-summary-function)
85 (defun wisent-java-default-setup ()
86 "Hook run to setup Semantic in `java-mode'.
87 Use the alternate LALR(1) parser."
88 (wisent-java-tags-wy--install-parser)
91 semantic-lex-number-expression semantic-java-number-regexp
92 semantic-lex-analyzer 'wisent-java-tags-lexer
94 semantic-tag-expand-function 'semantic-java-expand-tag
96 semantic-imenu-summary-function 'semantic-format-tag-prototype
97 imenu-create-index-function 'semantic-create-imenu-index
98 semantic-type-relation-separator-character '(".")
99 semantic-command-separation-character ";"
100 ;; speedbar and imenu buckets name
101 semantic-symbol->name-assoc-list-for-type-parts
104 (variable . "Variables")
105 (function . "Methods"))
106 semantic-symbol->name-assoc-list
108 (append semantic-symbol->name-assoc-list-for-type-parts
109 '((include . "Imports")
110 (package . "Package")))
111 ;; navigation inside 'type children
112 senator-step-at-tag-classes '(function variable)
114 ;; Setup javadoc stuff
115 (semantic-java-doc-setup))
117 (provide 'semantic/wisent/java-tags)
120 ;; generated-autoload-file: "../loaddefs.el"
121 ;; generated-autoload-load-name: "semantic/wisent/java-tags"
124 ;;; semantic/wisent/java-tags.el ends here