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