Commit | Line | Data |
---|---|---|
a964f5e5 CY |
1 | ;;; semantic/wisent/javat-wy.el --- Generated parser support file |
2 | ||
73b0cd50 | 3 | ;; Copyright (C) 2002, 2007, 2009-2011 Free Software Foundation, Inc. |
a964f5e5 CY |
4 | |
5 | ;; This file is part of GNU Emacs. | |
6 | ||
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. | |
11 | ||
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. | |
16 | ||
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/>. | |
19 | ||
20 | ;;; Commentary: | |
21 | ;; | |
78adbf9c | 22 | ;; This file was generated from admin/grammars/java-tags.wy. |
a964f5e5 CY |
23 | |
24 | ;;; Code: | |
25 | ||
26 | (require 'semantic/lex) | |
a964f5e5 CY |
27 | \f |
28 | ;;; Prologue | |
29 | ;; | |
30 | \f | |
31 | ;;; Declarations | |
32 | ;; | |
33 | (defconst wisent-java-tags-wy--keyword-table | |
34 | (semantic-lex-make-keyword-table | |
35 | '(("abstract" . ABSTRACT) | |
36 | ("boolean" . BOOLEAN) | |
37 | ("break" . BREAK) | |
38 | ("byte" . BYTE) | |
39 | ("case" . CASE) | |
40 | ("catch" . CATCH) | |
41 | ("char" . CHAR) | |
42 | ("class" . CLASS) | |
43 | ("const" . CONST) | |
44 | ("continue" . CONTINUE) | |
45 | ("default" . DEFAULT) | |
46 | ("do" . DO) | |
47 | ("double" . DOUBLE) | |
48 | ("else" . ELSE) | |
49 | ("extends" . EXTENDS) | |
50 | ("final" . FINAL) | |
51 | ("finally" . FINALLY) | |
52 | ("float" . FLOAT) | |
53 | ("for" . FOR) | |
54 | ("goto" . GOTO) | |
55 | ("if" . IF) | |
56 | ("implements" . IMPLEMENTS) | |
57 | ("import" . IMPORT) | |
58 | ("instanceof" . INSTANCEOF) | |
59 | ("int" . INT) | |
60 | ("interface" . INTERFACE) | |
61 | ("long" . LONG) | |
62 | ("native" . NATIVE) | |
63 | ("new" . NEW) | |
64 | ("package" . PACKAGE) | |
65 | ("private" . PRIVATE) | |
66 | ("protected" . PROTECTED) | |
67 | ("public" . PUBLIC) | |
68 | ("return" . RETURN) | |
69 | ("short" . SHORT) | |
70 | ("static" . STATIC) | |
71 | ("strictfp" . STRICTFP) | |
72 | ("super" . SUPER) | |
73 | ("switch" . SWITCH) | |
74 | ("synchronized" . SYNCHRONIZED) | |
75 | ("this" . THIS) | |
76 | ("throw" . THROW) | |
77 | ("throws" . THROWS) | |
78 | ("transient" . TRANSIENT) | |
79 | ("try" . TRY) | |
80 | ("void" . VOID) | |
81 | ("volatile" . VOLATILE) | |
82 | ("while" . WHILE) | |
83 | ("@author" . _AUTHOR) | |
84 | ("@version" . _VERSION) | |
85 | ("@param" . _PARAM) | |
86 | ("@return" . _RETURN) | |
87 | ("@exception" . _EXCEPTION) | |
88 | ("@throws" . _THROWS) | |
89 | ("@see" . _SEE) | |
90 | ("@since" . _SINCE) | |
91 | ("@serial" . _SERIAL) | |
92 | ("@serialData" . _SERIALDATA) | |
93 | ("@serialField" . _SERIALFIELD) | |
94 | ("@deprecated" . _DEPRECATED)) | |
95 | '(("@deprecated" javadoc | |
96 | (seq 12 usage | |
97 | (type function variable) | |
98 | opt t)) | |
99 | ("@serialField" javadoc | |
100 | (seq 11 usage | |
101 | (variable) | |
102 | opt t)) | |
103 | ("@serialData" javadoc | |
104 | (seq 10 usage | |
105 | (function) | |
106 | opt t)) | |
107 | ("@serial" javadoc | |
108 | (seq 9 usage | |
109 | (variable) | |
110 | opt t)) | |
111 | ("@since" javadoc | |
112 | (seq 8 usage | |
113 | (type function variable) | |
114 | opt t)) | |
115 | ("@see" javadoc | |
116 | (seq 7 usage | |
117 | (type function variable) | |
118 | opt t with-ref t)) | |
119 | ("@throws" javadoc | |
120 | (seq 6 usage | |
121 | (function) | |
122 | with-name t)) | |
123 | ("@exception" javadoc | |
124 | (seq 5 usage | |
125 | (function) | |
126 | with-name t)) | |
127 | ("@return" javadoc | |
128 | (seq 4 usage | |
129 | (function))) | |
130 | ("@param" javadoc | |
131 | (seq 3 usage | |
132 | (function) | |
133 | with-name t)) | |
134 | ("@version" javadoc | |
135 | (seq 2 usage | |
136 | (type))) | |
137 | ("@author" javadoc | |
138 | (seq 1 usage | |
139 | (type))) | |
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>") | |
0376249d | 177 | ("char" summary "Integral primitive type ('\000' to '') (0 to 65535)") |
a964f5e5 CY |
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.") | |
185 | ||
186 | (defconst wisent-java-tags-wy--token-table | |
187 | (semantic-lex-make-type-table | |
188 | '(("unicode" | |
189 | (unicodecharacter)) | |
190 | ("number" | |
191 | (NUMBER_LITERAL)) | |
192 | ("string" | |
193 | (STRING_LITERAL)) | |
194 | ("symbol" | |
195 | (IDENTIFIER)) | |
196 | ("punctuation" | |
197 | (COMP . "~") | |
198 | (OROR . "||") | |
199 | (OREQ . "|=") | |
200 | (OR . "|") | |
201 | (XOREQ . "^=") | |
202 | (XOR . "^") | |
203 | (QUESTION . "?") | |
204 | (URSHIFTEQ . ">>>=") | |
205 | (URSHIFT . ">>>") | |
206 | (RSHIFTEQ . ">>=") | |
207 | (RSHIFT . ">>") | |
208 | (GTEQ . ">=") | |
209 | (GT . ">") | |
210 | (EQEQ . "==") | |
211 | (EQ . "=") | |
212 | (LTEQ . "<=") | |
213 | (LSHIFTEQ . "<<=") | |
214 | (LSHIFT . "<<") | |
215 | (LT . "<") | |
216 | (SEMICOLON . ";") | |
217 | (COLON . ":") | |
218 | (DIVEQ . "/=") | |
219 | (DIV . "/") | |
220 | (DOT . ".") | |
221 | (MINUSEQ . "-=") | |
222 | (MINUSMINUS . "--") | |
223 | (MINUS . "-") | |
224 | (COMMA . ",") | |
225 | (PLUSEQ . "+=") | |
226 | (PLUSPLUS . "++") | |
227 | (PLUS . "+") | |
228 | (MULTEQ . "*=") | |
229 | (MULT . "*") | |
230 | (ANDEQ . "&=") | |
231 | (ANDAND . "&&") | |
232 | (AND . "&") | |
233 | (MODEQ . "%=") | |
234 | (MOD . "%") | |
235 | (NOTEQ . "!=") | |
236 | (NOT . "!")) | |
237 | ("close-paren" | |
238 | (RBRACK . "]") | |
239 | (RBRACE . "}") | |
240 | (RPAREN . ")")) | |
241 | ("open-paren" | |
242 | (LBRACK . "[") | |
243 | (LBRACE . "{") | |
244 | (LPAREN . "(")) | |
245 | ("block" | |
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.") | |
258 | ||
259 | (defconst wisent-java-tags-wy--parse-table | |
260 | (progn | |
261 | (eval-when-compile | |
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) | |
265 | nil | |
266 | (compilation_unit | |
267 | ((package_declaration)) | |
268 | ((import_declaration)) | |
269 | ((type_declaration))) | |
270 | (package_declaration | |
271 | ((PACKAGE qualified_name SEMICOLON) | |
272 | (wisent-raw-tag | |
273 | (semantic-tag-new-package $2 nil)))) | |
274 | (import_declaration | |
275 | ((IMPORT qualified_name SEMICOLON) | |
276 | (wisent-raw-tag | |
277 | (semantic-tag-new-include $2 nil))) | |
278 | ((IMPORT qualified_name DOT MULT SEMICOLON) | |
279 | (wisent-raw-tag | |
280 | (semantic-tag-new-include | |
281 | (concat $2 $3 $4) | |
282 | nil)))) | |
283 | (type_declaration | |
284 | ((SEMICOLON) | |
285 | nil) | |
286 | ((class_declaration)) | |
287 | ((interface_declaration))) | |
288 | (class_declaration | |
289 | ((modifiers_opt CLASS qualified_name superc_opt interfaces_opt class_body) | |
290 | (wisent-raw-tag | |
291 | (semantic-tag-new-type $3 $2 $6 | |
292 | (if | |
293 | (or $4 $5) | |
294 | (cons $4 $5)) | |
295 | :typemodifiers $1)))) | |
296 | (superc_opt | |
297 | (nil) | |
298 | ((EXTENDS qualified_name) | |
299 | (identity $2))) | |
300 | (interfaces_opt | |
301 | (nil) | |
302 | ((IMPLEMENTS qualified_name_list) | |
303 | (nreverse $2))) | |
304 | (class_body | |
305 | ((BRACE_BLOCK) | |
306 | (semantic-parse-region | |
307 | (car $region1) | |
308 | (cdr $region1) | |
309 | 'class_member_declaration 1))) | |
310 | (class_member_declaration | |
311 | ((LBRACE) | |
312 | nil) | |
313 | ((RBRACE) | |
314 | nil) | |
315 | ((block) | |
316 | nil) | |
317 | ((static_initializer) | |
318 | nil) | |
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) | |
326 | (wisent-raw-tag | |
327 | (semantic-tag-new-type $3 $2 $5 | |
328 | (if $4 | |
329 | (cons nil $4)) | |
330 | :typemodifiers $1)))) | |
331 | (extends_interfaces_opt | |
332 | (nil) | |
333 | ((EXTENDS qualified_name_list) | |
334 | (identity $2))) | |
335 | (interface_body | |
336 | ((BRACE_BLOCK) | |
337 | (semantic-parse-region | |
338 | (car $region1) | |
339 | (cdr $region1) | |
340 | 'interface_member_declaration 1))) | |
341 | (interface_member_declaration | |
342 | ((LBRACE) | |
343 | nil) | |
344 | ((RBRACE) | |
345 | nil) | |
346 | ((interface_declaration)) | |
347 | ((class_declaration)) | |
348 | ((method_declaration)) | |
349 | ((field_declaration))) | |
350 | (static_initializer | |
351 | ((STATIC block))) | |
352 | (constructor_declaration | |
353 | ((modifiers_opt constructor_declarator throwsc_opt constructor_body) | |
354 | (wisent-raw-tag | |
355 | (semantic-tag-new-function | |
356 | (car $2) | |
357 | nil | |
358 | (cdr $2) | |
359 | :typemodifiers $1 :throws $3 :constructor-flag t)))) | |
360 | (constructor_declarator | |
361 | ((IDENTIFIER formal_parameter_list) | |
362 | (cons $1 $2))) | |
363 | (constructor_body | |
364 | ((block))) | |
365 | (method_declaration | |
366 | ((modifiers_opt VOID method_declarator throwsc_opt method_body) | |
367 | (wisent-raw-tag | |
368 | (semantic-tag-new-function | |
369 | (car $3) | |
370 | $2 | |
371 | (cdr $3) | |
372 | :typemodifiers $1 :throws $4))) | |
373 | ((modifiers_opt type method_declarator throwsc_opt method_body) | |
374 | (wisent-raw-tag | |
375 | (semantic-tag-new-function | |
376 | (car $3) | |
377 | $2 | |
378 | (cdr $3) | |
379 | :typemodifiers $1 :throws $4)))) | |
380 | (method_declarator | |
381 | ((IDENTIFIER formal_parameter_list dims_opt) | |
382 | (cons | |
383 | (concat $1 $3) | |
384 | $2))) | |
385 | (throwsc_opt | |
386 | (nil) | |
387 | ((THROWS qualified_name_list) | |
388 | (nreverse $2))) | |
389 | (qualified_name_list | |
390 | ((qualified_name_list COMMA qualified_name) | |
391 | (cons $3 $1)) | |
392 | ((qualified_name) | |
393 | (list $1))) | |
394 | (method_body | |
395 | ((SEMICOLON)) | |
396 | ((block))) | |
397 | (block | |
78adbf9c | 398 | ((BRACE_BLOCK))) |
a964f5e5 CY |
399 | (formal_parameter_list |
400 | ((PAREN_BLOCK) | |
401 | (semantic-parse-region | |
402 | (car $region1) | |
403 | (cdr $region1) | |
404 | 'formal_parameters 1))) | |
405 | (formal_parameters | |
406 | ((LPAREN) | |
407 | nil) | |
408 | ((RPAREN) | |
409 | nil) | |
410 | ((formal_parameter COMMA)) | |
411 | ((formal_parameter RPAREN))) | |
412 | (formal_parameter | |
413 | ((formal_parameter_modifier_opt type variable_declarator_id) | |
414 | (wisent-raw-tag | |
415 | (semantic-tag-new-variable $3 $2 nil :typemodifiers $1)))) | |
416 | (formal_parameter_modifier_opt | |
417 | (nil) | |
418 | ((FINAL) | |
419 | (list $1))) | |
420 | (field_declaration | |
421 | ((modifiers_opt type variable_declarators SEMICOLON) | |
422 | (wisent-raw-tag | |
423 | (semantic-tag-new-variable $3 $2 nil :typemodifiers $1)))) | |
424 | (variable_declarators | |
425 | ((variable_declarators COMMA variable_declarator) | |
426 | (progn | |
427 | (setcdr | |
428 | (cdr | |
429 | (car $1)) | |
430 | (cdr $region2)) | |
431 | (cons $3 $1))) | |
432 | ((variable_declarator) | |
433 | (list $1))) | |
434 | (variable_declarator | |
435 | ((variable_declarator_id EQ variable_initializer) | |
436 | (cons $1 $region)) | |
437 | ((variable_declarator_id) | |
438 | (cons $1 $region))) | |
439 | (variable_declarator_id | |
440 | ((IDENTIFIER dims_opt) | |
441 | (concat $1 $2))) | |
442 | (variable_initializer | |
443 | ((expression))) | |
444 | (expression | |
445 | ((expression term)) | |
446 | ((term))) | |
447 | (term | |
448 | ((literal)) | |
449 | ((operator)) | |
450 | ((primitive_type)) | |
451 | ((IDENTIFIER)) | |
452 | ((BRACK_BLOCK)) | |
453 | ((PAREN_BLOCK)) | |
454 | ((BRACE_BLOCK)) | |
455 | ((NEW)) | |
456 | ((CLASS)) | |
457 | ((THIS)) | |
458 | ((SUPER))) | |
459 | (literal | |
460 | ((STRING_LITERAL)) | |
461 | ((NUMBER_LITERAL))) | |
462 | (operator | |
463 | ((NOT)) | |
464 | ((PLUS)) | |
465 | ((PLUSPLUS)) | |
466 | ((MINUS)) | |
467 | ((MINUSMINUS)) | |
468 | ((NOTEQ)) | |
469 | ((MOD)) | |
470 | ((MODEQ)) | |
471 | ((AND)) | |
472 | ((ANDAND)) | |
473 | ((ANDEQ)) | |
474 | ((MULT)) | |
475 | ((MULTEQ)) | |
476 | ((PLUSEQ)) | |
477 | ((MINUSEQ)) | |
478 | ((DOT)) | |
479 | ((DIV)) | |
480 | ((DIVEQ)) | |
481 | ((COLON)) | |
482 | ((LT)) | |
483 | ((LSHIFT)) | |
484 | ((LSHIFTEQ)) | |
485 | ((LTEQ)) | |
486 | ((EQ)) | |
487 | ((EQEQ)) | |
488 | ((GT)) | |
489 | ((GTEQ)) | |
490 | ((RSHIFT)) | |
491 | ((RSHIFTEQ)) | |
492 | ((URSHIFT)) | |
493 | ((URSHIFTEQ)) | |
494 | ((QUESTION)) | |
495 | ((XOR)) | |
496 | ((XOREQ)) | |
497 | ((OR)) | |
498 | ((OREQ)) | |
499 | ((OROR)) | |
500 | ((COMP)) | |
501 | ((INSTANCEOF))) | |
502 | (primitive_type | |
503 | ((BOOLEAN)) | |
504 | ((CHAR)) | |
505 | ((LONG)) | |
506 | ((INT)) | |
507 | ((SHORT)) | |
508 | ((BYTE)) | |
509 | ((DOUBLE)) | |
510 | ((FLOAT))) | |
511 | (modifiers_opt | |
512 | (nil) | |
513 | ((modifiers) | |
514 | (nreverse $1))) | |
515 | (modifiers | |
516 | ((modifiers modifier) | |
517 | (cons $2 $1)) | |
518 | ((modifier) | |
519 | (list $1))) | |
520 | (modifier | |
521 | ((STRICTFP)) | |
522 | ((VOLATILE)) | |
523 | ((TRANSIENT)) | |
524 | ((SYNCHRONIZED)) | |
525 | ((NATIVE)) | |
526 | ((FINAL)) | |
527 | ((ABSTRACT)) | |
528 | ((STATIC)) | |
529 | ((PRIVATE)) | |
530 | ((PROTECTED)) | |
531 | ((PUBLIC))) | |
532 | (type | |
533 | ((qualified_name dims_opt) | |
534 | (concat $1 $2)) | |
535 | ((primitive_type dims_opt) | |
536 | (concat $1 $2))) | |
537 | (qualified_name | |
538 | ((qualified_name DOT IDENTIFIER) | |
539 | (concat $1 $2 $3)) | |
540 | ((IDENTIFIER))) | |
541 | (dims_opt | |
542 | (nil | |
543 | (identity "")) | |
544 | ((dims))) | |
545 | (dims | |
546 | ((dims BRACK_BLOCK) | |
547 | (concat $1 "[]")) | |
548 | ((BRACK_BLOCK) | |
549 | (identity "[]")))) | |
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))) | |
551 | "Parser table.") | |
552 | ||
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 | |
78adbf9c | 559 | semantic-debug-parser-source "java-tags.wy" |
a964f5e5 CY |
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)) | |
566 | ||
567 | \f | |
568 | ;;; Analyzers | |
a964f5e5 CY |
569 | |
570 | (define-lex-block-type-analyzer wisent-java-tags-wy--<block>-block-analyzer | |
571 | "block analyzer for <block> tokens." | |
572 | "\\s(\\|\\s)" | |
573 | '((("(" LPAREN PAREN_BLOCK) | |
574 | ("{" LBRACE BRACE_BLOCK) | |
575 | ("[" LBRACK BRACK_BLOCK)) | |
576 | (")" RPAREN) | |
577 | ("}" RBRACE) | |
578 | ("]" RBRACK)) | |
579 | ) | |
580 | ||
a964f5e5 CY |
581 | (define-lex-string-type-analyzer wisent-java-tags-wy--<punctuation>-string-analyzer |
582 | "string analyzer for <punctuation> tokens." | |
583 | "\\(\\s.\\|\\s$\\|\\s'\\)+" | |
584 | '((COMP . "~") | |
585 | (OROR . "||") | |
586 | (OREQ . "|=") | |
587 | (OR . "|") | |
588 | (XOREQ . "^=") | |
589 | (XOR . "^") | |
590 | (QUESTION . "?") | |
591 | (URSHIFTEQ . ">>>=") | |
592 | (URSHIFT . ">>>") | |
593 | (RSHIFTEQ . ">>=") | |
594 | (RSHIFT . ">>") | |
595 | (GTEQ . ">=") | |
596 | (GT . ">") | |
597 | (EQEQ . "==") | |
598 | (EQ . "=") | |
599 | (LTEQ . "<=") | |
600 | (LSHIFTEQ . "<<=") | |
601 | (LSHIFT . "<<") | |
602 | (LT . "<") | |
603 | (SEMICOLON . ";") | |
604 | (COLON . ":") | |
605 | (DIVEQ . "/=") | |
606 | (DIV . "/") | |
607 | (DOT . ".") | |
608 | (MINUSEQ . "-=") | |
609 | (MINUSMINUS . "--") | |
610 | (MINUS . "-") | |
611 | (COMMA . ",") | |
612 | (PLUSEQ . "+=") | |
613 | (PLUSPLUS . "++") | |
614 | (PLUS . "+") | |
615 | (MULTEQ . "*=") | |
616 | (MULT . "*") | |
617 | (ANDEQ . "&=") | |
618 | (ANDAND . "&&") | |
619 | (AND . "&") | |
620 | (MODEQ . "%=") | |
621 | (MOD . "%") | |
622 | (NOTEQ . "!=") | |
623 | (NOT . "!")) | |
624 | 'punctuation) | |
625 | ||
78adbf9c CY |
626 | (define-lex-regex-type-analyzer wisent-java-tags-wy--<symbol>-regexp-analyzer |
627 | "regexp analyzer for <symbol> tokens." | |
628 | "\\(\\sw\\|\\s_\\)+" | |
629 | nil | |
630 | 'IDENTIFIER) | |
631 | ||
a964f5e5 CY |
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]" | |
635 | nil | |
636 | 'unicodecharacter) | |
637 | ||
78adbf9c CY |
638 | (define-lex-regex-type-analyzer wisent-java-tags-wy--<number>-regexp-analyzer |
639 | "regexp analyzer for <number> tokens." | |
640 | semantic-lex-number-expression | |
641 | nil | |
642 | 'NUMBER_LITERAL) | |
643 | ||
644 | (define-lex-sexp-type-analyzer wisent-java-tags-wy--<string>-sexp-analyzer | |
645 | "sexp analyzer for <string> tokens." | |
646 | "\\s\"" | |
647 | 'STRING_LITERAL) | |
648 | ||
649 | (define-lex-keyword-type-analyzer wisent-java-tags-wy--<keyword>-keyword-analyzer | |
650 | "keyword analyzer for <keyword> tokens." | |
651 | "\\(\\sw\\|\\s_\\)+") | |
652 | ||
a964f5e5 CY |
653 | \f |
654 | ;;; Epilogue | |
655 | ;; | |
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 | |
fe7a3057 | 671 | ;; In theory, Unicode chars should be turned into normal chars |
a964f5e5 CY |
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 | |
675 | ;;;; | |
676 | semantic-lex-default-action) | |
677 | ||
678 | (provide 'semantic/wisent/javat-wy) | |
679 | ||
680 | ;;; semantic/wisent/javat-wy.el ends here |