;;; java-tags.wy -- Semantic LALR grammar for Java
-;; Copyright (C) 2002-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2015 Free Software Foundation, Inc.
;;
;; Author: David Ponce <david@dponce.com>
;; Maintainer: David Ponce <david@dponce.com>
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
%package wisent-java-tags-wy
+%provide semantic/wisent/javat-wy
+
+%{
+(declare-function semantic-parse-region "semantic"
+ (start end &optional nonterminal depth returnonerror))
+}
%languagemode java-mode
%keyword CHAR "char"
%put CHAR summary
-"Integral primitive type ('\u0000' to '\uffff') (0 to 65535)"
+"Integral primitive type (0 to 65535)"
%keyword CLASS "class"
%put CLASS summary
%keyword WHILE "while"
%put WHILE summary
"while (<expr>) <stmt> | do <stmt> while (<expr>);"
-
+
;; --------------------------
;; Official javadoc line tags
;; --------------------------
%keyword _AUTHOR "@author"
%put _AUTHOR javadoc (seq 1 usage (type))
%keyword _VERSION "@version"
-%put _VERSION javadoc (seq 2 usage (type))
+%put _VERSION javadoc (seq 2 usage (type))
%keyword _PARAM "@param"
-%put _PARAM javadoc (seq 3 usage (function) with-name t)
+%put _PARAM javadoc (seq 3 usage (function) with-name t)
%keyword _RETURN "@return"
-%put _RETURN javadoc (seq 4 usage (function))
+%put _RETURN javadoc (seq 4 usage (function))
%keyword _EXCEPTION "@exception"
-%put _EXCEPTION javadoc (seq 5 usage (function) with-name t)
+%put _EXCEPTION javadoc (seq 5 usage (function) with-name t)
%keyword _THROWS "@throws"
-%put _THROWS javadoc (seq 6 usage (function) with-name t)
+%put _THROWS javadoc (seq 6 usage (function) with-name t)
%keyword _SEE "@see"
-%put _SEE javadoc (seq 7 usage (type function variable) opt t with-ref t)
+%put _SEE javadoc (seq 7 usage (type function variable) opt t with-ref t)
%keyword _SINCE "@since"
-%put _SINCE javadoc (seq 8 usage (type function variable) opt t)
+%put _SINCE javadoc (seq 8 usage (type function variable) opt t)
%keyword _SERIAL "@serial"
-%put _SERIAL javadoc (seq 9 usage (variable) opt t)
+%put _SERIAL javadoc (seq 9 usage (variable) opt t)
%keyword _SERIALDATA "@serialData"
-%put _SERIALDATA javadoc (seq 10 usage (function) opt t)
+%put _SERIALDATA javadoc (seq 10 usage (function) opt t)
%keyword _SERIALFIELD "@serialField"
-%put _SERIALFIELD javadoc (seq 11 usage (variable) opt t)
+%put _SERIALFIELD javadoc (seq 11 usage (variable) opt t)
%keyword _DEPRECATED "@deprecated"
-%put _DEPRECATED javadoc (seq 12 usage (type function variable) opt t)
+%put _DEPRECATED javadoc (seq 12 usage (type function variable) opt t)
%%
;
;;; Include file token
-;; ("FILE" include SYSTEM "DOCSTRING")
+;; ("FILE" include SYSTEM "DOCSTRING")
import_declaration
: IMPORT qualified_name SEMICOLON
(INCLUDE-TAG $2 nil)
;;; 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)
;
;
;;; Function token
-;; ("NAME" function "TYPE" ( ARG-LIST ) EXTRA-SPEC "DOCSTRING")
+;; ("NAME" function "TYPE" ( ARG-LIST ) EXTRA-SPEC "DOCSTRING")
constructor_declaration
: modifiers_opt constructor_declarator throwsc_opt constructor_body
(FUNCTION-TAG (car $2) nil (cdr $2)
;
constructor_body
- : block
+ : block
;
;;; Function token
-;; ("NAME" function "TYPE" ( ARG-LIST ) EXTRA-SPEC "DOCSTRING")
+;; ("NAME" function "TYPE" ( ARG-LIST ) EXTRA-SPEC "DOCSTRING")
method_declaration
: modifiers_opt VOID method_declarator throwsc_opt method_body
(FUNCTION-TAG (car $3) $2 (cdr $3) :typemodifiers $1 :throws $4)
;;; 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)
;
(cons $1 $region)
;
+opt_variable_declarator_id
+ : ;; EMPTY
+ (identity "")
+ | variable_declarator_id
+ (identity $1)
+ ;
+
variable_declarator_id
: IDENTIFIER dims_opt
(concat $1 $2)