Initial Commit
[packages] / xemacs-packages / semantic / wisent / wisent-java-wy.el
1 ;;; wisent-java-wy.el --- Generated parser support file
2
3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006 David Ponce
4
5 ;; Author: Eric M. Ludlam <zappo@projectile.siege-engine.com>
6 ;; Created: 2007-06-05 21:46:56-0400
7 ;; Keywords: syntax
8 ;; X-RCS: $Id: wisent-java-wy.el,v 1.1 2007-11-26 15:12:32 michaels Exp $
9
10 ;; This file is not part of GNU Emacs.
11 ;;
12 ;; This program is free software; you can redistribute it and/or
13 ;; modify it under the terms of the GNU General Public License as
14 ;; published by the Free Software Foundation; either version 2, or (at
15 ;; your option) any later version.
16 ;;
17 ;; This software 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 GNU
20 ;; General Public License for more details.
21 ;;
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
26
27 ;;; Commentary:
28 ;;
29 ;; PLEASE DO NOT MANUALLY EDIT THIS FILE!  It is automatically
30 ;; generated from the grammar file wisent-java.wy.
31
32 ;;; History:
33 ;;
34
35 ;;; Code:
36 \f
37 ;;; Prologue
38 ;;
39 ;; Stack of enum names in scope.
40   (defvar wisent-java-wy--enums nil)
41   ;; Stack of anonymous class declarations found in an expression.
42   (defvar wisent-java-wy--anons nil)
43 \f
44 ;;; Declarations
45 ;;
46 (defconst wisent-java-wy--keyword-table
47   (semantic-lex-make-keyword-table
48    '(("abstract" . ABSTRACT)
49      ("assert" . ASSERT)
50      ("boolean" . BOOLEAN)
51      ("break" . BREAK)
52      ("byte" . BYTE)
53      ("case" . CASE)
54      ("catch" . CATCH)
55      ("char" . CHAR)
56      ("class" . CLASS)
57      ("const" . CONST)
58      ("continue" . CONTINUE)
59      ("default" . DEFAULT)
60      ("do" . DO)
61      ("double" . DOUBLE)
62      ("else" . ELSE)
63      ("enum" . ENUM)
64      ("extends" . EXTENDS)
65      ("final" . FINAL)
66      ("finally" . FINALLY)
67      ("float" . FLOAT)
68      ("for" . FOR)
69      ("goto" . GOTO)
70      ("if" . IF)
71      ("implements" . IMPLEMENTS)
72      ("import" . IMPORT)
73      ("instanceof" . INSTANCEOF)
74      ("int" . INT)
75      ("interface" . INTERFACE)
76      ("long" . LONG)
77      ("native" . NATIVE)
78      ("new" . NEW)
79      ("package" . PACKAGE)
80      ("private" . PRIVATE)
81      ("protected" . PROTECTED)
82      ("public" . PUBLIC)
83      ("return" . RETURN)
84      ("short" . SHORT)
85      ("static" . STATIC)
86      ("strictfp" . STRICTFP)
87      ("super" . SUPER)
88      ("switch" . SWITCH)
89      ("synchronized" . SYNCHRONIZED)
90      ("this" . THIS)
91      ("throw" . THROW)
92      ("throws" . THROWS)
93      ("transient" . TRANSIENT)
94      ("try" . TRY)
95      ("void" . VOID)
96      ("volatile" . VOLATILE)
97      ("while" . WHILE)
98      ("@author" . _AUTHOR)
99      ("@version" . _VERSION)
100      ("@param" . _PARAM)
101      ("@return" . _RETURN)
102      ("@exception" . _EXCEPTION)
103      ("@throws" . _THROWS)
104      ("@see" . _SEE)
105      ("@since" . _SINCE)
106      ("@serial" . _SERIAL)
107      ("@serialData" . _SERIALDATA)
108      ("@serialField" . _SERIALFIELD)
109      ("@deprecated" . _DEPRECATED))
110    '(("@deprecated" javadoc
111       (seq 12 usage
112            (type function variable)
113            opt t))
114      ("@serialField" javadoc
115       (seq 11 usage
116            (variable)
117            opt t))
118      ("@serialData" javadoc
119       (seq 10 usage
120            (function)
121            opt t))
122      ("@serial" javadoc
123       (seq 9 usage
124            (variable)
125            opt t))
126      ("@since" javadoc
127       (seq 8 usage
128            (type function variable)
129            opt t))
130      ("@see" javadoc
131       (seq 7 usage
132            (type function variable)
133            opt t with-ref t))
134      ("@throws" javadoc
135       (seq 6 usage
136            (function)
137            with-name t))
138      ("@exception" javadoc
139       (seq 5 usage
140            (function)
141            with-name t))
142      ("@return" javadoc
143       (seq 4 usage
144            (function)))
145      ("@param" javadoc
146       (seq 3 usage
147            (function)
148            with-name t))
149      ("@version" javadoc
150       (seq 2 usage
151            (type)))
152      ("@author" javadoc
153       (seq 1 usage
154            (type)))
155      ("while" summary "while (<expr>) <stmt> | do <stmt> while (<expr>);")
156      ("volatile" summary "Field declaration modifier: volatile <type> <name> ...")
157      ("void" summary "Method return type: void <name> ...")
158      ("try" summary "try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
159      ("transient" summary "Field declaration modifier: transient <type> <name> ...")
160      ("throws" summary "Method|Constructor declaration: throws <classType>, ...")
161      ("throw" summary "throw <expr> ;")
162      ("synchronized" summary "synchronized (<expr>) ... | Method decl. modifier: synchronized <type> <name> ...")
163      ("switch" summary "switch(<expr>) {[case <const-expr>: <stmts> ...] [default: <stmts>]}")
164      ("strictfp" summary "Declaration modifier: strictfp {class|interface|<type>} <name> ...")
165      ("static" summary "Declaration modifier: static {class|interface|<type>} <name> ...")
166      ("short" summary "Integral primitive type (-32768 to 32767)")
167      ("return" summary "return [<expr>] ;")
168      ("public" summary "Access level modifier: public {class|interface|<type>} <name> ...")
169      ("protected" summary "Access level modifier: protected {class|interface|<type>} <name> ...")
170      ("private" summary "Access level modifier: private {class|interface|<type>} <name> ...")
171      ("package" summary "Package declaration: package <name>")
172      ("native" summary "Method declaration modifier: native <type> <name> ...")
173      ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
174      ("interface" summary "Interface declaration: interface <name>")
175      ("int" summary "Integral primitive type (-2147483648 to 2147483647)")
176      ("import" summary "Import package declarations: import <package>")
177      ("implements" summary "Class SuperInterfaces declaration: implements <name> [, ...]")
178      ("if" summary "if (<expr>) <stmt> [else <stmt>]")
179      ("goto" summary "Unused reserved word")
180      ("for" summary "for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
181      ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
182      ("finally" summary "try {<stmts>} ... finally {<stmts>}")
183      ("final" summary "Class|Member declaration modifier: final {class|<type>} <name> ...")
184      ("extends" summary "SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
185      ("enum" summary "Enum declaration")
186      ("else" summary "if (<expr>) <stmt> else <stmt>")
187      ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
188      ("do" summary "do <stmt> while (<expr>);")
189      ("default" summary "switch(<expr>) { ... default: <stmts>}")
190      ("continue" summary "continue [<label>] ;")
191      ("const" summary "Unused reserved word")
192      ("class" summary "Class declaration: class <name>")
193      ("char" summary "Integral primitive type ('u0000' to 'uffff') (0 to 65535)")
194      ("catch" summary "try {<stmts>} catch(<parm>) {<stmts>} ... ")
195      ("case" summary "switch(<expr>) {case <const-expr>: <stmts> ... }")
196      ("byte" summary "Integral primitive type (-128 to 127)")
197      ("break" summary "break [<label>] ;")
198      ("boolean" summary "Primitive logical quantity type (true or false)")
199      ("assert" summary "Assertion statement: assert <expr> [,<expr> ...];")
200      ("abstract" summary "Class|Method declaration modifier: abstract {class|<type>} <name> ...")))
201   "Table of language keywords.")
202
203 (defconst wisent-java-wy--token-table
204   (semantic-lex-make-type-table
205    '(("number"
206       (NUMBER_LITERAL))
207      ("string"
208       (STRING_LITERAL))
209      ("symbol"
210       (IDENTIFIER)
211       (BOOLEAN_LITERAL . "\\`true\\'")
212       (BOOLEAN_LITERAL . "\\`false\\'")
213       (NULL_LITERAL . "\\`null\\'"))
214      ("punctuation"
215       (AT . "@")
216       (ELLIPSIS . "...")
217       (COMP . "~")
218       (OROR . "||")
219       (OREQ . "|=")
220       (OR . "|")
221       (XOREQ . "^=")
222       (XOR . "^")
223       (QUESTION . "?")
224       (URSHIFTEQ . ">>>=")
225       (URSHIFT . ">>>")
226       (RSHIFTEQ . ">>=")
227       (RSHIFT . ">>")
228       (GTEQ . ">=")
229       (GT . ">")
230       (EQEQ . "==")
231       (EQ . "=")
232       (LTEQ . "<=")
233       (LSHIFTEQ . "<<=")
234       (LSHIFT . "<<")
235       (LT . "<")
236       (SEMICOLON . ";")
237       (COLON . ":")
238       (DIVEQ . "/=")
239       (DIV . "/")
240       (DOT . ".")
241       (MINUSEQ . "-=")
242       (MINUSMINUS . "--")
243       (MINUS . "-")
244       (COMMA . ",")
245       (PLUSEQ . "+=")
246       (PLUSPLUS . "++")
247       (PLUS . "+")
248       (MULTEQ . "*=")
249       (MULT . "*")
250       (ANDEQ . "&=")
251       (ANDAND . "&&")
252       (AND . "&")
253       (MODEQ . "%=")
254       (MOD . "%")
255       (NOTEQ . "!=")
256       (NOT . "!"))
257      ("close-paren"
258       (RBRACK . "]")
259       (RBRACE . "}")
260       (RPAREN . ")"))
261      ("open-paren"
262       (LBRACK . "[")
263       (LBRACE . "{")
264       (LPAREN . "("))
265      ("block"
266       (BRACK_BLOCK . "(LBRACK RBRACK)")
267       (BRACE_BLOCK . "(LBRACE RBRACE)")
268       (PAREN_BLOCK . "(LPAREN RPAREN)")))
269    '(("keyword" :declared t)
270      ("number" :declared t)
271      ("string" :declared t)
272      ("symbol" :declared t)
273      ("punctuation" :declared t)
274      ("block" :declared t)))
275   "Table of lexical tokens.")
276
277 (defconst wisent-java-wy--parse-table
278   (progn
279     (eval-when-compile
280       (require 'wisent-comp))
281     (wisent-compile-grammar
282      '((PAREN_BLOCK BRACE_BLOCK BRACK_BLOCK LPAREN RPAREN LBRACE RBRACE LBRACK RBRACK NOT NOTEQ MOD MODEQ AND ANDAND ANDEQ MULT MULTEQ PLUS PLUSPLUS PLUSEQ COMMA MINUS MINUSMINUS MINUSEQ DOT DIV DIVEQ COLON SEMICOLON LT LSHIFT LSHIFTEQ LTEQ EQ EQEQ GT GTEQ RSHIFT RSHIFTEQ URSHIFT URSHIFTEQ QUESTION XOR XOREQ OR OREQ OROR COMP ELLIPSIS AT NULL_LITERAL BOOLEAN_LITERAL IDENTIFIER STRING_LITERAL NUMBER_LITERAL ABSTRACT ASSERT BOOLEAN BREAK BYTE CASE CATCH CHAR CLASS CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTENDS FINAL FINALLY FLOAT FOR GOTO IF IMPLEMENTS IMPORT INSTANCEOF INT INTERFACE LONG NATIVE NEW PACKAGE PRIVATE PROTECTED PUBLIC RETURN SHORT STATIC STRICTFP SUPER SWITCH SYNCHRONIZED THIS THROW THROWS TRANSIENT TRY VOID VOLATILE WHILE _AUTHOR _VERSION _PARAM _RETURN _EXCEPTION _THROWS _SEE _SINCE _SERIAL _SERIALDATA _SERIALFIELD _DEPRECATED)
283        nil
284        (goal
285         ((compilation_unit)))
286        (literal
287         ((NUMBER_LITERAL))
288         ((BOOLEAN_LITERAL))
289         ((STRING_LITERAL))
290         ((NULL_LITERAL)))
291        (type
292         ((primitive_type))
293         ((reference_type)))
294        (primitive_type
295         ((numeric_type))
296         ((BOOLEAN)))
297        (numeric_type
298         ((integral_type))
299         ((floating_point_type)))
300        (integral_type
301         ((BYTE))
302         ((SHORT))
303         ((INT))
304         ((LONG))
305         ((CHAR)))
306        (floating_point_type
307         ((FLOAT))
308         ((DOUBLE)))
309        (reference_type
310         ((class_or_interface_type))
311         ((array_type)))
312        (type_variable
313         ((IDENTIFIER)))
314        (class_or_interface
315         ((name))
316         ((class_or_interface LT type_argument_list_1 DOT name)
317          (concat $1 $2 $3 $4 $5)))
318        (class_or_interface_type
319         ((class_or_interface))
320         ((class_or_interface LT type_argument_list_1)
321          (concat $1 $2 $3)))
322        (class_type
323         ((class_or_interface_type)))
324        (interface_type
325         ((class_or_interface_type)))
326        (array_type
327         ((primitive_type dims)
328          (concat $1 $2))
329         ((name dims)
330          (concat $1 $2))
331         ((class_or_interface LT type_argument_list_1 DOT name dims)
332          (concat $1 $2 $3 $4 $5 $6))
333         ((class_or_interface LT type_argument_list_1 dims)
334          (concat $1 $2 $3 $4)))
335        (type_arguments_opt
336         ((type_arguments))
337         (nil
338          (progn "")))
339        (type_arguments
340         ((LT type_argument_list_1)
341          (concat $1 $2)))
342        (wildcard
343         ((QUESTION))
344         ((QUESTION EXTENDS reference_type)
345          (concat $1 " " $2 " " $3))
346         ((QUESTION SUPER reference_type)
347          (concat $1 " " $2 " " $3)))
348        (wildcard_1
349         ((QUESTION GT)
350          (concat $1 $2))
351         ((QUESTION EXTENDS reference_type_1)
352          (concat $1 " " $2 " " $3))
353         ((QUESTION SUPER reference_type_1)
354          (concat $1 " " $2 " " $3)))
355        (wildcard_2
356         ((QUESTION RSHIFT)
357          (concat $1 $2))
358         ((QUESTION EXTENDS reference_type_2)
359          (concat $1 " " $2 " " $3))
360         ((QUESTION SUPER reference_type_2)
361          (concat $1 " " $2 " " $3)))
362        (wildcard_3
363         ((QUESTION URSHIFT)
364          (concat $1 $2))
365         ((QUESTION EXTENDS reference_type_3)
366          (concat $1 " " $2 " " $3))
367         ((QUESTION SUPER reference_type_3)
368          (concat $1 " " $2 " " $3)))
369        (reference_type_1
370         ((reference_type GT)
371          (concat $1 $2))
372         ((class_or_interface LT type_argument_list_2)
373          (concat $1 $2 $3)))
374        (reference_type_2
375         ((reference_type RSHIFT)
376          (concat $1 $2))
377         ((class_or_interface LT type_argument_list_3)
378          (concat $1 $2 $3)))
379        (reference_type_3
380         ((reference_type URSHIFT)
381          (concat $1 $2)))
382        (type_argument_list
383         ((type_argument))
384         ((type_argument_list COMMA type_argument)
385          (concat $1 $2 $3)))
386        (type_argument_list_1
387         ((type_argument_1))
388         ((type_argument_list COMMA type_argument_1)
389          (concat $1 $2 $3)))
390        (type_argument_list_2
391         ((type_argument_2))
392         ((type_argument_list COMMA type_argument_2)
393          (concat $1 $2 $3)))
394        (type_argument_list_3
395         ((type_argument_3))
396         ((type_argument_list COMMA type_argument_3)
397          (concat $1 $2 $3)))
398        (type_argument
399         ((reference_type))
400         ((wildcard)))
401        (type_argument_1
402         ((reference_type_1))
403         ((wildcard_1)))
404        (type_argument_2
405         ((reference_type_2))
406         ((wildcard_2)))
407        (type_argument_3
408         ((reference_type_3))
409         ((wildcard_3)))
410        (name
411         ((simple_name))
412         ((qualified_name)))
413        (simple_name
414         ((IDENTIFIER)))
415        (qualified_name
416         ((name DOT IDENTIFIER)
417          (concat $1 $2 $3)))
418        (compilation_unit
419         ((package_declaration))
420         ((import_declaration))
421         ((type_declaration)))
422        (package_declaration
423         ((modifiers_opt PACKAGE name SEMICOLON)
424          (wisent-cook-tag
425           (wisent-raw-tag
426            (semantic-tag-new-package $3 nil :typemodifiers $1)))))
427        (import_declaration
428         ((IMPORT name SEMICOLON)
429          (wisent-cook-tag
430           (wisent-raw-tag
431            (semantic-tag-new-include $2 nil))))
432         ((IMPORT name DOT MULT SEMICOLON)
433          (wisent-cook-tag
434           (wisent-raw-tag
435            (semantic-tag-new-include
436             (concat $2 $3 $4)
437             nil))))
438         ((IMPORT STATIC name SEMICOLON)
439          (wisent-cook-tag
440           (wisent-raw-tag
441            (semantic-tag-new-include $3 nil :static-flag t))))
442         ((IMPORT STATIC name DOT MULT SEMICOLON)
443          (wisent-cook-tag
444           (wisent-raw-tag
445            (semantic-tag-new-include
446             (concat $3 $4 $5)
447             nil :static-flag t)))))
448        (type_declaration
449         ((class_declaration))
450         ((interface_declaration))
451         ((enum_declaration))
452         ((annotation_type_declaration)
453          nil)
454         ((SEMICOLON)
455          nil))
456        (modifiers_opt
457         (nil)
458         ((modifiers)))
459        (modifiers
460         ((modifier)
461          (list $1))
462         ((modifiers modifier)
463          (append $1
464                  (list $2))))
465        (modifier
466         ((PUBLIC))
467         ((PROTECTED))
468         ((PRIVATE))
469         ((STATIC))
470         ((ABSTRACT))
471         ((FINAL))
472         ((NATIVE))
473         ((SYNCHRONIZED))
474         ((TRANSIENT))
475         ((VOLATILE))
476         ((STRICTFP))
477         ((annotation)))
478        (class_declaration
479         ((modifiers_opt CLASS IDENTIFIER type_parameters_opt super_opt interfaces_opt class_body)
480          (wisent-cook-tag
481           (wisent-raw-tag
482            (semantic-tag-new-type $3 $2 $7
483                                   (if
484                                       (or $5 $6)
485                                       (cons $5 $6))
486                                   :typemodifiers $1 :template-specifier $4)))))
487        (super
488         ((EXTENDS class_type)
489          (progn $2)))
490        (super_opt
491         (nil)
492         ((super)))
493        (interfaces
494         ((IMPLEMENTS interface_type_list)
495          (progn $2)))
496        (interfaces_opt
497         (nil)
498         ((interfaces)
499          (nreverse $1)))
500        (interface_type_list
501         ((interface_type)
502          (list $1))
503         ((interface_type_list COMMA interface_type)
504          (cons $3 $1)))
505        (class_body
506         ((LBRACE class_body_declarations_opt RBRACE)
507          (progn $2)))
508        (class_body_opt
509         (nil)
510         ((class_body)))
511        (class_body_declarations_opt
512         (nil)
513         ((class_body_declarations)
514          (apply 'nconc
515                 (nreverse $1))))
516        (class_body_declarations
517         ((class_body_declaration)
518          (list $1))
519         ((class_body_declarations class_body_declaration)
520          (cons $2 $1)))
521        (class_body_declaration
522         ((class_member_declaration))
523         ((static_initializer))
524         ((constructor_declaration))
525         ((block))
526         ((error)
527          (wisent-skip-token)))
528        (class_member_declaration
529         ((field_declaration))
530         ((method_declaration))
531         ((class_declaration))
532         ((enum_declaration))
533         ((interface_declaration))
534         ((SEMICOLON)
535          nil))
536        (enum_declaration
537         ((modifiers_opt ENUM IDENTIFIER interfaces_opt
538                         (push $3 wisent-java-wy--enums)
539                         enum_body)
540          (progn
541            (pop wisent-java-wy--enums)
542            (wisent-cook-tag
543             (wisent-raw-tag
544              (semantic-tag-new-type $3 $2 $6
545                                     (if $4
546                                         (cons nil $4))
547                                     :typemodifiers $1))))))
548        (enum_body
549         ((LBRACE enum_constants_opt enum_body_declarations_opt RBRACE)
550          (nconc $2 $3))
551         ((LBRACE error)
552          (wisent-skip-block nil)))
553        (enum_constants_opt
554         (nil)
555         ((enum_constants)
556          (apply 'nconc
557                 (nreverse $1))))
558        (enum_constants
559         ((enum_constant)
560          (list $1))
561         ((enum_constants COMMA enum_constant)
562          (cons $3 $1)))
563        (enum_constant
564         ((IDENTIFIER enum_arguments_opt)
565          (wisent-cook-tag
566           (wisent-raw-tag
567            (semantic-tag-new-type $1
568                                   (car wisent-java-wy--enums)
569                                   nil nil :enum-constant-flag t))))
570         ((IDENTIFIER enum_arguments_opt class_body)
571          (wisent-cook-tag
572           (wisent-raw-tag
573            (semantic-tag-new-type $1
574                                   (car wisent-java-wy--enums)
575                                   $3 nil :enum-constant-flag t)))))
576        (enum_arguments_opt
577         (nil)
578         ((LPAREN argument_list_opt RPAREN))
579         ((LPAREN error)
580          (wisent-skip-block nil)))
581        (enum_body_declarations_opt
582         (nil)
583         ((SEMICOLON class_body_declarations_opt)
584          (progn $2)))
585        (field_declaration
586         ((modifiers_opt type variable_declarators SEMICOLON)
587          (let*
588              ((decls
589                (mapcar 'car $3))
590               (anons
591                (apply 'nconc
592                       (nreverse
593                        (mapcar 'cdr $3)))))
594            (wisent-cook-tag
595             (wisent-raw-tag
596              (semantic-tag-new-variable decls $2 nil :typemodifiers $1 :members anons))))))
597        (variable_declarators
598         ((variable_declarator)
599          (list $1))
600         ((variable_declarators COMMA variable_declarator)
601          (progn
602            (setcdr
603             (cdar
604              (car $1))
605             (cdr $region2))
606            (cons $3 $1))))
607        (variable_declarator
608         ((variable_declarator_id)
609          (cons
610           (cons $1 $region)
611           nil))
612         ((variable_declarator_id
613           (setq wisent-java-wy--anons nil)
614           EQ variable_initializer)
615          (cons
616           (cons $1 $region)
617           wisent-java-wy--anons)))
618        (variable_declarator_id
619         ((IDENTIFIER))
620         ((variable_declarator_id LBRACK RBRACK)
621          (concat $1 $2 $3)))
622        (variable_initializer
623         ((expression))
624         ((array_initializer)))
625        (method_declaration
626         ((method_header method_body)
627          (let
628              ((tag
629                (eval $1)))
630            (wisent-cook-tag tag))))
631        (method_header
632         ((modifiers_opt type method_declarator throws_opt)
633          `(wisent-raw-tag
634            (semantic-tag-new-function ',(car $3)
635                                       ',$2 ',(cdr $3)
636                                       :typemodifiers ',$1 :throws ',$4)))
637         ((modifiers_opt LT type_parameter_list_1 type method_declarator throws_opt)
638          `(wisent-raw-tag
639            (semantic-tag-new-function ',(car $5)
640                                       ',$4 ',(cdr $5)
641                                       :typemodifiers ',$1 :template-specifier ',(concat $2 $3)
642                                       :throws ',$6)))
643         ((modifiers_opt VOID method_declarator throws_opt)
644          `(wisent-raw-tag
645            (semantic-tag-new-function ',(car $3)
646                                       ',$2 ',(cdr $3)
647                                       :typemodifiers ',$1 :throws ',$4)))
648         ((modifiers_opt LT type_parameter_list_1 VOID method_declarator throws_opt)
649          `(wisent-raw-tag
650            (semantic-tag-new-function ',(car $5)
651                                       ',$4 ',(cdr $5)
652                                       :typemodifiers ',$1 :template-specifier ',(concat $2 $3)
653                                       :throws ',$6))))
654        (method_declarator
655         ((IDENTIFIER LPAREN formal_parameter_list_opt RPAREN)
656          (cons $1 $3))
657         ((IDENTIFIER LPAREN error)
658          (prog1
659              (list $1)
660            (wisent-skip-block $region2)))
661         ((method_declarator LBRACK RBRACK)
662          (cons
663           (concat
664            (car $1)
665            $2 $3)
666           (cdr $1))))
667        (formal_parameter_list_opt
668         (nil)
669         ((formal_parameter_list)
670          (apply 'nconc
671                 (nreverse $1))))
672        (formal_parameter_list
673         ((formal_parameter)
674          (list $1))
675         ((formal_parameter_list COMMA formal_parameter)
676          (cons $3 $1)))
677        (formal_parameter
678         ((type variable_declarator_id)
679          (wisent-cook-tag
680           (wisent-raw-tag
681            (semantic-tag-new-variable $2 $1 nil))))
682         ((modifiers type variable_declarator_id)
683          (wisent-cook-tag
684           (wisent-raw-tag
685            (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
686         ((type ELLIPSIS IDENTIFIER)
687          (wisent-cook-tag
688           (wisent-raw-tag
689            (semantic-tag-new-variable $3 $1 nil :vararg-flag t))))
690         ((modifiers type ELLIPSIS IDENTIFIER)
691          (wisent-cook-tag
692           (wisent-raw-tag
693            (semantic-tag-new-variable $4 $2 nil :typemodifiers $1 :vararg-flag t)))))
694        (throws_opt
695         (nil)
696         ((throws)))
697        (throws
698         ((THROWS class_type_list)
699          (nreverse $2)))
700        (class_type_list
701         ((class_type)
702          (list $1))
703         ((class_type_list COMMA class_type)
704          (cons $3 $1)))
705        (method_body
706         ((block))
707         ((SEMICOLON)
708          nil))
709        (static_initializer
710         ((STATIC block)
711          (when $2
712            (semantic-tag-put-attribute $2 :typemodifiers
713                                        (list $1))
714            $2)))
715        (constructor_declaration
716         ((modifiers_opt constructor_declarator throws_opt constructor_body)
717          (wisent-cook-tag
718           (wisent-raw-tag
719            (semantic-tag-new-function
720             (car $2)
721             nil
722             (cdr $2)
723             :typemodifiers $1 :throws $3 :constructor-flag t))))
724         ((modifiers_opt LT type_parameter_list_1 constructor_declarator throws_opt constructor_body)
725          (wisent-cook-tag
726           (wisent-raw-tag
727            (semantic-tag-new-function
728             (car $4)
729             nil
730             (cdr $4)
731             :typemodifiers $1 :template-specifier
732             (concat $2 $3)
733             :throws $5 :constructor-flag t)))))
734        (constructor_declarator
735         ((simple_name LPAREN formal_parameter_list_opt RPAREN)
736          (cons $1 $3))
737         ((simple_name LPAREN error)
738          (prog1
739              (list $1)
740            (wisent-skip-block $region2))))
741        (constructor_body
742         ((LBRACE explicit_constructor_invocation block_statements RBRACE)
743          (progn $3))
744         ((LBRACE explicit_constructor_invocation RBRACE)
745          nil)
746         ((LBRACE block_statements RBRACE)
747          (progn $2))
748         ((LBRACE RBRACE)
749          nil)
750         ((LBRACE error)
751          (wisent-skip-block nil)))
752        (explicit_constructor_invocation
753         ((THIS LPAREN argument_list_opt RPAREN SEMICOLON))
754         ((type_arguments THIS LPAREN argument_list_opt RPAREN SEMICOLON))
755         ((SUPER LPAREN argument_list_opt RPAREN SEMICOLON))
756         ((type_arguments SUPER LPAREN argument_list_opt RPAREN SEMICOLON))
757         ((primary DOT SUPER LPAREN argument_list_opt RPAREN SEMICOLON))
758         ((primary DOT type_arguments SUPER LPAREN argument_list_opt RPAREN SEMICOLON))
759         ((name DOT SUPER LPAREN argument_list_opt RPAREN SEMICOLON))
760         ((name DOT type_arguments SUPER LPAREN argument_list_opt RPAREN SEMICOLON)))
761        (interface_declaration
762         ((modifiers_opt INTERFACE IDENTIFIER type_parameters_opt extends_interfaces_opt interface_body)
763          (wisent-cook-tag
764           (wisent-raw-tag
765            (semantic-tag-new-type $3 $2 $6
766                                   (if $5
767                                       (cons nil $5))
768                                   :template-specifier $4 :typemodifiers $1)))))
769        (extends_interfaces_opt
770         (nil)
771         ((extends_interfaces)
772          (nreverse $1)))
773        (extends_interfaces
774         ((EXTENDS interface_type)
775          (list $2))
776         ((extends_interfaces COMMA interface_type)
777          (cons $3 $1)))
778        (interface_body
779         ((LBRACE interface_member_declarations_opt RBRACE)
780          (progn $2)))
781        (interface_member_declarations_opt
782         (nil)
783         ((interface_member_declarations)
784          (apply 'nconc
785                 (nreverse $1))))
786        (interface_member_declarations
787         ((interface_member_declaration)
788          (list $1))
789         ((interface_member_declarations interface_member_declaration)
790          (cons $2 $1)))
791        (interface_member_declaration
792         ((constant_declaration))
793         ((abstract_method_declaration))
794         ((class_declaration))
795         ((enum_declaration))
796         ((interface_declaration))
797         ((SEMICOLON)
798          nil)
799         ((error)
800          (wisent-skip-token)))
801        (constant_declaration
802         ((field_declaration)))
803        (abstract_method_declaration
804         ((method_header SEMICOLON)
805          (let
806              ((tag
807                (eval $1)))
808            (wisent-cook-tag tag))))
809        (array_initializer
810         ((LBRACE variable_initializers COMMA RBRACE))
811         ((LBRACE variable_initializers RBRACE))
812         ((LBRACE COMMA RBRACE))
813         ((LBRACE RBRACE))
814         ((LBRACE error)
815          (wisent-skip-block nil)))
816        (variable_initializers
817         ((variable_initializer))
818         ((variable_initializers COMMA variable_initializer)))
819        (block
820            ((LBRACE block_statements_opt RBRACE)
821             (progn $2))
822          ((LBRACE error)
823           (wisent-skip-block nil)))
824        (block_statements_opt
825         (nil)
826         ((block_statements)))
827        (block_statements
828         ((block_statements_reverse)
829          (wisent-cook-tag
830           (wisent-raw-tag
831            (semantic-tag "block" 'block :members
832                          (apply 'nconc
833                                 (nreverse $1)))))))
834        (block_statements_reverse
835         ((block_statement)
836          (list $1))
837         ((block_statements_reverse block_statement)
838          (cons $2 $1)))
839        (block_statement
840         ((local_variable_declaration_statement))
841         ((statement)
842          nil)
843         ((class_declaration))
844         ((enum_declaration))
845         ((interface_declaration)))
846        (local_variable_declaration_statement
847         ((local_variable_declaration SEMICOLON)))
848        (local_variable_declaration
849         ((type variable_declarators)
850          (let*
851              ((decls
852                (mapcar 'car $2))
853               (anons
854                (apply 'nconc
855                       (nreverse
856                        (mapcar 'cdr $2)))))
857            (wisent-cook-tag
858             (wisent-raw-tag
859              (semantic-tag-new-variable decls $1 nil :members anons)))))
860         ((modifiers type variable_declarators)
861          (let*
862              ((decls
863                (mapcar 'car $3))
864               (anons
865                (apply 'nconc
866                       (nreverse
867                        (mapcar 'cdr $3)))))
868            (wisent-cook-tag
869             (wisent-raw-tag
870              (semantic-tag-new-variable decls $2 nil :typemodifiers $1 :members anons))))))
871        (statement
872         ((statement_without_trailing_substatement))
873         ((labeled_statement))
874         ((if_then_statement))
875         ((if_then_else_statement))
876         ((while_statement))
877         ((for_statement))
878         ((foreach_statement)))
879        (statement_no_short_if
880         ((statement_without_trailing_substatement))
881         ((labeled_statement_no_short_if))
882         ((if_then_else_statement_no_short_if))
883         ((while_statement_no_short_if))
884         ((for_statement_no_short_if))
885         ((foreach_statement_no_short_if)))
886        (statement_without_trailing_substatement
887         ((block))
888         ((empty_statement))
889         ((expression_statement))
890         ((switch_statement))
891         ((do_statement))
892         ((break_statement))
893         ((continue_statement))
894         ((return_statement))
895         ((synchronized_statement))
896         ((throw_statement))
897         ((try_statement))
898         ((assert_statement)))
899        (empty_statement
900         ((SEMICOLON)))
901        (labeled_statement
902         ((IDENTIFIER COLON statement)))
903        (labeled_statement_no_short_if
904         ((IDENTIFIER COLON statement_no_short_if)))
905        (expression_statement
906         ((statement_expression SEMICOLON)))
907        (statement_expression
908         ((assignment))
909         ((preincrement_expression))
910         ((predecrement_expression))
911         ((postincrement_expression))
912         ((postdecrement_expression))
913         ((method_invocation))
914         ((class_instance_creation_expression)))
915        (if_then_statement
916         ((IF LPAREN expression RPAREN statement)))
917        (if_then_else_statement
918         ((IF LPAREN expression RPAREN statement_no_short_if ELSE statement)))
919        (if_then_else_statement_no_short_if
920         ((IF LPAREN expression RPAREN statement_no_short_if ELSE statement_no_short_if)))
921        (switch_statement
922         ((SWITCH LPAREN expression RPAREN switch_block)))
923        (switch_block
924         ((LBRACE switch_block_statement_groups switch_labels RBRACE))
925         ((LBRACE switch_block_statement_groups RBRACE))
926         ((LBRACE switch_labels RBRACE))
927         ((LBRACE RBRACE))
928         ((LBRACE error)
929          (wisent-skip-block nil)))
930        (switch_block_statement_groups
931         ((switch_block_statement_group))
932         ((switch_block_statement_groups switch_block_statement_group)))
933        (switch_block_statement_group
934         ((switch_labels block_statements)))
935        (switch_labels
936         ((switch_label))
937         ((switch_labels switch_label)))
938        (switch_label
939         ((CASE constant_expression COLON))
940         ((DEFAULT COLON)))
941        (while_statement
942         ((WHILE LPAREN expression RPAREN statement)))
943        (while_statement_no_short_if
944         ((WHILE LPAREN expression RPAREN statement_no_short_if)))
945        (do_statement
946         ((DO statement WHILE LPAREN expression RPAREN SEMICOLON)))
947        (foreach_statement
948         ((FOR LPAREN type variable_declarator_id COLON expression RPAREN statement)
949          nil)
950         ((FOR LPAREN modifiers type variable_declarator_id COLON expression RPAREN statement)
951          nil)
952         ((FOR IDENTIFIER LPAREN type variable_declarator_id IDENTIFIER expression RPAREN statement)
953          nil)
954         ((FOR IDENTIFIER LPAREN modifiers type variable_declarator_id IDENTIFIER expression RPAREN statement)
955          nil))
956        (foreach_statement_no_short_if
957         ((FOR LPAREN type variable_declarator_id COLON expression RPAREN statement_no_short_if)
958          nil)
959         ((FOR LPAREN modifiers type variable_declarator_id COLON expression RPAREN statement_no_short_if)
960          nil)
961         ((FOR IDENTIFIER LPAREN type variable_declarator_id IDENTIFIER expression RPAREN statement_no_short_if)
962          nil)
963         ((FOR IDENTIFIER LPAREN modifiers type variable_declarator_id IDENTIFIER expression RPAREN statement_no_short_if)
964          nil))
965        (for_statement
966         ((FOR LPAREN for_init_opt SEMICOLON expression_opt SEMICOLON for_update_opt RPAREN statement)
967          (progn $3)))
968        (for_statement_no_short_if
969         ((FOR LPAREN for_init_opt SEMICOLON expression_opt SEMICOLON for_update_opt RPAREN statement_no_short_if)
970          (progn $3)))
971        (for_init_opt
972         (nil)
973         ((for_init)))
974        (for_init
975         ((statement_expression_list)
976          nil)
977         ((local_variable_declaration)))
978        (for_update_opt
979         (nil)
980         ((for_update)))
981        (for_update
982         ((statement_expression_list)))
983        (statement_expression_list
984         ((statement_expression))
985         ((statement_expression_list COMMA statement_expression)))
986        (identifier_opt
987         (nil)
988         ((IDENTIFIER)))
989        (break_statement
990         ((BREAK identifier_opt SEMICOLON)))
991        (continue_statement
992         ((CONTINUE identifier_opt SEMICOLON)))
993        (return_statement
994         ((RETURN expression_opt SEMICOLON)))
995        (throw_statement
996         ((THROW expression SEMICOLON)))
997        (synchronized_statement
998         ((SYNCHRONIZED LPAREN expression RPAREN block)))
999        (try_statement
1000         ((TRY block catches))
1001         ((TRY block catches_opt finally)))
1002        (catches_opt
1003         (nil)
1004         ((catches)))
1005        (catches
1006         ((catch_clause))
1007         ((catches catch_clause)))
1008        (catch_clause
1009         ((CATCH LPAREN formal_parameter RPAREN block)))
1010        (finally
1011         ((FINALLY block)))
1012        (assert_statement
1013         ((ASSERT expression SEMICOLON))
1014         ((ASSERT expression COLON expression SEMICOLON)))
1015        (primary
1016         ((primary_no_new_array))
1017         ((array_creation_init))
1018         ((array_creation_uninit)))
1019        (primary_no_new_array
1020         ((literal))
1021         ((THIS))
1022         ((LPAREN name RPAREN))
1023         ((LPAREN expression_no_name RPAREN))
1024         ((class_instance_creation_expression))
1025         ((field_access))
1026         ((method_invocation))
1027         ((array_access))
1028         ((name DOT THIS))
1029         ((VOID DOT CLASS))
1030         ((primitive_type DOT CLASS))
1031         ((primitive_type dims DOT CLASS))
1032         ((name DOT CLASS))
1033         ((name dims DOT CLASS)))
1034        (class_instance_creation_expression
1035         ((NEW class_or_interface_type LPAREN argument_list_opt RPAREN class_body_opt)
1036          (when $6
1037            (setq wisent-java-wy--anons
1038                  (nconc wisent-java-wy--anons
1039                         (wisent-cook-tag
1040                          (wisent-raw-tag
1041                           (semantic-tag-new-type
1042                            (concat $2 "$")
1043                            "class" $6 nil)))))))
1044         ((NEW type_arguments class_or_interface_type LPAREN argument_list_opt RPAREN class_body_opt)
1045          (when $7
1046            (setq wisent-java-wy--anons
1047                  (nconc wisent-java-wy--anons
1048                         (wisent-cook-tag
1049                          (wisent-raw-tag
1050                           (semantic-tag-new-type
1051                            (concat $3 "$")
1052                            "class" $7 nil)))))))
1053         ((primary DOT NEW type_arguments_opt IDENTIFIER type_arguments_opt LPAREN argument_list_opt RPAREN class_body_opt)
1054          (when $10
1055            (setq wisent-java-wy--anons
1056                  (nconc wisent-java-wy--anons
1057                         (wisent-cook-tag
1058                          (wisent-raw-tag
1059                           (semantic-tag-new-type
1060                            (concat $5 "$")
1061                            "class" $10 nil)))))))
1062         ((name DOT NEW type_arguments_opt IDENTIFIER type_arguments_opt LPAREN argument_list_opt RPAREN class_body_opt)
1063          (when $10
1064            (setq wisent-java-wy--anons
1065                  (nconc wisent-java-wy--anons
1066                         (wisent-cook-tag
1067                          (wisent-raw-tag
1068                           (semantic-tag-new-type
1069                            (concat $5 "$")
1070                            "class" $10 nil))))))))
1071        (argument_list_opt
1072         (nil)
1073         ((argument_list)))
1074        (argument_list
1075         ((expression))
1076         ((argument_list COMMA expression)))
1077        (array_creation_uninit
1078         ((NEW primitive_type dim_exprs dims_opt))
1079         ((NEW class_or_interface_type dim_exprs dims_opt)))
1080        (array_creation_init
1081         ((NEW primitive_type dims array_initializer))
1082         ((NEW class_or_interface_type dims array_initializer)))
1083        (dim_exprs
1084         ((dim_expr))
1085         ((dim_exprs dim_expr)))
1086        (dim_expr
1087         ((LBRACK expression RBRACK))
1088         ((LBRACK error)
1089          (wisent-skip-block nil)))
1090        (dims_opt
1091         (nil
1092          (progn ""))
1093         ((dims)))
1094        (dims
1095         ((LBRACK RBRACK)
1096          (concat $1 $2))
1097         ((dims LBRACK RBRACK)
1098          (concat $1 $2 $3)))
1099        (field_access
1100         ((primary DOT IDENTIFIER))
1101         ((SUPER DOT IDENTIFIER))
1102         ((name DOT SUPER DOT IDENTIFIER)))
1103        (method_invocation
1104         ((name LPAREN argument_list_opt RPAREN))
1105         ((primary DOT IDENTIFIER LPAREN argument_list_opt RPAREN))
1106         ((primary DOT type_arguments IDENTIFIER LPAREN argument_list_opt RPAREN))
1107         ((name DOT type_arguments IDENTIFIER LPAREN argument_list_opt RPAREN))
1108         ((SUPER DOT IDENTIFIER LPAREN argument_list_opt RPAREN))
1109         ((SUPER DOT type_arguments IDENTIFIER LPAREN argument_list_opt RPAREN))
1110         ((name DOT SUPER DOT IDENTIFIER LPAREN argument_list_opt RPAREN))
1111         ((name DOT SUPER DOT type_arguments IDENTIFIER LPAREN argument_list_opt RPAREN)))
1112        (array_access
1113         ((name LBRACK expression RBRACK))
1114         ((primary_no_new_array LBRACK expression RBRACK))
1115         ((array_creation_init LBRACK expression RBRACK)))
1116        (postfix_expression
1117         ((primary))
1118         ((name))
1119         ((postincrement_expression))
1120         ((postdecrement_expression)))
1121        (postincrement_expression
1122         ((postfix_expression PLUSPLUS)))
1123        (postdecrement_expression
1124         ((postfix_expression MINUSMINUS)))
1125        (unary_expression
1126         ((preincrement_expression))
1127         ((predecrement_expression))
1128         ((PLUS unary_expression))
1129         ((MINUS unary_expression))
1130         ((unary_expression_not_plus_minus)))
1131        (preincrement_expression
1132         ((PLUSPLUS unary_expression)))
1133        (predecrement_expression
1134         ((MINUSMINUS unary_expression)))
1135        (unary_expression_not_plus_minus
1136         ((postfix_expression))
1137         ((COMP unary_expression))
1138         ((NOT unary_expression))
1139         ((cast_expression)))
1140        (cast_expression
1141         ((LPAREN primitive_type dims_opt RPAREN unary_expression))
1142         ((LPAREN name RPAREN unary_expression_not_plus_minus))
1143         ((LPAREN name dims RPAREN unary_expression_not_plus_minus))
1144         ((LPAREN name LT type_argument_list_1 dims_opt RPAREN unary_expression_not_plus_minus))
1145         ((LPAREN name LT type_argument_list_1 DOT class_or_interface_type dims_opt RPAREN unary_expression_not_plus_minus)))
1146        (multiplicative_expression
1147         ((unary_expression))
1148         ((multiplicative_expression MULT unary_expression))
1149         ((multiplicative_expression DIV unary_expression))
1150         ((multiplicative_expression MOD unary_expression)))
1151        (additive_expression
1152         ((multiplicative_expression))
1153         ((additive_expression PLUS multiplicative_expression))
1154         ((additive_expression MINUS multiplicative_expression)))
1155        (shift_expression
1156         ((additive_expression))
1157         ((shift_expression LSHIFT additive_expression))
1158         ((shift_expression RSHIFT additive_expression))
1159         ((shift_expression URSHIFT additive_expression)))
1160        (relational_expression
1161         ((shift_expression))
1162         ((relational_expression LT shift_expression))
1163         ((relational_expression GT shift_expression))
1164         ((relational_expression LTEQ shift_expression))
1165         ((relational_expression GTEQ shift_expression)))
1166        (instanceof_expression
1167         ((relational_expression))
1168         ((instanceof_expression INSTANCEOF reference_type)))
1169        (equality_expression
1170         ((instanceof_expression))
1171         ((equality_expression EQEQ instanceof_expression))
1172         ((equality_expression NOTEQ instanceof_expression)))
1173        (and_expression
1174         ((equality_expression))
1175         ((and_expression AND equality_expression)))
1176        (exclusive_or_expression
1177         ((and_expression))
1178         ((exclusive_or_expression XOR and_expression)))
1179        (inclusive_or_expression
1180         ((exclusive_or_expression))
1181         ((inclusive_or_expression OR exclusive_or_expression)))
1182        (conditional_and_expression
1183         ((inclusive_or_expression))
1184         ((conditional_and_expression ANDAND inclusive_or_expression)))
1185        (conditional_or_expression
1186         ((conditional_and_expression))
1187         ((conditional_or_expression OROR conditional_and_expression)))
1188        (conditional_expression
1189         ((conditional_or_expression))
1190         ((conditional_or_expression QUESTION expression COLON conditional_expression)))
1191        (assignment_expression
1192         ((conditional_expression))
1193         ((assignment)))
1194        (assignment
1195         ((postfix_expression assignment_operator assignment_expression)))
1196        (assignment_operator
1197         ((EQ))
1198         ((MULTEQ))
1199         ((DIVEQ))
1200         ((MODEQ))
1201         ((PLUSEQ))
1202         ((MINUSEQ))
1203         ((LSHIFTEQ))
1204         ((RSHIFTEQ))
1205         ((URSHIFTEQ))
1206         ((ANDEQ))
1207         ((XOREQ))
1208         ((OREQ)))
1209        (expression_opt
1210         (nil)
1211         ((expression)))
1212        (expression
1213         ((assignment_expression)))
1214        (constant_expression
1215         ((expression)))
1216        (type_parameters_opt
1217         ((type_parameters))
1218         (nil))
1219        (type_parameters
1220         ((LT type_parameter_list_1)
1221          (concat $1 $2)))
1222        (type_parameter_list
1223         ((type_parameter_list COMMA type_parameter)
1224          (concat $1 $2 $3))
1225         ((type_parameter)))
1226        (type_parameter_list_1
1227         ((type_parameter_1))
1228         ((type_parameter_list COMMA type_parameter_1)
1229          (concat $1 $2 $3)))
1230        (type_parameter
1231         ((type_variable type_bound_opt)
1232          (concat $1 $2)))
1233        (type_parameter_1
1234         ((type_variable GT)
1235          (concat $1 $2))
1236         ((type_variable type_bound_1)
1237          (concat $1 $2)))
1238        (type_bound_opt
1239         ((type_bound))
1240         (nil
1241          (progn "")))
1242        (type_bound
1243         ((EXTENDS reference_type additional_bound_list_opt)
1244          (concat $1 " " $2 " " $3)))
1245        (type_bound_1
1246         ((EXTENDS reference_type_1)
1247          (concat $1 " " $2))
1248         ((EXTENDS reference_type additional_bound_list_1)
1249          (concat $1 " " $2 " " $3)))
1250        (additional_bound_list_opt
1251         ((additional_bound_list))
1252         (nil
1253          (progn "")))
1254        (additional_bound_list
1255         ((additional_bound additional_bound_list)
1256          (concat $1 $2))
1257         ((additional_bound)))
1258        (additional_bound_list_1
1259         ((additional_bound additional_bound_list_1)
1260          (concat $1 $2))
1261         ((additional_bound_1)))
1262        (additional_bound
1263         ((AND interface_type)
1264          (concat $1 " " $2)))
1265        (additional_bound_1
1266         ((AND reference_type_1)
1267          (concat $1 " " $2)))
1268        (postfix_expression_no_name
1269         ((primary))
1270         ((postincrement_expression))
1271         ((postdecrement_expression)))
1272        (unary_expression_no_name
1273         ((preincrement_expression))
1274         ((predecrement_expression))
1275         ((PLUS unary_expression))
1276         ((MINUS unary_expression))
1277         ((unary_expression_not_plus_minus_no_name)))
1278        (unary_expression_not_plus_minus_no_name
1279         ((postfix_expression_no_name))
1280         ((COMP unary_expression))
1281         ((NOT unary_expression))
1282         ((cast_expression)))
1283        (multiplicative_expression_no_name
1284         ((unary_expression_no_name))
1285         ((name MULT unary_expression))
1286         ((multiplicative_expression_no_name MULT unary_expression))
1287         ((name DIV unary_expression))
1288         ((multiplicative_expression_no_name DIV unary_expression))
1289         ((name MOD unary_expression))
1290         ((multiplicative_expression_no_name MOD unary_expression)))
1291        (additive_expression_no_name
1292         ((multiplicative_expression_no_name))
1293         ((name PLUS multiplicative_expression))
1294         ((additive_expression_no_name PLUS multiplicative_expression))
1295         ((name MINUS multiplicative_expression))
1296         ((additive_expression_no_name MINUS multiplicative_expression)))
1297        (shift_expression_no_name
1298         ((additive_expression_no_name))
1299         ((name LSHIFT additive_expression))
1300         ((shift_expression_no_name LSHIFT additive_expression))
1301         ((name RSHIFT additive_expression))
1302         ((shift_expression_no_name RSHIFT additive_expression))
1303         ((name URSHIFT additive_expression))
1304         ((shift_expression_no_name URSHIFT additive_expression)))
1305        (relational_expression_no_name
1306         ((shift_expression_no_name))
1307         ((name LT shift_expression))
1308         ((shift_expression_no_name LT shift_expression))
1309         ((name GT shift_expression))
1310         ((shift_expression_no_name GT shift_expression))
1311         ((name LTEQ shift_expression))
1312         ((relational_expression_no_name LTEQ shift_expression))
1313         ((name GTEQ shift_expression))
1314         ((relational_expression_no_name GTEQ shift_expression)))
1315        (instanceof_expression_no_name
1316         ((relational_expression_no_name))
1317         ((name INSTANCEOF reference_type))
1318         ((instanceof_expression_no_name INSTANCEOF reference_type)))
1319        (equality_expression_no_name
1320         ((instanceof_expression_no_name))
1321         ((name EQEQ instanceof_expression))
1322         ((equality_expression_no_name EQEQ instanceof_expression))
1323         ((name NOTEQ instanceof_expression))
1324         ((equality_expression_no_name NOTEQ instanceof_expression)))
1325        (and_expression_no_name
1326         ((equality_expression_no_name))
1327         ((name AND equality_expression))
1328         ((and_expression_no_name AND equality_expression)))
1329        (exclusive_or_expression_no_name
1330         ((and_expression_no_name))
1331         ((name XOR and_expression))
1332         ((exclusive_or_expression_no_name XOR and_expression)))
1333        (inclusive_or_expression_no_name
1334         ((exclusive_or_expression_no_name))
1335         ((name OR exclusive_or_expression))
1336         ((inclusive_or_expression_no_name OR exclusive_or_expression)))
1337        (conditional_and_expression_no_name
1338         ((inclusive_or_expression_no_name))
1339         ((name ANDAND inclusive_or_expression))
1340         ((conditional_and_expression_no_name ANDAND inclusive_or_expression)))
1341        (conditional_or_expression_no_name
1342         ((conditional_and_expression_no_name))
1343         ((name OROR conditional_and_expression))
1344         ((conditional_or_expression_no_name OROR conditional_and_expression)))
1345        (conditional_expression_no_name
1346         ((conditional_or_expression_no_name))
1347         ((name QUESTION expression COLON conditional_expression))
1348         ((conditional_or_expression_no_name QUESTION expression COLON conditional_expression)))
1349        (assignment_expression_no_name
1350         ((conditional_expression_no_name))
1351         ((assignment)))
1352        (expression_no_name
1353         ((assignment_expression_no_name)))
1354        (annotation_type_declaration
1355         ((modifiers AT INTERFACE IDENTIFIER annotation_type_body))
1356         ((AT INTERFACE IDENTIFIER annotation_type_body)))
1357        (annotation_type_body
1358         ((LBRACE annotation_type_member_declarations_opt RBRACE))
1359         ((LBRACE error)
1360          (wisent-skip-block nil)))
1361        (annotation_type_member_declarations_opt
1362         (nil)
1363         ((annotation_type_member_declarations)))
1364        (annotation_type_member_declarations
1365         ((annotation_type_member_declaration))
1366         ((annotation_type_member_declarations annotation_type_member_declaration)))
1367        (annotation_type_member_declaration
1368         ((modifiers_opt type IDENTIFIER LPAREN RPAREN default_value_opt SEMICOLON))
1369         ((constant_declaration))
1370         ((class_declaration))
1371         ((interface_declaration))
1372         ((enum_declaration))
1373         ((annotation_type_declaration))
1374         ((SEMICOLON)))
1375        (default_value_opt
1376          (nil)
1377          ((default_value)))
1378        (default_value
1379          ((DEFAULT member_value)))
1380        (annotation
1381         ((AT name)
1382          (concat $1 $2))
1383         ((AT name LPAREN member_value RPAREN)
1384          (concat $1 $2))
1385         ((AT name LPAREN member_value_pairs RPAREN)
1386          (concat $1 $2))
1387         ((AT name LPAREN RPAREN)
1388          (concat $1 $2))
1389         ((AT name LPAREN error)
1390          (prog1
1391              (concat $1 $2)
1392            (wisent-skip-block $region3))))
1393        (member_value_pairs
1394         ((member_value_pair))
1395         ((member_value_pairs COMMA member_value_pair)))
1396        (member_value_pair
1397         ((simple_name EQ member_value)))
1398        (member_value
1399         ((conditional_expression))
1400         ((annotation))
1401         ((member_value_array_initializer)))
1402        (member_value_array_initializer
1403         ((LBRACE member_values COMMA RBRACE))
1404         ((LBRACE member_values RBRACE))
1405         ((LBRACE COMMA RBRACE))
1406         ((LBRACE RBRACE))
1407         ((LBRACE error)
1408          (wisent-skip-block nil)))
1409        (member_values
1410         ((member_value))
1411         ((member_values COMMA member_value))))
1412      '(goal package_declaration import_declaration class_declaration enum_declaration enum_constant field_declaration method_declaration formal_parameter constructor_declaration interface_declaration abstract_method_declaration block_statements local_variable_declaration block_statement)))
1413   "Parser table.")
1414
1415 (defun wisent-java-wy--install-parser ()
1416   "Setup the Semantic Parser."
1417   (semantic-install-function-overrides
1418    '((parse-stream . wisent-parse-stream)))
1419   (setq semantic-parser-name "LALR"
1420         semantic--parse-table wisent-java-wy--parse-table
1421         semantic-debug-parser-source "wisent-java.wy"
1422         semantic-flex-keywords-obarray wisent-java-wy--keyword-table
1423         semantic-lex-types-obarray wisent-java-wy--token-table)
1424   ;; Collect unmatched syntax lexical tokens
1425   (semantic-make-local-hook 'wisent-discarding-token-functions)
1426   (add-hook 'wisent-discarding-token-functions
1427             'wisent-collect-unmatched-syntax nil t))
1428
1429 \f
1430 ;;; Analyzers
1431 ;;
1432 (require 'semantic-lex)
1433
1434 (define-lex-keyword-type-analyzer wisent-java-wy--<keyword>-keyword-analyzer
1435   "keyword analyzer for <keyword> tokens."
1436   "\\(\\sw\\|\\s_\\)+")
1437
1438 (define-lex-block-type-analyzer wisent-java-wy--<block>-block-analyzer
1439   "block analyzer for <block> tokens."
1440   "\\s(\\|\\s)"
1441   '((("(" LPAREN PAREN_BLOCK)
1442      ("{" LBRACE BRACE_BLOCK)
1443      ("[" LBRACK BRACK_BLOCK))
1444     (")" RPAREN)
1445     ("}" RBRACE)
1446     ("]" RBRACK))
1447   )
1448
1449 (define-lex-regex-type-analyzer wisent-java-wy--<symbol>-regexp-analyzer
1450   "regexp analyzer for <symbol> tokens."
1451   "\\(\\sw\\|\\s_\\)+"
1452   '((BOOLEAN_LITERAL . "\\`true\\'")
1453     (BOOLEAN_LITERAL . "\\`false\\'")
1454     (NULL_LITERAL . "\\`null\\'"))
1455   'IDENTIFIER)
1456
1457 (define-lex-sexp-type-analyzer wisent-java-wy--<string>-sexp-analyzer
1458   "sexp analyzer for <string> tokens."
1459   "\\s\""
1460   'STRING_LITERAL)
1461
1462 (define-lex-regex-type-analyzer wisent-java-wy--<number>-regexp-analyzer
1463   "regexp analyzer for <number> tokens."
1464   semantic-lex-number-expression
1465   nil
1466   'NUMBER_LITERAL)
1467
1468 (define-lex-string-type-analyzer wisent-java-wy--<punctuation>-string-analyzer
1469   "string analyzer for <punctuation> tokens."
1470   "\\(\\s.\\|\\s$\\|\\s'\\)+"
1471   '((AT . "@")
1472     (ELLIPSIS . "...")
1473     (COMP . "~")
1474     (OROR . "||")
1475     (OREQ . "|=")
1476     (OR . "|")
1477     (XOREQ . "^=")
1478     (XOR . "^")
1479     (QUESTION . "?")
1480     (URSHIFTEQ . ">>>=")
1481     (URSHIFT . ">>>")
1482     (RSHIFTEQ . ">>=")
1483     (RSHIFT . ">>")
1484     (GTEQ . ">=")
1485     (GT . ">")
1486     (EQEQ . "==")
1487     (EQ . "=")
1488     (LTEQ . "<=")
1489     (LSHIFTEQ . "<<=")
1490     (LSHIFT . "<<")
1491     (LT . "<")
1492     (SEMICOLON . ";")
1493     (COLON . ":")
1494     (DIVEQ . "/=")
1495     (DIV . "/")
1496     (DOT . ".")
1497     (MINUSEQ . "-=")
1498     (MINUSMINUS . "--")
1499     (MINUS . "-")
1500     (COMMA . ",")
1501     (PLUSEQ . "+=")
1502     (PLUSPLUS . "++")
1503     (PLUS . "+")
1504     (MULTEQ . "*=")
1505     (MULT . "*")
1506     (ANDEQ . "&=")
1507     (ANDAND . "&&")
1508     (AND . "&")
1509     (MODEQ . "%=")
1510     (MOD . "%")
1511     (NOTEQ . "!=")
1512     (NOT . "!"))
1513   'punctuation)
1514
1515 \f
1516 ;;; Epilogue
1517 ;;
1518 ;; Define the lexer for this grammar
1519 (define-lex wisent-java-lexer
1520   "Lexical analyzer that handles Java buffers.
1521 It ignores whitespaces, newlines and comments."
1522   semantic-lex-ignore-whitespace
1523   semantic-lex-ignore-newline
1524   semantic-lex-ignore-comments
1525   ;;;; Auto-generated analyzers.
1526   wisent-java-wy--<number>-regexp-analyzer
1527   wisent-java-wy--<string>-sexp-analyzer
1528   ;; Must detect keywords before other symbols
1529   wisent-java-wy--<keyword>-keyword-analyzer
1530   wisent-java-wy--<symbol>-regexp-analyzer
1531   wisent-java-wy--<punctuation>-string-analyzer
1532   wisent-java-wy--<block>-block-analyzer
1533   ;;;;
1534   semantic-lex-default-action)
1535
1536 (provide 'wisent-java-wy)
1537
1538 ;;; wisent-java-wy.el ends here