1 ;;; wisent-java-tags-wy.el --- Generated parser support file
3 ;; Copyright (C) 2002, 2007 David Ponce
5 ;; Author: Eric M. Ludlam <zappo@projectile.siege-engine.com>
6 ;; Created: 2007-06-05 21:46:53-0400
8 ;; X-RCS: $Id: wisent-java-tags-wy.el,v 1.1 2007-11-26 15:12:31 michaels Exp $
10 ;; This file is not part of GNU Emacs.
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.
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.
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.
29 ;; PLEASE DO NOT MANUALLY EDIT THIS FILE! It is automatically
30 ;; generated from the grammar file wisent-java-tags.wy.
42 (defconst wisent-java-tags-wy--keyword-table
43 (semantic-lex-make-keyword-table
44 '(("abstract" . ABSTRACT)
53 ("continue" . CONTINUE)
65 ("implements" . IMPLEMENTS)
67 ("instanceof" . INSTANCEOF)
69 ("interface" . INTERFACE)
75 ("protected" . PROTECTED)
80 ("strictfp" . STRICTFP)
83 ("synchronized" . SYNCHRONIZED)
87 ("transient" . TRANSIENT)
90 ("volatile" . VOLATILE)
93 ("@version" . _VERSION)
96 ("@exception" . _EXCEPTION)
100 ("@serial" . _SERIAL)
101 ("@serialData" . _SERIALDATA)
102 ("@serialField" . _SERIALFIELD)
103 ("@deprecated" . _DEPRECATED))
104 '(("@deprecated" javadoc
106 (type function variable)
108 ("@serialField" javadoc
112 ("@serialData" javadoc
122 (type function variable)
126 (type function variable)
132 ("@exception" javadoc
149 ("while" summary "while (<expr>) <stmt> | do <stmt> while (<expr>);")
150 ("volatile" summary "Field declaration modifier: volatile <type> <name> ...")
151 ("void" summary "Method return type: void <name> ...")
152 ("try" summary "try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
153 ("transient" summary "Field declaration modifier: transient <type> <name> ...")
154 ("throws" summary "Method|Constructor declaration: throws <classType>, ...")
155 ("throw" summary "throw <expr> ;")
156 ("synchronized" summary "synchronized (<expr>) ... | Method decl. modifier: synchronized <type> <name> ...")
157 ("switch" summary "switch(<expr>) {[case <const-expr>: <stmts> ...] [default: <stmts>]}")
158 ("strictfp" summary "Declaration modifier: strictfp {class|interface|<type>} <name> ...")
159 ("static" summary "Declaration modifier: static {class|interface|<type>} <name> ...")
160 ("short" summary "Integral primitive type (-32768 to 32767)")
161 ("return" summary "return [<expr>] ;")
162 ("public" summary "Access level modifier: public {class|interface|<type>} <name> ...")
163 ("protected" summary "Access level modifier: protected {class|interface|<type>} <name> ...")
164 ("private" summary "Access level modifier: private {class|interface|<type>} <name> ...")
165 ("package" summary "Package declaration: package <name>")
166 ("native" summary "Method declaration modifier: native <type> <name> ...")
167 ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
168 ("interface" summary "Interface declaration: interface <name>")
169 ("int" summary "Integral primitive type (-2147483648 to 2147483647)")
170 ("import" summary "Import package declarations: import <package>")
171 ("implements" summary "Class SuperInterfaces declaration: implements <name> [, ...]")
172 ("if" summary "if (<expr>) <stmt> [else <stmt>]")
173 ("goto" summary "Unused reserved word")
174 ("for" summary "for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
175 ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
176 ("finally" summary "try {<stmts>} ... finally {<stmts>}")
177 ("final" summary "Class|Member declaration modifier: final {class|<type>} <name> ...")
178 ("extends" summary "SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
179 ("else" summary "if (<expr>) <stmt> else <stmt>")
180 ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
181 ("do" summary "do <stmt> while (<expr>);")
182 ("default" summary "switch(<expr>) { ... default: <stmts>}")
183 ("continue" summary "continue [<label>] ;")
184 ("const" summary "Unused reserved word")
185 ("class" summary "Class declaration: class <name>")
186 ("char" summary "Integral primitive type ('u0000' to 'uffff') (0 to 65535)")
187 ("catch" summary "try {<stmts>} catch(<parm>) {<stmts>} ... ")
188 ("case" summary "switch(<expr>) {case <const-expr>: <stmts> ... }")
189 ("byte" summary "Integral primitive type (-128 to 127)")
190 ("break" summary "break [<label>] ;")
191 ("boolean" summary "Primitive logical quantity type (true or false)")
192 ("abstract" summary "Class|Method declaration modifier: abstract {class|<type>} <name> ...")))
193 "Table of language keywords.")
195 (defconst wisent-java-tags-wy--token-table
196 (semantic-lex-make-type-table
255 (BRACK_BLOCK . "(LBRACK RBRACK)")
256 (BRACE_BLOCK . "(LBRACE RBRACE)")
257 (PAREN_BLOCK . "(LPAREN RPAREN)")))
258 '(("keyword" :declared t)
259 ("unicode" syntax "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]")
260 ("unicode" :declared t)
261 ("number" :declared t)
262 ("string" :declared t)
263 ("symbol" :declared t)
264 ("punctuation" :declared t)
265 ("block" :declared t)))
266 "Table of lexical tokens.")
268 (defconst wisent-java-tags-wy--parse-table
271 (require 'wisent-comp))
272 (wisent-compile-grammar
273 '((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 IDENTIFIER STRING_LITERAL NUMBER_LITERAL unicodecharacter ABSTRACT BOOLEAN BREAK BYTE CASE CATCH CHAR CLASS CONST CONTINUE DEFAULT DO DOUBLE ELSE 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)
276 ((package_declaration))
277 ((import_declaration))
278 ((type_declaration)))
280 ((PACKAGE qualified_name SEMICOLON)
282 (semantic-tag-new-package $2 nil))))
284 ((IMPORT qualified_name SEMICOLON)
286 (semantic-tag-new-include $2 nil)))
287 ((IMPORT qualified_name DOT MULT SEMICOLON)
289 (semantic-tag-new-include
295 ((class_declaration))
296 ((interface_declaration)))
298 ((modifiers_opt CLASS qualified_name superc_opt interfaces_opt class_body)
300 (semantic-tag-new-type $3 $2 $6
304 :typemodifiers $1))))
307 ((EXTENDS qualified_name)
311 ((IMPLEMENTS qualified_name_list)
315 (semantic-parse-region
318 'class_member_declaration 1)))
319 (class_member_declaration
326 ((static_initializer)
328 ((constructor_declaration))
329 ((interface_declaration))
330 ((class_declaration))
331 ((method_declaration))
332 ((field_declaration)))
333 (interface_declaration
334 ((modifiers_opt INTERFACE IDENTIFIER extends_interfaces_opt interface_body)
336 (semantic-tag-new-type $3 $2 $5
339 :typemodifiers $1))))
340 (extends_interfaces_opt
342 ((EXTENDS qualified_name_list)
346 (semantic-parse-region
349 'interface_member_declaration 1)))
350 (interface_member_declaration
355 ((interface_declaration))
356 ((class_declaration))
357 ((method_declaration))
358 ((field_declaration)))
361 (constructor_declaration
362 ((modifiers_opt constructor_declarator throwsc_opt constructor_body)
364 (semantic-tag-new-function
368 :typemodifiers $1 :throws $3 :constructor-flag t))))
369 (constructor_declarator
370 ((IDENTIFIER formal_parameter_list)
375 ((modifiers_opt VOID method_declarator throwsc_opt method_body)
377 (semantic-tag-new-function
381 :typemodifiers $1 :throws $4)))
382 ((modifiers_opt type method_declarator throwsc_opt method_body)
384 (semantic-tag-new-function
388 :typemodifiers $1 :throws $4))))
390 ((IDENTIFIER formal_parameter_list dims_opt)
396 ((THROWS qualified_name_list)
399 ((qualified_name_list COMMA qualified_name)
408 (formal_parameter_list
410 (semantic-parse-region
413 'formal_parameters 1)))
419 ((formal_parameter COMMA))
420 ((formal_parameter RPAREN)))
422 ((formal_parameter_modifier_opt type variable_declarator_id)
424 (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
425 (formal_parameter_modifier_opt
430 ((modifiers_opt type variable_declarators SEMICOLON)
432 (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
433 (variable_declarators
434 ((variable_declarators COMMA variable_declarator)
441 ((variable_declarator)
444 ((variable_declarator_id EQ variable_initializer)
446 ((variable_declarator_id)
448 (variable_declarator_id
449 ((IDENTIFIER dims_opt)
451 (variable_initializer
525 ((modifiers modifier)
542 ((qualified_name dims_opt)
544 ((primitive_type dims_opt)
547 ((qualified_name DOT IDENTIFIER)
559 '(compilation_unit package_declaration import_declaration class_declaration field_declaration method_declaration formal_parameter constructor_declaration interface_declaration class_member_declaration interface_member_declaration formal_parameters)))
562 (defun wisent-java-tags-wy--install-parser ()
563 "Setup the Semantic Parser."
564 (semantic-install-function-overrides
565 '((parse-stream . wisent-parse-stream)))
566 (setq semantic-parser-name "LALR"
567 semantic--parse-table wisent-java-tags-wy--parse-table
568 semantic-debug-parser-source "wisent-java-tags.wy"
569 semantic-flex-keywords-obarray wisent-java-tags-wy--keyword-table
570 semantic-lex-types-obarray wisent-java-tags-wy--token-table)
571 ;; Collect unmatched syntax lexical tokens
572 (semantic-make-local-hook 'wisent-discarding-token-functions)
573 (add-hook 'wisent-discarding-token-functions
574 'wisent-collect-unmatched-syntax nil t))
579 (require 'semantic-lex)
581 (define-lex-keyword-type-analyzer wisent-java-tags-wy--<keyword>-keyword-analyzer
582 "keyword analyzer for <keyword> tokens."
583 "\\(\\sw\\|\\s_\\)+")
585 (define-lex-block-type-analyzer wisent-java-tags-wy--<block>-block-analyzer
586 "block analyzer for <block> tokens."
588 '((("(" LPAREN PAREN_BLOCK)
589 ("{" LBRACE BRACE_BLOCK)
590 ("[" LBRACK BRACK_BLOCK))
596 (define-lex-regex-type-analyzer wisent-java-tags-wy--<symbol>-regexp-analyzer
597 "regexp analyzer for <symbol> tokens."
602 (define-lex-sexp-type-analyzer wisent-java-tags-wy--<string>-sexp-analyzer
603 "sexp analyzer for <string> tokens."
607 (define-lex-regex-type-analyzer wisent-java-tags-wy--<number>-regexp-analyzer
608 "regexp analyzer for <number> tokens."
609 semantic-lex-number-expression
613 (define-lex-string-type-analyzer wisent-java-tags-wy--<punctuation>-string-analyzer
614 "string analyzer for <punctuation> tokens."
615 "\\(\\s.\\|\\s$\\|\\s'\\)+"
658 (define-lex-regex-type-analyzer wisent-java-tags-wy--<unicode>-regexp-analyzer
659 "regexp analyzer for <unicode> tokens."
660 "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]"
667 ;; Define the lexer for this grammar
668 (define-lex wisent-java-tags-lexer
669 "Lexical analyzer that handles Java buffers.
670 It ignores whitespaces, newlines and comments."
671 semantic-lex-ignore-whitespace
672 semantic-lex-ignore-newline
673 semantic-lex-ignore-comments
674 ;;;; Auto-generated analyzers.
675 wisent-java-tags-wy--<number>-regexp-analyzer
676 wisent-java-tags-wy--<string>-sexp-analyzer
677 ;; Must detect keywords before other symbols
678 wisent-java-tags-wy--<keyword>-keyword-analyzer
679 wisent-java-tags-wy--<symbol>-regexp-analyzer
680 wisent-java-tags-wy--<punctuation>-string-analyzer
681 wisent-java-tags-wy--<block>-block-analyzer
682 ;; In theory, unicode chars should be turned into normal chars
683 ;; and then combined into regular ascii keywords and text. This
684 ;; analyzer just keeps these things from making the lexer go boom.
685 wisent-java-tags-wy--<unicode>-regexp-analyzer
687 semantic-lex-default-action)
689 (provide 'wisent-java-tags-wy)
691 ;;; wisent-java-tags-wy.el ends here