1 ;;; semantic/wisent/javat-wy.el --- Generated parser support file
3 ;; Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
5 ;; This file is part of GNU Emacs.
7 ;; GNU Emacs is free software: you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation, either version 3 of the License, or
10 ;; (at your option) any later version.
12 ;; GNU Emacs is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 ;; This file was generated from the grammar file
23 ;; semantic/wisent/wisent-java-tags.wy in the CEDET repository.
27 (require 'semantic
/lex
)
35 (defconst wisent-java-tags-wy--keyword-table
36 (semantic-lex-make-keyword-table
37 '(("abstract" . ABSTRACT
)
46 ("continue" . CONTINUE
)
58 ("implements" . IMPLEMENTS
)
60 ("instanceof" . INSTANCEOF
)
62 ("interface" . INTERFACE
)
68 ("protected" . PROTECTED
)
73 ("strictfp" . STRICTFP
)
76 ("synchronized" . SYNCHRONIZED
)
80 ("transient" . TRANSIENT
)
83 ("volatile" . VOLATILE
)
86 ("@version" . _VERSION
)
89 ("@exception" . _EXCEPTION
)
94 ("@serialData" . _SERIALDATA
)
95 ("@serialField" . _SERIALFIELD
)
96 ("@deprecated" . _DEPRECATED
))
97 '(("@deprecated" javadoc
99 (type function variable
)
101 ("@serialField" javadoc
105 ("@serialData" javadoc
115 (type function variable
)
119 (type function variable
)
125 ("@exception" javadoc
142 ("while" summary
"while (<expr>) <stmt> | do <stmt> while (<expr>);")
143 ("volatile" summary
"Field declaration modifier: volatile <type> <name> ...")
144 ("void" summary
"Method return type: void <name> ...")
145 ("try" summary
"try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
146 ("transient" summary
"Field declaration modifier: transient <type> <name> ...")
147 ("throws" summary
"Method|Constructor declaration: throws <classType>, ...")
148 ("throw" summary
"throw <expr> ;")
149 ("synchronized" summary
"synchronized (<expr>) ... | Method decl. modifier: synchronized <type> <name> ...")
150 ("switch" summary
"switch(<expr>) {[case <const-expr>: <stmts> ...] [default: <stmts>]}")
151 ("strictfp" summary
"Declaration modifier: strictfp {class|interface|<type>} <name> ...")
152 ("static" summary
"Declaration modifier: static {class|interface|<type>} <name> ...")
153 ("short" summary
"Integral primitive type (-32768 to 32767)")
154 ("return" summary
"return [<expr>] ;")
155 ("public" summary
"Access level modifier: public {class|interface|<type>} <name> ...")
156 ("protected" summary
"Access level modifier: protected {class|interface|<type>} <name> ...")
157 ("private" summary
"Access level modifier: private {class|interface|<type>} <name> ...")
158 ("package" summary
"Package declaration: package <name>")
159 ("native" summary
"Method declaration modifier: native <type> <name> ...")
160 ("long" summary
"Integral primitive type (-9223372036854775808 to 9223372036854775807)")
161 ("interface" summary
"Interface declaration: interface <name>")
162 ("int" summary
"Integral primitive type (-2147483648 to 2147483647)")
163 ("import" summary
"Import package declarations: import <package>")
164 ("implements" summary
"Class SuperInterfaces declaration: implements <name> [, ...]")
165 ("if" summary
"if (<expr>) <stmt> [else <stmt>]")
166 ("goto" summary
"Unused reserved word")
167 ("for" summary
"for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
168 ("float" summary
"Primitive floating-point type (single-precision 32-bit IEEE 754)")
169 ("finally" summary
"try {<stmts>} ... finally {<stmts>}")
170 ("final" summary
"Class|Member declaration modifier: final {class|<type>} <name> ...")
171 ("extends" summary
"SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
172 ("else" summary
"if (<expr>) <stmt> else <stmt>")
173 ("double" summary
"Primitive floating-point type (double-precision 64-bit IEEE 754)")
174 ("do" summary
"do <stmt> while (<expr>);")
175 ("default" summary
"switch(<expr>) { ... default: <stmts>}")
176 ("continue" summary
"continue [<label>] ;")
177 ("const" summary
"Unused reserved word")
178 ("class" summary
"Class declaration: class <name>")
179 ("char" summary
"Integral primitive type ('\000' to '') (0 to 65535)")
180 ("catch" summary
"try {<stmts>} catch(<parm>) {<stmts>} ... ")
181 ("case" summary
"switch(<expr>) {case <const-expr>: <stmts> ... }")
182 ("byte" summary
"Integral primitive type (-128 to 127)")
183 ("break" summary
"break [<label>] ;")
184 ("boolean" summary
"Primitive logical quantity type (true or false)")
185 ("abstract" summary
"Class|Method declaration modifier: abstract {class|<type>} <name> ...")))
186 "Table of language keywords.")
188 (defconst wisent-java-tags-wy--token-table
189 (semantic-lex-make-type-table
248 (BRACK_BLOCK .
"(LBRACK RBRACK)")
249 (BRACE_BLOCK .
"(LBRACE RBRACE)")
250 (PAREN_BLOCK .
"(LPAREN RPAREN)")))
251 '(("keyword" :declared t
)
252 ("unicode" syntax
"\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]")
253 ("unicode" :declared t
)
254 ("number" :declared t
)
255 ("string" :declared t
)
256 ("symbol" :declared t
)
257 ("punctuation" :declared t
)
258 ("block" :declared t
)))
259 "Table of lexical tokens.")
261 (defconst wisent-java-tags-wy--parse-table
264 (require 'semantic
/wisent
/comp
))
265 (wisent-compile-grammar
266 '((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
)
269 ((package_declaration))
270 ((import_declaration))
271 ((type_declaration)))
273 ((PACKAGE qualified_name SEMICOLON
)
275 (semantic-tag-new-package $
2 nil
))))
277 ((IMPORT qualified_name SEMICOLON
)
279 (semantic-tag-new-include $
2 nil
)))
280 ((IMPORT qualified_name DOT MULT SEMICOLON
)
282 (semantic-tag-new-include
288 ((class_declaration))
289 ((interface_declaration)))
291 ((modifiers_opt CLASS qualified_name superc_opt interfaces_opt class_body
)
293 (semantic-tag-new-type $
3 $
2 $
6
297 :typemodifiers $
1))))
300 ((EXTENDS qualified_name
)
304 ((IMPLEMENTS qualified_name_list
)
308 (semantic-parse-region
311 'class_member_declaration
1)))
312 (class_member_declaration
319 ((static_initializer)
321 ((constructor_declaration))
322 ((interface_declaration))
323 ((class_declaration))
324 ((method_declaration))
325 ((field_declaration)))
326 (interface_declaration
327 ((modifiers_opt INTERFACE IDENTIFIER extends_interfaces_opt interface_body
)
329 (semantic-tag-new-type $
3 $
2 $
5
332 :typemodifiers $
1))))
333 (extends_interfaces_opt
335 ((EXTENDS qualified_name_list
)
339 (semantic-parse-region
342 'interface_member_declaration
1)))
343 (interface_member_declaration
348 ((interface_declaration))
349 ((class_declaration))
350 ((method_declaration))
351 ((field_declaration)))
354 (constructor_declaration
355 ((modifiers_opt constructor_declarator throwsc_opt constructor_body
)
357 (semantic-tag-new-function
361 :typemodifiers $
1 :throws $
3 :constructor-flag t
))))
362 (constructor_declarator
363 ((IDENTIFIER formal_parameter_list
)
368 ((modifiers_opt VOID method_declarator throwsc_opt method_body
)
370 (semantic-tag-new-function
374 :typemodifiers $
1 :throws $
4)))
375 ((modifiers_opt type method_declarator throwsc_opt method_body
)
377 (semantic-tag-new-function
381 :typemodifiers $
1 :throws $
4))))
383 ((IDENTIFIER formal_parameter_list dims_opt
)
389 ((THROWS qualified_name_list
)
392 ((qualified_name_list COMMA qualified_name
)
401 (formal_parameter_list
403 (semantic-parse-region
406 'formal_parameters
1)))
412 ((formal_parameter COMMA
))
413 ((formal_parameter RPAREN
)))
415 ((formal_parameter_modifier_opt type variable_declarator_id
)
417 (semantic-tag-new-variable $
3 $
2 nil
:typemodifiers $
1))))
418 (formal_parameter_modifier_opt
423 ((modifiers_opt type variable_declarators SEMICOLON
)
425 (semantic-tag-new-variable $
3 $
2 nil
:typemodifiers $
1))))
426 (variable_declarators
427 ((variable_declarators COMMA variable_declarator
)
434 ((variable_declarator)
437 ((variable_declarator_id EQ variable_initializer
)
439 ((variable_declarator_id)
441 (variable_declarator_id
442 ((IDENTIFIER dims_opt
)
444 (variable_initializer
518 ((modifiers modifier
)
535 ((qualified_name dims_opt
)
537 ((primitive_type dims_opt
)
540 ((qualified_name DOT IDENTIFIER
)
552 '(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
)))
555 (defun wisent-java-tags-wy--install-parser ()
556 "Setup the Semantic Parser."
557 (semantic-install-function-overrides
558 '((parse-stream . wisent-parse-stream
)))
559 (setq semantic-parser-name
"LALR"
560 semantic--parse-table wisent-java-tags-wy--parse-table
561 semantic-debug-parser-source
"wisent-java-tags.wy"
562 semantic-flex-keywords-obarray wisent-java-tags-wy--keyword-table
563 semantic-lex-types-obarray wisent-java-tags-wy--token-table
)
564 ;; Collect unmatched syntax lexical tokens
565 (semantic-make-local-hook 'wisent-discarding-token-functions
)
566 (add-hook 'wisent-discarding-token-functions
567 'wisent-collect-unmatched-syntax nil t
))
572 (define-lex-keyword-type-analyzer wisent-java-tags-wy--
<keyword
>-keyword-analyzer
573 "keyword analyzer for <keyword> tokens."
574 "\\(\\sw\\|\\s_\\)+")
576 (define-lex-block-type-analyzer wisent-java-tags-wy--
<block
>-block-analyzer
577 "block analyzer for <block> tokens."
579 '((("(" LPAREN PAREN_BLOCK
)
580 ("{" LBRACE BRACE_BLOCK
)
581 ("[" LBRACK BRACK_BLOCK
))
587 (define-lex-regex-type-analyzer wisent-java-tags-wy--
<symbol
>-regexp-analyzer
588 "regexp analyzer for <symbol> tokens."
593 (define-lex-sexp-type-analyzer wisent-java-tags-wy--
<string
>-sexp-analyzer
594 "sexp analyzer for <string> tokens."
598 (define-lex-regex-type-analyzer wisent-java-tags-wy--
<number
>-regexp-analyzer
599 "regexp analyzer for <number> tokens."
600 semantic-lex-number-expression
604 (define-lex-string-type-analyzer wisent-java-tags-wy--
<punctuation
>-string-analyzer
605 "string analyzer for <punctuation> tokens."
606 "\\(\\s.\\|\\s$\\|\\s'\\)+"
649 (define-lex-regex-type-analyzer wisent-java-tags-wy--
<unicode
>-regexp-analyzer
650 "regexp analyzer for <unicode> tokens."
651 "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]"
658 ;; Define the lexer for this grammar
659 (define-lex wisent-java-tags-lexer
660 "Lexical analyzer that handles Java buffers.
661 It ignores whitespaces, newlines and comments."
662 semantic-lex-ignore-whitespace
663 semantic-lex-ignore-newline
664 semantic-lex-ignore-comments
665 ;;;; Auto-generated analyzers.
666 wisent-java-tags-wy--
<number
>-regexp-analyzer
667 wisent-java-tags-wy--
<string
>-sexp-analyzer
668 ;; Must detect keywords before other symbols
669 wisent-java-tags-wy--
<keyword
>-keyword-analyzer
670 wisent-java-tags-wy--
<symbol
>-regexp-analyzer
671 wisent-java-tags-wy--
<punctuation
>-string-analyzer
672 wisent-java-tags-wy--
<block
>-block-analyzer
673 ;; In theory, unicode chars should be turned into normal chars
674 ;; and then combined into regular ascii keywords and text. This
675 ;; analyzer just keeps these things from making the lexer go boom.
676 wisent-java-tags-wy--
<unicode
>-regexp-analyzer
678 semantic-lex-default-action
)
680 (provide 'semantic
/wisent
/javat-wy
)
682 ;; arch-tag: b035ba00-e014-4c71-9bc7-a9dbf3d5b911
683 ;;; semantic/wisent/javat-wy.el ends here