1 ;;; semantic/wisent/javat-wy.el --- Generated parser support file
3 ;; Copyright (C) 2002-2013 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 admin/grammars/java-tags.wy.
26 (require 'semantic
/lex
)
27 (eval-when-compile (require 'semantic
/bovine
))
31 (declare-function semantic-parse-region
"semantic"
32 (start end
&optional nonterminal depth returnonerror
))
36 (defconst wisent-java-tags-wy--keyword-table
37 (semantic-lex-make-keyword-table
38 '(("abstract" . ABSTRACT
)
47 ("continue" . CONTINUE
)
59 ("implements" . IMPLEMENTS
)
61 ("instanceof" . INSTANCEOF
)
63 ("interface" . INTERFACE
)
69 ("protected" . PROTECTED
)
74 ("strictfp" . STRICTFP
)
77 ("synchronized" . SYNCHRONIZED
)
81 ("transient" . TRANSIENT
)
84 ("volatile" . VOLATILE
)
87 ("@version" . _VERSION
)
90 ("@exception" . _EXCEPTION
)
95 ("@serialData" . _SERIALDATA
)
96 ("@serialField" . _SERIALFIELD
)
97 ("@deprecated" . _DEPRECATED
))
98 '(("@deprecated" javadoc
100 (type function variable
)
102 ("@serialField" javadoc
106 ("@serialData" javadoc
116 (type function variable
)
120 (type function variable
)
126 ("@exception" javadoc
143 ("while" summary
"while (<expr>) <stmt> | do <stmt> while (<expr>);")
144 ("volatile" summary
"Field declaration modifier: volatile <type> <name> ...")
145 ("void" summary
"Method return type: void <name> ...")
146 ("try" summary
"try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
147 ("transient" summary
"Field declaration modifier: transient <type> <name> ...")
148 ("throws" summary
"Method|Constructor declaration: throws <classType>, ...")
149 ("throw" summary
"throw <expr> ;")
150 ("synchronized" summary
"synchronized (<expr>) ... | Method decl. modifier: synchronized <type> <name> ...")
151 ("switch" summary
"switch(<expr>) {[case <const-expr>: <stmts> ...] [default: <stmts>]}")
152 ("strictfp" summary
"Declaration modifier: strictfp {class|interface|<type>} <name> ...")
153 ("static" summary
"Declaration modifier: static {class|interface|<type>} <name> ...")
154 ("short" summary
"Integral primitive type (-32768 to 32767)")
155 ("return" summary
"return [<expr>] ;")
156 ("public" summary
"Access level modifier: public {class|interface|<type>} <name> ...")
157 ("protected" summary
"Access level modifier: protected {class|interface|<type>} <name> ...")
158 ("private" summary
"Access level modifier: private {class|interface|<type>} <name> ...")
159 ("package" summary
"Package declaration: package <name>")
160 ("native" summary
"Method declaration modifier: native <type> <name> ...")
161 ("long" summary
"Integral primitive type (-9223372036854775808 to 9223372036854775807)")
162 ("interface" summary
"Interface declaration: interface <name>")
163 ("int" summary
"Integral primitive type (-2147483648 to 2147483647)")
164 ("import" summary
"Import package declarations: import <package>")
165 ("implements" summary
"Class SuperInterfaces declaration: implements <name> [, ...]")
166 ("if" summary
"if (<expr>) <stmt> [else <stmt>]")
167 ("goto" summary
"Unused reserved word")
168 ("for" summary
"for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
169 ("float" summary
"Primitive floating-point type (single-precision 32-bit IEEE 754)")
170 ("finally" summary
"try {<stmts>} ... finally {<stmts>}")
171 ("final" summary
"Class|Member declaration modifier: final {class|<type>} <name> ...")
172 ("extends" summary
"SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
173 ("else" summary
"if (<expr>) <stmt> else <stmt>")
174 ("double" summary
"Primitive floating-point type (double-precision 64-bit IEEE 754)")
175 ("do" summary
"do <stmt> while (<expr>);")
176 ("default" summary
"switch(<expr>) { ... default: <stmts>}")
177 ("continue" summary
"continue [<label>] ;")
178 ("const" summary
"Unused reserved word")
179 ("class" summary
"Class declaration: class <name>")
180 ("char" summary
"Integral primitive type (0 to 65535)")
181 ("catch" summary
"try {<stmts>} catch(<parm>) {<stmts>} ... ")
182 ("case" summary
"switch(<expr>) {case <const-expr>: <stmts> ... }")
183 ("byte" summary
"Integral primitive type (-128 to 127)")
184 ("break" summary
"break [<label>] ;")
185 ("boolean" summary
"Primitive logical quantity type (true or false)")
186 ("abstract" summary
"Class|Method declaration modifier: abstract {class|<type>} <name> ...")))
187 "Table of language keywords.")
189 (defconst wisent-java-tags-wy--token-table
190 (semantic-lex-make-type-table
249 (BRACK_BLOCK .
"(LBRACK RBRACK)")
250 (BRACE_BLOCK .
"(LBRACE RBRACE)")
251 (PAREN_BLOCK .
"(LPAREN RPAREN)")))
252 '(("keyword" :declared t
)
253 ("unicode" syntax
"\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]")
254 ("unicode" :declared t
)
255 ("number" :declared t
)
256 ("string" :declared t
)
257 ("symbol" :declared t
)
258 ("punctuation" :declared t
)
259 ("block" :declared t
)))
260 "Table of lexical tokens.")
262 (defconst wisent-java-tags-wy--parse-table
265 (require 'semantic
/wisent
/comp
))
266 (wisent-compile-grammar
267 '((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
)
270 ((package_declaration))
271 ((import_declaration))
272 ((type_declaration)))
274 ((PACKAGE qualified_name SEMICOLON
)
276 (semantic-tag-new-package $
2 nil
))))
278 ((IMPORT qualified_name SEMICOLON
)
280 (semantic-tag-new-include $
2 nil
)))
281 ((IMPORT qualified_name DOT MULT SEMICOLON
)
283 (semantic-tag-new-include
289 ((class_declaration))
290 ((interface_declaration)))
292 ((modifiers_opt CLASS qualified_name superc_opt interfaces_opt class_body
)
294 (semantic-tag-new-type $
3 $
2 $
6
298 :typemodifiers $
1))))
301 ((EXTENDS qualified_name
)
305 ((IMPLEMENTS qualified_name_list
)
309 (semantic-parse-region
312 'class_member_declaration
1)))
313 (class_member_declaration
320 ((static_initializer)
322 ((constructor_declaration))
323 ((interface_declaration))
324 ((class_declaration))
325 ((method_declaration))
326 ((field_declaration)))
327 (interface_declaration
328 ((modifiers_opt INTERFACE qualified_name extends_interfaces_opt interface_body
)
330 (semantic-tag-new-type $
3 $
2 $
5
333 :typemodifiers $
1))))
334 (extends_interfaces_opt
336 ((EXTENDS qualified_name_list
)
340 (semantic-parse-region
343 'interface_member_declaration
1)))
344 (interface_member_declaration
349 ((interface_declaration))
350 ((class_declaration))
351 ((method_declaration))
352 ((field_declaration)))
355 (constructor_declaration
356 ((modifiers_opt constructor_declarator throwsc_opt constructor_body
)
358 (semantic-tag-new-function
362 :typemodifiers $
1 :throws $
3 :constructor-flag t
))))
363 (constructor_declarator
364 ((IDENTIFIER formal_parameter_list
)
369 ((modifiers_opt VOID method_declarator throwsc_opt method_body
)
371 (semantic-tag-new-function
375 :typemodifiers $
1 :throws $
4)))
376 ((modifiers_opt type method_declarator throwsc_opt method_body
)
378 (semantic-tag-new-function
382 :typemodifiers $
1 :throws $
4))))
384 ((IDENTIFIER formal_parameter_list dims_opt
)
390 ((THROWS qualified_name_list
)
393 ((qualified_name_list COMMA qualified_name
)
402 (formal_parameter_list
404 (semantic-parse-region
407 'formal_parameters
1)))
413 ((formal_parameter COMMA
))
414 ((formal_parameter RPAREN
)))
416 ((formal_parameter_modifier_opt type opt_variable_declarator_id
)
418 (semantic-tag-new-variable $
3 $
2 nil
:typemodifiers $
1))))
419 (formal_parameter_modifier_opt
424 ((modifiers_opt type variable_declarators SEMICOLON
)
426 (semantic-tag-new-variable $
3 $
2 nil
:typemodifiers $
1))))
427 (variable_declarators
428 ((variable_declarators COMMA variable_declarator
)
435 ((variable_declarator)
438 ((variable_declarator_id EQ variable_initializer
)
440 ((variable_declarator_id)
442 (opt_variable_declarator_id
445 ((variable_declarator_id)
447 (variable_declarator_id
448 ((IDENTIFIER dims_opt
)
450 (variable_initializer
524 ((modifiers modifier
)
541 ((qualified_name dims_opt
)
543 ((primitive_type dims_opt
)
546 ((qualified_name DOT IDENTIFIER
)
558 '(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
)))
561 (defun wisent-java-tags-wy--install-parser ()
562 "Setup the Semantic Parser."
563 (semantic-install-function-overrides
564 '((parse-stream . wisent-parse-stream
)))
565 (setq semantic-parser-name
"LALR"
566 semantic--parse-table wisent-java-tags-wy--parse-table
567 semantic-debug-parser-source
"java-tags.wy"
568 semantic-flex-keywords-obarray wisent-java-tags-wy--keyword-table
569 semantic-lex-types-obarray wisent-java-tags-wy--token-table
)
570 ;; Collect unmatched syntax lexical tokens
571 (semantic-make-local-hook 'wisent-discarding-token-functions
)
572 (add-hook 'wisent-discarding-token-functions
573 'wisent-collect-unmatched-syntax nil t
))
578 (define-lex-block-type-analyzer wisent-java-tags-wy--
<block
>-block-analyzer
579 "block analyzer for <block> tokens."
581 '((("(" LPAREN PAREN_BLOCK
)
582 ("{" LBRACE BRACE_BLOCK
)
583 ("[" LBRACK BRACK_BLOCK
))
589 (define-lex-string-type-analyzer wisent-java-tags-wy--
<punctuation
>-string-analyzer
590 "string analyzer for <punctuation> tokens."
591 "\\(\\s.\\|\\s$\\|\\s'\\)+"
634 (define-lex-regex-type-analyzer wisent-java-tags-wy--
<symbol
>-regexp-analyzer
635 "regexp analyzer for <symbol> tokens."
640 (define-lex-regex-type-analyzer wisent-java-tags-wy--
<unicode
>-regexp-analyzer
641 "regexp analyzer for <unicode> tokens."
642 "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]"
646 (define-lex-regex-type-analyzer wisent-java-tags-wy--
<number
>-regexp-analyzer
647 "regexp analyzer for <number> tokens."
648 semantic-lex-number-expression
652 (define-lex-sexp-type-analyzer wisent-java-tags-wy--
<string
>-sexp-analyzer
653 "sexp analyzer for <string> tokens."
657 (define-lex-keyword-type-analyzer wisent-java-tags-wy--
<keyword
>-keyword-analyzer
658 "keyword analyzer for <keyword> tokens."
659 "\\(\\sw\\|\\s_\\)+")
664 ;; Define the lexer for this grammar
665 (define-lex wisent-java-tags-lexer
666 "Lexical analyzer that handles Java buffers.
667 It ignores whitespaces, newlines and comments."
668 semantic-lex-ignore-whitespace
669 semantic-lex-ignore-newline
670 semantic-lex-ignore-comments
671 ;;;; Auto-generated analyzers.
672 wisent-java-tags-wy--
<number
>-regexp-analyzer
673 wisent-java-tags-wy--
<string
>-sexp-analyzer
674 ;; Must detect keywords before other symbols
675 wisent-java-tags-wy--
<keyword
>-keyword-analyzer
676 wisent-java-tags-wy--
<symbol
>-regexp-analyzer
677 wisent-java-tags-wy--
<punctuation
>-string-analyzer
678 wisent-java-tags-wy--
<block
>-block-analyzer
679 ;; In theory, Unicode chars should be turned into normal chars
680 ;; and then combined into regular ascii keywords and text. This
681 ;; analyzer just keeps these things from making the lexer go boom.
682 wisent-java-tags-wy--
<unicode
>-regexp-analyzer
684 semantic-lex-default-action
)
686 (provide 'semantic
/wisent
/javat-wy
)
688 ;;; semantic/wisent/javat-wy.el ends here