1 ;;; semantic/wisent/javat-wy.el --- Generated parser support file
3 ;; Copyright (C) 2002, 2007, 2009, 2010, 2011 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 etc/grammars/java-tags.wy.
26 (require 'semantic/lex)
34 (defconst wisent-java-tags-wy--keyword-table
35 (semantic-lex-make-keyword-table
36 '(("abstract" . ABSTRACT)
45 ("continue" . CONTINUE)
57 ("implements" . IMPLEMENTS)
59 ("instanceof" . INSTANCEOF)
61 ("interface" . INTERFACE)
67 ("protected" . PROTECTED)
72 ("strictfp" . STRICTFP)
75 ("synchronized" . SYNCHRONIZED)
79 ("transient" . TRANSIENT)
82 ("volatile" . VOLATILE)
85 ("@version" . _VERSION)
88 ("@exception" . _EXCEPTION)
93 ("@serialData" . _SERIALDATA)
94 ("@serialField" . _SERIALFIELD)
95 ("@deprecated" . _DEPRECATED))
96 '(("@deprecated" javadoc
98 (type function variable)
100 ("@serialField" javadoc
104 ("@serialData" javadoc
114 (type function variable)
118 (type function variable)
124 ("@exception" javadoc
141 ("while" summary "while (<expr>) <stmt> | do <stmt> while (<expr>);")
142 ("volatile" summary "Field declaration modifier: volatile <type> <name> ...")
143 ("void" summary "Method return type: void <name> ...")
144 ("try" summary "try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
145 ("transient" summary "Field declaration modifier: transient <type> <name> ...")
146 ("throws" summary "Method|Constructor declaration: throws <classType>, ...")
147 ("throw" summary "throw <expr> ;")
148 ("synchronized" summary "synchronized (<expr>) ... | Method decl. modifier: synchronized <type> <name> ...")
149 ("switch" summary "switch(<expr>) {[case <const-expr>: <stmts> ...] [default: <stmts>]}")
150 ("strictfp" summary "Declaration modifier: strictfp {class|interface|<type>} <name> ...")
151 ("static" summary "Declaration modifier: static {class|interface|<type>} <name> ...")
152 ("short" summary "Integral primitive type (-32768 to 32767)")
153 ("return" summary "return [<expr>] ;")
154 ("public" summary "Access level modifier: public {class|interface|<type>} <name> ...")
155 ("protected" summary "Access level modifier: protected {class|interface|<type>} <name> ...")
156 ("private" summary "Access level modifier: private {class|interface|<type>} <name> ...")
157 ("package" summary "Package declaration: package <name>")
158 ("native" summary "Method declaration modifier: native <type> <name> ...")
159 ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
160 ("interface" summary "Interface declaration: interface <name>")
161 ("int" summary "Integral primitive type (-2147483648 to 2147483647)")
162 ("import" summary "Import package declarations: import <package>")
163 ("implements" summary "Class SuperInterfaces declaration: implements <name> [, ...]")
164 ("if" summary "if (<expr>) <stmt> [else <stmt>]")
165 ("goto" summary "Unused reserved word")
166 ("for" summary "for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
167 ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
168 ("finally" summary "try {<stmts>} ... finally {<stmts>}")
169 ("final" summary "Class|Member declaration modifier: final {class|<type>} <name> ...")
170 ("extends" summary "SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
171 ("else" summary "if (<expr>) <stmt> else <stmt>")
172 ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
173 ("do" summary "do <stmt> while (<expr>);")
174 ("default" summary "switch(<expr>) { ... default: <stmts>}")
175 ("continue" summary "continue [<label>] ;")
176 ("const" summary "Unused reserved word")
177 ("class" summary "Class declaration: class <name>")
178 ("char" summary "Integral primitive type ('\000' to '') (0 to 65535)")
179 ("catch" summary "try {<stmts>} catch(<parm>) {<stmts>} ... ")
180 ("case" summary "switch(<expr>) {case <const-expr>: <stmts> ... }")
181 ("byte" summary "Integral primitive type (-128 to 127)")
182 ("break" summary "break [<label>] ;")
183 ("boolean" summary "Primitive logical quantity type (true or false)")
184 ("abstract" summary "Class|Method declaration modifier: abstract {class|<type>} <name> ...")))
185 "Table of language keywords.")
187 (defconst wisent-java-tags-wy--token-table
188 (semantic-lex-make-type-table
247 (BRACK_BLOCK . "(LBRACK RBRACK)")
248 (BRACE_BLOCK . "(LBRACE RBRACE)")
249 (PAREN_BLOCK . "(LPAREN RPAREN)")))
250 '(("keyword" :declared t)
251 ("unicode" syntax "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]")
252 ("unicode" :declared t)
253 ("number" :declared t)
254 ("string" :declared t)
255 ("symbol" :declared t)
256 ("punctuation" :declared t)
257 ("block" :declared t)))
258 "Table of lexical tokens.")
260 (defconst wisent-java-tags-wy--parse-table
263 (require 'semantic/wisent/comp))
264 (wisent-compile-grammar
265 '((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)
268 ((package_declaration))
269 ((import_declaration))
270 ((type_declaration)))
272 ((PACKAGE qualified_name SEMICOLON)
274 (semantic-tag-new-package $2 nil))))
276 ((IMPORT qualified_name SEMICOLON)
278 (semantic-tag-new-include $2 nil)))
279 ((IMPORT qualified_name DOT MULT SEMICOLON)
281 (semantic-tag-new-include
287 ((class_declaration))
288 ((interface_declaration)))
290 ((modifiers_opt CLASS qualified_name superc_opt interfaces_opt class_body)
292 (semantic-tag-new-type $3 $2 $6
296 :typemodifiers $1))))
299 ((EXTENDS qualified_name)
303 ((IMPLEMENTS qualified_name_list)
307 (semantic-parse-region
310 'class_member_declaration 1)))
311 (class_member_declaration
318 ((static_initializer)
320 ((constructor_declaration))
321 ((interface_declaration))
322 ((class_declaration))
323 ((method_declaration))
324 ((field_declaration)))
325 (interface_declaration
326 ((modifiers_opt INTERFACE IDENTIFIER extends_interfaces_opt interface_body)
328 (semantic-tag-new-type $3 $2 $5
331 :typemodifiers $1))))
332 (extends_interfaces_opt
334 ((EXTENDS qualified_name_list)
338 (semantic-parse-region
341 'interface_member_declaration 1)))
342 (interface_member_declaration
347 ((interface_declaration))
348 ((class_declaration))
349 ((method_declaration))
350 ((field_declaration)))
353 (constructor_declaration
354 ((modifiers_opt constructor_declarator throwsc_opt constructor_body)
356 (semantic-tag-new-function
360 :typemodifiers $1 :throws $3 :constructor-flag t))))
361 (constructor_declarator
362 ((IDENTIFIER formal_parameter_list)
367 ((modifiers_opt VOID method_declarator throwsc_opt method_body)
369 (semantic-tag-new-function
373 :typemodifiers $1 :throws $4)))
374 ((modifiers_opt type method_declarator throwsc_opt method_body)
376 (semantic-tag-new-function
380 :typemodifiers $1 :throws $4))))
382 ((IDENTIFIER formal_parameter_list dims_opt)
388 ((THROWS qualified_name_list)
391 ((qualified_name_list COMMA qualified_name)
400 (formal_parameter_list
402 (semantic-parse-region
405 'formal_parameters 1)))
411 ((formal_parameter COMMA))
412 ((formal_parameter RPAREN)))
414 ((formal_parameter_modifier_opt type variable_declarator_id)
416 (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
417 (formal_parameter_modifier_opt
422 ((modifiers_opt type variable_declarators SEMICOLON)
424 (semantic-tag-new-variable $3 $2 nil :typemodifiers $1))))
425 (variable_declarators
426 ((variable_declarators COMMA variable_declarator)
433 ((variable_declarator)
436 ((variable_declarator_id EQ variable_initializer)
438 ((variable_declarator_id)
440 (variable_declarator_id
441 ((IDENTIFIER dims_opt)
443 (variable_initializer
517 ((modifiers modifier)
534 ((qualified_name dims_opt)
536 ((primitive_type dims_opt)
539 ((qualified_name DOT IDENTIFIER)
551 '(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)))
554 (defun wisent-java-tags-wy--install-parser ()
555 "Setup the Semantic Parser."
556 (semantic-install-function-overrides
557 '((parse-stream . wisent-parse-stream)))
558 (setq semantic-parser-name "LALR"
559 semantic--parse-table wisent-java-tags-wy--parse-table
560 semantic-debug-parser-source "wisent-java-tags.wy"
561 semantic-flex-keywords-obarray wisent-java-tags-wy--keyword-table
562 semantic-lex-types-obarray wisent-java-tags-wy--token-table)
563 ;; Collect unmatched syntax lexical tokens
564 (semantic-make-local-hook 'wisent-discarding-token-functions)
565 (add-hook 'wisent-discarding-token-functions
566 'wisent-collect-unmatched-syntax nil t))
571 (define-lex-keyword-type-analyzer wisent-java-tags-wy--<keyword>-keyword-analyzer
572 "keyword analyzer for <keyword> tokens."
573 "\\(\\sw\\|\\s_\\)+")
575 (define-lex-block-type-analyzer wisent-java-tags-wy--<block>-block-analyzer
576 "block analyzer for <block> tokens."
578 '((("(" LPAREN PAREN_BLOCK)
579 ("{" LBRACE BRACE_BLOCK)
580 ("[" LBRACK BRACK_BLOCK))
586 (define-lex-regex-type-analyzer wisent-java-tags-wy--<symbol>-regexp-analyzer
587 "regexp analyzer for <symbol> tokens."
592 (define-lex-sexp-type-analyzer wisent-java-tags-wy--<string>-sexp-analyzer
593 "sexp analyzer for <string> tokens."
597 (define-lex-regex-type-analyzer wisent-java-tags-wy--<number>-regexp-analyzer
598 "regexp analyzer for <number> tokens."
599 semantic-lex-number-expression
603 (define-lex-string-type-analyzer wisent-java-tags-wy--<punctuation>-string-analyzer
604 "string analyzer for <punctuation> tokens."
605 "\\(\\s.\\|\\s$\\|\\s'\\)+"
648 (define-lex-regex-type-analyzer wisent-java-tags-wy--<unicode>-regexp-analyzer
649 "regexp analyzer for <unicode> tokens."
650 "\\\\u[0-9a-f][0-9a-f][0-9a-f][0-9a-f]"
657 ;; Define the lexer for this grammar
658 (define-lex wisent-java-tags-lexer
659 "Lexical analyzer that handles Java buffers.
660 It ignores whitespaces, newlines and comments."
661 semantic-lex-ignore-whitespace
662 semantic-lex-ignore-newline
663 semantic-lex-ignore-comments
664 ;;;; Auto-generated analyzers.
665 wisent-java-tags-wy--<number>-regexp-analyzer
666 wisent-java-tags-wy--<string>-sexp-analyzer
667 ;; Must detect keywords before other symbols
668 wisent-java-tags-wy--<keyword>-keyword-analyzer
669 wisent-java-tags-wy--<symbol>-regexp-analyzer
670 wisent-java-tags-wy--<punctuation>-string-analyzer
671 wisent-java-tags-wy--<block>-block-analyzer
672 ;; In theory, unicode chars should be turned into normal chars
673 ;; and then combined into regular ascii keywords and text. This
674 ;; analyzer just keeps these things from making the lexer go boom.
675 wisent-java-tags-wy--<unicode>-regexp-analyzer
677 semantic-lex-default-action)
679 (provide 'semantic/wisent/javat-wy)
681 ;; arch-tag: b035ba00-e014-4c71-9bc7-a9dbf3d5b911
682 ;;; semantic/wisent/javat-wy.el ends here