1 ;;; semantic/wisent/javat-wy.el --- Generated parser support file
3 ;; Copyright (C) 2002, 2007, 2009-2012 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)
33 (defconst wisent-java-tags-wy--keyword-table
34 (semantic-lex-make-keyword-table
35 '(("abstract" . ABSTRACT)
44 ("continue" . CONTINUE)
56 ("implements" . IMPLEMENTS)
58 ("instanceof" . INSTANCEOF)
60 ("interface" . INTERFACE)
66 ("protected" . PROTECTED)
71 ("strictfp" . STRICTFP)
74 ("synchronized" . SYNCHRONIZED)
78 ("transient" . TRANSIENT)
81 ("volatile" . VOLATILE)
84 ("@version" . _VERSION)
87 ("@exception" . _EXCEPTION)
92 ("@serialData" . _SERIALDATA)
93 ("@serialField" . _SERIALFIELD)
94 ("@deprecated" . _DEPRECATED))
95 '(("@deprecated" javadoc
97 (type function variable)
99 ("@serialField" javadoc
103 ("@serialData" javadoc
113 (type function variable)
117 (type function variable)
123 ("@exception" javadoc
140 ("while" summary "while (<expr>) <stmt> | do <stmt> while (<expr>);")
141 ("volatile" summary "Field declaration modifier: volatile <type> <name> ...")
142 ("void" summary "Method return type: void <name> ...")
143 ("try" summary "try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
144 ("transient" summary "Field declaration modifier: transient <type> <name> ...")
145 ("throws" summary "Method|Constructor declaration: throws <classType>, ...")
146 ("throw" summary "throw <expr> ;")
147 ("synchronized" summary "synchronized (<expr>) ... | Method decl. modifier: synchronized <type> <name> ...")
148 ("switch" summary "switch(<expr>) {[case <const-expr>: <stmts> ...] [default: <stmts>]}")
149 ("strictfp" summary "Declaration modifier: strictfp {class|interface|<type>} <name> ...")
150 ("static" summary "Declaration modifier: static {class|interface|<type>} <name> ...")
151 ("short" summary "Integral primitive type (-32768 to 32767)")
152 ("return" summary "return [<expr>] ;")
153 ("public" summary "Access level modifier: public {class|interface|<type>} <name> ...")
154 ("protected" summary "Access level modifier: protected {class|interface|<type>} <name> ...")
155 ("private" summary "Access level modifier: private {class|interface|<type>} <name> ...")
156 ("package" summary "Package declaration: package <name>")
157 ("native" summary "Method declaration modifier: native <type> <name> ...")
158 ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
159 ("interface" summary "Interface declaration: interface <name>")
160 ("int" summary "Integral primitive type (-2147483648 to 2147483647)")
161 ("import" summary "Import package declarations: import <package>")
162 ("implements" summary "Class SuperInterfaces declaration: implements <name> [, ...]")
163 ("if" summary "if (<expr>) <stmt> [else <stmt>]")
164 ("goto" summary "Unused reserved word")
165 ("for" summary "for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
166 ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
167 ("finally" summary "try {<stmts>} ... finally {<stmts>}")
168 ("final" summary "Class|Member declaration modifier: final {class|<type>} <name> ...")
169 ("extends" summary "SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
170 ("else" summary "if (<expr>) <stmt> else <stmt>")
171 ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
172 ("do" summary "do <stmt> while (<expr>);")
173 ("default" summary "switch(<expr>) { ... default: <stmts>}")
174 ("continue" summary "continue [<label>] ;")
175 ("const" summary "Unused reserved word")
176 ("class" summary "Class declaration: class <name>")
177 ("char" summary "Integral primitive type ('\000' to '') (0 to 65535)")
178 ("catch" summary "try {<stmts>} catch(<parm>) {<stmts>} ... ")
179 ("case" summary "switch(<expr>) {case <const-expr>: <stmts> ... }")
180 ("byte" summary "Integral primitive type (-128 to 127)")
181 ("break" summary "break [<label>] ;")
182 ("boolean" summary "Primitive logical quantity type (true or false)")
183 ("abstract" summary "Class|Method declaration modifier: abstract {class|<type>} <name> ...")))
184 "Table of language keywords.")
186 (defconst wisent-java-tags-wy--token-table
187 (semantic-lex-make-type-table
246 (BRACK_BLOCK . "(LBRACK RBRACK)")
247 (BRACE_BLOCK . "(LBRACE RBRACE)")
248 (PAREN_BLOCK . "(LPAREN RPAREN)")))
249 '(("keyword" :declared t)
250 ("unicode" syntax "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]")
251 ("unicode" :declared t)
252 ("number" :declared t)
253 ("string" :declared t)
254 ("symbol" :declared t)
255 ("punctuation" :declared t)
256 ("block" :declared t)))
257 "Table of lexical tokens.")
259 (defconst wisent-java-tags-wy--parse-table
262 (require 'semantic/wisent/comp))
263 (wisent-compile-grammar
264 '((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)
267 ((package_declaration))
268 ((import_declaration))
269 ((type_declaration)))
271 ((PACKAGE qualified_name SEMICOLON)
273 (semantic-tag-new-package $2 nil))))
275 ((IMPORT qualified_name SEMICOLON)
277 (semantic-tag-new-include $2 nil)))
278 ((IMPORT qualified_name DOT MULT SEMICOLON)
280 (semantic-tag-new-include
286 ((class_declaration))
287 ((interface_declaration)))
289 ((modifiers_opt CLASS qualified_name superc_opt interfaces_opt class_body)
291 (semantic-tag-new-type $3 $2 $6
295 :typemodifiers $1))))
298 ((EXTENDS qualified_name)
302 ((IMPLEMENTS qualified_name_list)
306 (semantic-parse-region
309 'class_member_declaration 1)))
310 (class_member_declaration
317 ((static_initializer)
319 ((constructor_declaration))
320 ((interface_declaration))
321 ((class_declaration))
322 ((method_declaration))
323 ((field_declaration)))
324 (interface_declaration
325 ((modifiers_opt INTERFACE IDENTIFIER extends_interfaces_opt interface_body)
327 (semantic-tag-new-type $3 $2 $5
330 :typemodifiers $1))))
331 (extends_interfaces_opt
333 ((EXTENDS qualified_name_list)
337 (semantic-parse-region
340 'interface_member_declaration 1)))
341 (interface_member_declaration
346 ((interface_declaration))
347 ((class_declaration))
348 ((method_declaration))
349 ((field_declaration)))
352 (constructor_declaration
353 ((modifiers_opt constructor_declarator throwsc_opt constructor_body)
355 (semantic-tag-new-function
359 :typemodifiers $1 :throws $3 :constructor-flag t))))
360 (constructor_declarator
361 ((IDENTIFIER formal_parameter_list)
366 ((modifiers_opt VOID method_declarator throwsc_opt method_body)
368 (semantic-tag-new-function
372 :typemodifiers $1 :throws $4)))
373 ((modifiers_opt type method_declarator throwsc_opt method_body)
375 (semantic-tag-new-function
379 :typemodifiers $1 :throws $4))))
381 ((IDENTIFIER formal_parameter_list dims_opt)
387 ((THROWS qualified_name_list)
390 ((qualified_name_list COMMA qualified_name)
399 (formal_parameter_list
401 (semantic-parse-region
404 'formal_parameters 1)))
410 ((formal_parameter COMMA))
411 ((formal_parameter RPAREN)))
413 ((formal_parameter_modifier_opt type variable_declarator_id)
415 (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
416 (formal_parameter_modifier_opt
421 ((modifiers_opt type variable_declarators SEMICOLON)
423 (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
424 (variable_declarators
425 ((variable_declarators COMMA variable_declarator)
432 ((variable_declarator)
435 ((variable_declarator_id EQ variable_initializer)
437 ((variable_declarator_id)
439 (variable_declarator_id
440 ((IDENTIFIER dims_opt)
442 (variable_initializer
516 ((modifiers modifier)
533 ((qualified_name dims_opt)
535 ((primitive_type dims_opt)
538 ((qualified_name DOT IDENTIFIER)
550 '(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)))
553 (defun wisent-java-tags-wy--install-parser ()
554 "Setup the Semantic Parser."
555 (semantic-install-function-overrides
556 '((parse-stream . wisent-parse-stream)))
557 (setq semantic-parser-name "LALR"
558 semantic--parse-table wisent-java-tags-wy--parse-table
559 semantic-debug-parser-source "java-tags.wy"
560 semantic-flex-keywords-obarray wisent-java-tags-wy--keyword-table
561 semantic-lex-types-obarray wisent-java-tags-wy--token-table)
562 ;; Collect unmatched syntax lexical tokens
563 (semantic-make-local-hook 'wisent-discarding-token-functions)
564 (add-hook 'wisent-discarding-token-functions
565 'wisent-collect-unmatched-syntax nil t))
570 (define-lex-block-type-analyzer wisent-java-tags-wy--<block>-block-analyzer
571 "block analyzer for <block> tokens."
573 '((("(" LPAREN PAREN_BLOCK)
574 ("{" LBRACE BRACE_BLOCK)
575 ("[" LBRACK BRACK_BLOCK))
581 (define-lex-string-type-analyzer wisent-java-tags-wy--<punctuation>-string-analyzer
582 "string analyzer for <punctuation> tokens."
583 "\\(\\s.\\|\\s$\\|\\s'\\)+"
626 (define-lex-regex-type-analyzer wisent-java-tags-wy--<symbol>-regexp-analyzer
627 "regexp analyzer for <symbol> tokens."
632 (define-lex-regex-type-analyzer wisent-java-tags-wy--<unicode>-regexp-analyzer
633 "regexp analyzer for <unicode> tokens."
634 "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]"
638 (define-lex-regex-type-analyzer wisent-java-tags-wy--<number>-regexp-analyzer
639 "regexp analyzer for <number> tokens."
640 semantic-lex-number-expression
644 (define-lex-sexp-type-analyzer wisent-java-tags-wy--<string>-sexp-analyzer
645 "sexp analyzer for <string> tokens."
649 (define-lex-keyword-type-analyzer wisent-java-tags-wy--<keyword>-keyword-analyzer
650 "keyword analyzer for <keyword> tokens."
651 "\\(\\sw\\|\\s_\\)+")
656 ;; Define the lexer for this grammar
657 (define-lex wisent-java-tags-lexer
658 "Lexical analyzer that handles Java buffers.
659 It ignores whitespaces, newlines and comments."
660 semantic-lex-ignore-whitespace
661 semantic-lex-ignore-newline
662 semantic-lex-ignore-comments
663 ;;;; Auto-generated analyzers.
664 wisent-java-tags-wy--<number>-regexp-analyzer
665 wisent-java-tags-wy--<string>-sexp-analyzer
666 ;; Must detect keywords before other symbols
667 wisent-java-tags-wy--<keyword>-keyword-analyzer
668 wisent-java-tags-wy--<symbol>-regexp-analyzer
669 wisent-java-tags-wy--<punctuation>-string-analyzer
670 wisent-java-tags-wy--<block>-block-analyzer
671 ;; In theory, Unicode chars should be turned into normal chars
672 ;; and then combined into regular ascii keywords and text. This
673 ;; analyzer just keeps these things from making the lexer go boom.
674 wisent-java-tags-wy--<unicode>-regexp-analyzer
676 semantic-lex-default-action)
678 (provide 'semantic/wisent/javat-wy)
680 ;;; semantic/wisent/javat-wy.el ends here