]> code.delx.au - gnu-emacs/blob - lisp/cedet/semantic/bovine/c-by.el
Convert consecutive FSF copyright years to ranges.
[gnu-emacs] / lisp / cedet / semantic / bovine / c-by.el
1 ;;; semantic/bovine/c-by.el --- Generated parser support file
2
3 ;;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
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 ;;
22 ;; This file was generated from the grammar file semantic/bovine/c.by
23 ;; in the CEDET repository.
24
25 ;;; Code:
26
27 (require 'semantic/lex)
28 (eval-when-compile (require 'semantic/bovine))
29
30 (declare-function semantic-c-reconstitute-token "semantic/bovine/c")
31 (declare-function semantic-c-reconstitute-template "semantic/bovine/c")
32 (declare-function semantic-expand-c-tag "semantic/bovine/c")
33
34 (defconst semantic-c-by--keyword-table
35 (semantic-lex-make-keyword-table
36 '(("extern" . EXTERN)
37 ("static" . STATIC)
38 ("const" . CONST)
39 ("volatile" . VOLATILE)
40 ("register" . REGISTER)
41 ("signed" . SIGNED)
42 ("unsigned" . UNSIGNED)
43 ("inline" . INLINE)
44 ("virtual" . VIRTUAL)
45 ("mutable" . MUTABLE)
46 ("struct" . STRUCT)
47 ("union" . UNION)
48 ("enum" . ENUM)
49 ("typedef" . TYPEDEF)
50 ("class" . CLASS)
51 ("typename" . TYPENAME)
52 ("namespace" . NAMESPACE)
53 ("using" . USING)
54 ("new" . NEW)
55 ("delete" . DELETE)
56 ("template" . TEMPLATE)
57 ("throw" . THROW)
58 ("reentrant" . REENTRANT)
59 ("try" . TRY)
60 ("catch" . CATCH)
61 ("operator" . OPERATOR)
62 ("public" . PUBLIC)
63 ("private" . PRIVATE)
64 ("protected" . PROTECTED)
65 ("friend" . FRIEND)
66 ("if" . IF)
67 ("else" . ELSE)
68 ("do" . DO)
69 ("while" . WHILE)
70 ("for" . FOR)
71 ("switch" . SWITCH)
72 ("case" . CASE)
73 ("default" . DEFAULT)
74 ("return" . RETURN)
75 ("break" . BREAK)
76 ("continue" . CONTINUE)
77 ("sizeof" . SIZEOF)
78 ("void" . VOID)
79 ("char" . CHAR)
80 ("wchar_t" . WCHAR)
81 ("short" . SHORT)
82 ("int" . INT)
83 ("long" . LONG)
84 ("float" . FLOAT)
85 ("double" . DOUBLE)
86 ("bool" . BOOL)
87 ("_P" . UNDERP)
88 ("__P" . UNDERUNDERP))
89 '(("__P" summary "Common macro to eliminate prototype compatibility on some compilers")
90 ("_P" summary "Common macro to eliminate prototype compatibility on some compilers")
91 ("bool" summary "Primitive boolean type")
92 ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
93 ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
94 ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
95 ("int" summary "Integral Primitive Type: (-2147483648 to 2147483647)")
96 ("short" summary "Integral Primitive Type: (-32768 to 32767)")
97 ("wchar_t" summary "Wide Character Type")
98 ("char" summary "Integral Character Type: (0 to 256)")
99 ("void" summary "Built in typeless type: void")
100 ("sizeof" summary "Compile time macro: sizeof(<type or variable>) // size in bytes")
101 ("continue" summary "Non-local continue within a loop (for, do/while): continue;")
102 ("break" summary "Non-local exit within a loop or switch (for, do/while, switch): break;")
103 ("return" summary "return <value>;")
104 ("default" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
105 ("case" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
106 ("switch" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
107 ("for" summary "for(<init>; <condition>; <increment>) { code }")
108 ("while" summary "do { code } while (<condition>); or while (<condition>) { code };")
109 ("do" summary " do { code } while (<condition>);")
110 ("else" summary "if (<condition>) { code } [ else { code } ]")
111 ("if" summary "if (<condition>) { code } [ else { code } ]")
112 ("friend" summary "friend class <CLASSNAME>")
113 ("catch" summary "try { <body> } catch { <catch code> }")
114 ("try" summary "try { <body> } catch { <catch code> }")
115 ("reentrant" summary "<type> <methoddef> (<method args>) reentrant ...")
116 ("throw" summary "<type> <methoddef> (<method args>) throw (<exception>) ...")
117 ("template" summary "template <class TYPE ...> TYPE_OR_FUNCTION")
118 ("delete" summary "delete <object>;")
119 ("new" summary "new <classname>();")
120 ("using" summary "using <namespace>;")
121 ("namespace" summary "Namespace Declaration: namespace <name> { ... };")
122 ("typename" summary "typename is used to handle a qualified name as a typename;")
123 ("class" summary "Class Declaration: class <name>[:parents] { ... };")
124 ("typedef" summary "Arbitrary Type Declaration: typedef <typedeclaration> <name>;")
125 ("enum" summary "Enumeration Type Declaration: enum [name] { ... };")
126 ("union" summary "Union Type Declaration: union [name] { ... };")
127 ("struct" summary "Structure Type Declaration: struct [name] { ... };")
128 ("mutable" summary "Member Declaration Modifier: mutable <type> <name> ...")
129 ("virtual" summary "Method Modifier: virtual <type> <name>(...) ...")
130 ("inline" summary "Function Modifier: inline <return type> <name>(...) {...};")
131 ("unsigned" summary "Numeric Type Modifier: unsigned <numeric type> <name> ...")
132 ("signed" summary "Numeric Type Modifier: signed <numeric type> <name> ...")
133 ("register" summary "Declaration Modifier: register <type> <name> ...")
134 ("volatile" summary "Declaration Modifier: volatile <type> <name> ...")
135 ("const" summary "Declaration Modifier: const <type> <name> ...")
136 ("static" summary "Declaration Modifier: static <type> <name> ...")
137 ("extern" summary "Declaration Modifier: extern <type> <name> ...")))
138 "Table of language keywords.")
139
140 (defconst semantic-c-by--token-table
141 (semantic-lex-make-type-table
142 '(("semantic-list"
143 (BRACKETS . "\\[\\]")
144 (PARENS . "()")
145 (VOID_BLCK . "^(void)$")
146 (BRACE_BLCK . "^{")
147 (PAREN_BLCK . "^(")
148 (BRACK_BLCK . "\\[.*\\]$"))
149 ("close-paren"
150 (RBRACE . "}")
151 (RPAREN . ")"))
152 ("open-paren"
153 (LBRACE . "{")
154 (LPAREN . "("))
155 ("symbol"
156 (RESTRICT . "\\<\\(__\\)?restrict\\>"))
157 ("number"
158 (ZERO . "^0$"))
159 ("string"
160 (CPP . "\"C\\+\\+\"")
161 (C . "\"C\""))
162 ("punctuation"
163 (OR . "\\`[|]\\'")
164 (HAT . "\\`\\^\\'")
165 (MOD . "\\`[%]\\'")
166 (TILDE . "\\`[~]\\'")
167 (COMA . "\\`[,]\\'")
168 (GREATER . "\\`[>]\\'")
169 (LESS . "\\`[<]\\'")
170 (EQUAL . "\\`[=]\\'")
171 (BANG . "\\`[!]\\'")
172 (MINUS . "\\`[-]\\'")
173 (PLUS . "\\`[+]\\'")
174 (DIVIDE . "\\`[/]\\'")
175 (AMPERSAND . "\\`[&]\\'")
176 (STAR . "\\`[*]\\'")
177 (SEMICOLON . "\\`[;]\\'")
178 (COLON . "\\`[:]\\'")
179 (PERIOD . "\\`[.]\\'")
180 (HASH . "\\`[#]\\'")))
181 'nil)
182 "Table of lexical tokens.")
183
184 (defconst semantic-c-by--parse-table
185 `(
186 (bovine-toplevel
187 (declaration)
188 ) ;; end bovine-toplevel
189
190 (bovine-inner-scope
191 (codeblock)
192 ) ;; end bovine-inner-scope
193
194 (declaration
195 (macro)
196 (type)
197 (define)
198 (var-or-fun)
199 (extern-c)
200 (template)
201 (using)
202 ) ;; end declaration
203
204 (codeblock
205 (define)
206 (codeblock-var-or-fun)
207 (type)
208 (using)
209 ) ;; end codeblock
210
211 (extern-c-contents
212 (open-paren
213 ,(semantic-lambda
214 (list nil))
215 )
216 (declaration)
217 (close-paren
218 ,(semantic-lambda
219 (list nil))
220 )
221 ) ;; end extern-c-contents
222
223 (extern-c
224 (EXTERN
225 string
226 "\"C\""
227 semantic-list
228 ,(semantic-lambda
229 (semantic-tag
230 "C"
231 'extern :members
232 (semantic-parse-region
233 (car
234 (nth 2 vals))
235 (cdr
236 (nth 2 vals))
237 'extern-c-contents
238 1)))
239 )
240 (EXTERN
241 string
242 "\"C\\+\\+\""
243 semantic-list
244 ,(semantic-lambda
245 (semantic-tag
246 "C"
247 'extern :members
248 (semantic-parse-region
249 (car
250 (nth 2 vals))
251 (cdr
252 (nth 2 vals))
253 'extern-c-contents
254 1)))
255 )
256 (EXTERN
257 string
258 "\"C\""
259 ,(semantic-lambda
260 (list nil))
261 )
262 (EXTERN
263 string
264 "\"C\\+\\+\""
265 ,(semantic-lambda
266 (list nil))
267 )
268 ) ;; end extern-c
269
270 (macro
271 (spp-macro-def
272 ,(semantic-lambda
273 (semantic-tag-new-variable
274 (nth 0 vals) nil nil :constant-flag t))
275 )
276 (spp-system-include
277 ,(semantic-lambda
278 (semantic-tag-new-include
279 (nth 0 vals) t))
280 )
281 (spp-include
282 ,(semantic-lambda
283 (semantic-tag-new-include
284 (nth 0 vals) nil))
285 )
286 ) ;; end macro
287
288 (define
289 (spp-macro-def
290 ,(semantic-lambda
291 (semantic-tag-new-variable
292 (nth 0 vals) nil nil :constant-flag t))
293 )
294 (spp-macro-undef
295 ,(semantic-lambda
296 (list nil))
297 )
298 ) ;; end define
299
300 (unionparts
301 (semantic-list
302 ,(semantic-lambda
303 (semantic-parse-region
304 (car
305 (nth 0 vals))
306 (cdr
307 (nth 0 vals))
308 'classsubparts
309 1))
310 )
311 ) ;; end unionparts
312
313 (opt-symbol
314 (symbol)
315 ( ;;EMPTY
316 )
317 ) ;; end opt-symbol
318
319 (classsubparts
320 (open-paren
321 "{"
322 ,(semantic-lambda
323 (list nil))
324 )
325 (close-paren
326 "}"
327 ,(semantic-lambda
328 (list nil))
329 )
330 (class-protection
331 opt-symbol
332 punctuation
333 "\\`[:]\\'"
334 ,(semantic-lambda
335 (semantic-tag
336 (car
337 (nth 0 vals))
338 'label))
339 )
340 (var-or-fun)
341 (FRIEND
342 func-decl
343 ,(semantic-lambda
344 (semantic-tag
345 (car
346 (nth 1 vals))
347 'friend))
348 )
349 (FRIEND
350 CLASS
351 symbol
352 ,(semantic-lambda
353 (semantic-tag
354 (nth 2 vals)
355 'friend))
356 )
357 (type)
358 (define)
359 (template)
360 ( ;;EMPTY
361 )
362 ) ;; end classsubparts
363
364 (opt-class-parents
365 (punctuation
366 "\\`[:]\\'"
367 class-parents
368 opt-template-specifier
369 ,(semantic-lambda
370 (list
371 (nth 1 vals)))
372 )
373 ( ;;EMPTY
374 ,(semantic-lambda)
375 )
376 ) ;; end opt-class-parents
377
378 (one-class-parent
379 (opt-class-protection
380 opt-class-declmods
381 namespace-symbol
382 ,(semantic-lambda
383 (semantic-tag-new-type
384 (car
385 (nth 2 vals))
386 "class" nil nil :protection
387 (car
388 (nth 0 vals))))
389 )
390 (opt-class-declmods
391 opt-class-protection
392 namespace-symbol
393 ,(semantic-lambda
394 (semantic-tag-new-type
395 (car
396 (nth 2 vals))
397 "class" nil nil :protection
398 (car
399 (nth 1 vals))))
400 )
401 ) ;; end one-class-parent
402
403 (class-parents
404 (one-class-parent
405 punctuation
406 "\\`[,]\\'"
407 class-parents
408 ,(semantic-lambda
409 (cons
410 (nth 0 vals)
411 (nth 2 vals)))
412 )
413 (one-class-parent
414 ,(semantic-lambda
415 (list
416 (nth 0 vals)))
417 )
418 ) ;; end class-parents
419
420 (opt-class-declmods
421 (class-declmods
422 opt-class-declmods
423 ,(semantic-lambda
424 (list nil))
425 )
426 ( ;;EMPTY
427 )
428 ) ;; end opt-class-declmods
429
430 (class-declmods
431 (VIRTUAL)
432 ) ;; end class-declmods
433
434 (class-protection
435 (PUBLIC)
436 (PRIVATE)
437 (PROTECTED)
438 ) ;; end class-protection
439
440 (opt-class-protection
441 (class-protection
442 ,(semantic-lambda
443 (nth 0 vals))
444 )
445 ( ;;EMPTY
446 ,(semantic-lambda
447 (list
448 "unspecified"))
449 )
450 ) ;; end opt-class-protection
451
452 (namespaceparts
453 (semantic-list
454 ,(semantic-lambda
455 (semantic-parse-region
456 (car
457 (nth 0 vals))
458 (cdr
459 (nth 0 vals))
460 'namespacesubparts
461 1))
462 )
463 ) ;; end namespaceparts
464
465 (namespacesubparts
466 (open-paren
467 "{"
468 ,(semantic-lambda
469 (list nil))
470 )
471 (close-paren
472 "}"
473 ,(semantic-lambda
474 (list nil))
475 )
476 (type)
477 (var-or-fun)
478 (define)
479 (class-protection
480 punctuation
481 "\\`[:]\\'"
482 ,(semantic-lambda
483 (semantic-tag
484 (car
485 (nth 0 vals))
486 'label))
487 )
488 (template)
489 (using)
490 ( ;;EMPTY
491 )
492 ) ;; end namespacesubparts
493
494 (enumparts
495 (semantic-list
496 ,(semantic-lambda
497 (semantic-parse-region
498 (car
499 (nth 0 vals))
500 (cdr
501 (nth 0 vals))
502 'enumsubparts
503 1))
504 )
505 ) ;; end enumparts
506
507 (enumsubparts
508 (symbol
509 opt-assign
510 ,(semantic-lambda
511 (semantic-tag-new-variable
512 (nth 0 vals)
513 "int"
514 (car
515 (nth 1 vals)) :constant-flag t))
516 )
517 (open-paren
518 "{"
519 ,(semantic-lambda
520 (list nil))
521 )
522 (close-paren
523 "}"
524 ,(semantic-lambda
525 (list nil))
526 )
527 (punctuation
528 "\\`[,]\\'"
529 ,(semantic-lambda
530 (list nil))
531 )
532 ) ;; end enumsubparts
533
534 (opt-name
535 (symbol)
536 ( ;;EMPTY
537 ,(semantic-lambda
538 (list
539 ""))
540 )
541 ) ;; end opt-name
542
543 (typesimple
544 (struct-or-class
545 opt-class
546 opt-name
547 opt-template-specifier
548 opt-class-parents
549 semantic-list
550 ,(semantic-lambda
551 (semantic-tag-new-type
552 (car
553 (nth 2 vals))
554 (car
555 (nth 0 vals))
556 (let
557 (
558 (semantic-c-classname
559 (cons
560 (car
561 (nth 2 vals))
562 (car
563 (nth 0 vals)))))
564 (semantic-parse-region
565 (car
566 (nth 5 vals))
567 (cdr
568 (nth 5 vals))
569 'classsubparts
570 1))
571 (nth 4 vals) :template-specifier
572 (nth 3 vals) :parent
573 (car
574 (nth 1 vals))))
575 )
576 (struct-or-class
577 opt-class
578 opt-name
579 opt-template-specifier
580 opt-class-parents
581 ,(semantic-lambda
582 (semantic-tag-new-type
583 (car
584 (nth 2 vals))
585 (car
586 (nth 0 vals)) nil
587 (nth 4 vals) :template-specifier
588 (nth 3 vals) :prototype t :parent
589 (car
590 (nth 1 vals))))
591 )
592 (UNION
593 opt-class
594 opt-name
595 unionparts
596 ,(semantic-lambda
597 (semantic-tag-new-type
598 (car
599 (nth 2 vals))
600 (nth 0 vals)
601 (nth 3 vals) nil :parent
602 (car
603 (nth 1 vals))))
604 )
605 (ENUM
606 opt-class
607 opt-name
608 enumparts
609 ,(semantic-lambda
610 (semantic-tag-new-type
611 (car
612 (nth 2 vals))
613 (nth 0 vals)
614 (nth 3 vals) nil :parent
615 (car
616 (nth 1 vals))))
617 )
618 (TYPEDEF
619 declmods
620 typeformbase
621 cv-declmods
622 typedef-symbol-list
623 ,(semantic-lambda
624 (semantic-tag-new-type
625 (nth 4 vals)
626 (nth 0 vals) nil
627 (list
628 (nth 2 vals))))
629 )
630 ) ;; end typesimple
631
632 (typedef-symbol-list
633 (typedefname
634 punctuation
635 "\\`[,]\\'"
636 typedef-symbol-list
637 ,(semantic-lambda
638 (cons
639 (nth 0 vals)
640 (nth 2 vals)))
641 )
642 (typedefname
643 ,(semantic-lambda
644 (list
645 (nth 0 vals)))
646 )
647 ) ;; end typedef-symbol-list
648
649 (typedefname
650 (opt-stars
651 symbol
652 opt-bits
653 opt-array
654 ,(semantic-lambda
655 (list
656 (nth 0 vals)
657 (nth 1 vals)))
658 )
659 ) ;; end typedefname
660
661 (struct-or-class
662 (STRUCT)
663 (CLASS)
664 ) ;; end struct-or-class
665
666 (type
667 (typesimple
668 punctuation
669 "\\`[;]\\'"
670 ,(semantic-lambda
671 (nth 0 vals))
672 )
673 (NAMESPACE
674 symbol
675 namespaceparts
676 ,(semantic-lambda
677 (semantic-tag-new-type
678 (nth 1 vals)
679 (nth 0 vals)
680 (nth 2 vals) nil))
681 )
682 (NAMESPACE
683 namespaceparts
684 ,(semantic-lambda
685 (semantic-tag-new-type
686 "unnamed"
687 (nth 0 vals)
688 (nth 1 vals) nil))
689 )
690 (NAMESPACE
691 symbol
692 punctuation
693 "\\`[=]\\'"
694 typeformbase
695 punctuation
696 "\\`[;]\\'"
697 ,(semantic-lambda
698 (semantic-tag-new-type
699 (nth 1 vals)
700 (nth 0 vals)
701 (list
702 (semantic-tag-new-type
703 (car
704 (nth 3 vals))
705 (nth 0 vals) nil nil)) nil :kind
706 'alias))
707 )
708 ) ;; end type
709
710 (using
711 (USING
712 usingname
713 punctuation
714 "\\`[;]\\'"
715 ,(semantic-lambda
716 (semantic-tag
717 (car
718 (nth 1 vals))
719 'using :type
720 (nth 1 vals)))
721 )
722 ) ;; end using
723
724 (usingname
725 (typeformbase
726 ,(semantic-lambda
727 (semantic-tag-new-type
728 (car
729 (nth 0 vals))
730 "class" nil nil :prototype t))
731 )
732 (NAMESPACE
733 typeformbase
734 ,(semantic-lambda
735 (semantic-tag-new-type
736 (car
737 (nth 1 vals))
738 "namespace" nil nil :prototype t))
739 )
740 ) ;; end usingname
741
742 (template
743 (TEMPLATE
744 template-specifier
745 opt-friend
746 template-definition
747 ,(semantic-lambda
748 (semantic-c-reconstitute-template
749 (nth 3 vals)
750 (nth 1 vals)))
751 )
752 ) ;; end template
753
754 (opt-friend
755 (FRIEND)
756 ( ;;EMPTY
757 )
758 ) ;; end opt-friend
759
760 (opt-template-specifier
761 (template-specifier
762 ,(semantic-lambda
763 (nth 0 vals))
764 )
765 ( ;;EMPTY
766 ,(semantic-lambda)
767 )
768 ) ;; end opt-template-specifier
769
770 (template-specifier
771 (punctuation
772 "\\`[<]\\'"
773 template-specifier-types
774 punctuation
775 "\\`[>]\\'"
776 ,(semantic-lambda
777 (nth 1 vals))
778 )
779 ) ;; end template-specifier
780
781 (template-specifier-types
782 (template-var
783 template-specifier-type-list
784 ,(semantic-lambda
785 (cons
786 (nth 0 vals)
787 (nth 1 vals)))
788 )
789 ( ;;EMPTY
790 )
791 ) ;; end template-specifier-types
792
793 (template-specifier-type-list
794 (punctuation
795 "\\`[,]\\'"
796 template-specifier-types
797 ,(semantic-lambda
798 (nth 1 vals))
799 )
800 ( ;;EMPTY
801 ,(semantic-lambda)
802 )
803 ) ;; end template-specifier-type-list
804
805 (template-var
806 (template-type
807 opt-template-equal
808 ,(semantic-lambda
809 (cons
810 (car
811 (nth 0 vals))
812 (cdr
813 (nth 0 vals))))
814 )
815 (string
816 ,(semantic-lambda
817 (list
818 (nth 0 vals)))
819 )
820 (number
821 ,(semantic-lambda
822 (list
823 (nth 0 vals)))
824 )
825 (opt-stars
826 opt-ref
827 namespace-symbol
828 ,(semantic-lambda
829 (nth 2 vals))
830 )
831 (semantic-list
832 ,(semantic-lambda
833 (list
834 (nth 0 vals)))
835 )
836 (SIZEOF
837 semantic-list
838 ,(semantic-lambda
839 (list
840 (nth 1 vals)))
841 )
842 ) ;; end template-var
843
844 (opt-template-equal
845 (punctuation
846 "\\`[=]\\'"
847 symbol
848 punctuation
849 "\\`[<]\\'"
850 template-specifier-types
851 punctuation
852 "\\`[>]\\'"
853 ,(semantic-lambda
854 (list
855 (nth 1 vals)))
856 )
857 (punctuation
858 "\\`[=]\\'"
859 symbol
860 ,(semantic-lambda
861 (list
862 (nth 1 vals)))
863 )
864 ( ;;EMPTY
865 ,(semantic-lambda)
866 )
867 ) ;; end opt-template-equal
868
869 (template-type
870 (CLASS
871 symbol
872 ,(semantic-lambda
873 (semantic-tag-new-type
874 (nth 1 vals)
875 "class" nil nil))
876 )
877 (STRUCT
878 symbol
879 ,(semantic-lambda
880 (semantic-tag-new-type
881 (nth 1 vals)
882 "struct" nil nil))
883 )
884 (TYPENAME
885 symbol
886 ,(semantic-lambda
887 (semantic-tag-new-type
888 (nth 1 vals)
889 "class" nil nil))
890 )
891 (declmods
892 typeformbase
893 cv-declmods
894 opt-stars
895 opt-ref
896 variablearg-opt-name
897 ,(semantic-lambda
898 (semantic-tag-new-type
899 (car
900 (nth 1 vals)) nil nil nil :constant-flag
901 (if
902 (member
903 "const"
904 (append
905 (nth 0 vals)
906 (nth 2 vals))) t nil) :typemodifiers
907 (delete
908 "const"
909 (append
910 (nth 0 vals)
911 (nth 2 vals))) :reference
912 (car
913 (nth 4 vals)) :pointer
914 (car
915 (nth 3 vals))))
916 )
917 ) ;; end template-type
918
919 (template-definition
920 (type
921 ,(semantic-lambda
922 (nth 0 vals))
923 )
924 (var-or-fun
925 ,(semantic-lambda
926 (nth 0 vals))
927 )
928 ) ;; end template-definition
929
930 (opt-stars
931 (punctuation
932 "\\`[*]\\'"
933 opt-starmod
934 opt-stars
935 ,(semantic-lambda
936 (list
937 (1+
938 (car
939 (nth 2 vals)))))
940 )
941 ( ;;EMPTY
942 ,(semantic-lambda
943 (list
944 0))
945 )
946 ) ;; end opt-stars
947
948 (opt-starmod
949 (STARMOD
950 opt-starmod
951 ,(semantic-lambda
952 (cons
953 (car
954 (nth 0 vals))
955 (nth 1 vals)))
956 )
957 ( ;;EMPTY
958 ,(semantic-lambda)
959 )
960 ) ;; end opt-starmod
961
962 (STARMOD
963 (CONST)
964 ) ;; end STARMOD
965
966 (declmods
967 (DECLMOD
968 declmods
969 ,(semantic-lambda
970 (cons
971 (car
972 (nth 0 vals))
973 (nth 1 vals)))
974 )
975 (DECLMOD
976 ,(semantic-lambda
977 (nth 0 vals))
978 )
979 ( ;;EMPTY
980 ,(semantic-lambda)
981 )
982 ) ;; end declmods
983
984 (DECLMOD
985 (EXTERN)
986 (STATIC)
987 (CVDECLMOD)
988 (INLINE)
989 (REGISTER)
990 (FRIEND)
991 (TYPENAME)
992 (METADECLMOD)
993 (VIRTUAL)
994 ) ;; end DECLMOD
995
996 (metadeclmod
997 (METADECLMOD
998 ,(semantic-lambda)
999 )
1000 ( ;;EMPTY
1001 ,(semantic-lambda)
1002 )
1003 ) ;; end metadeclmod
1004
1005 (CVDECLMOD
1006 (CONST)
1007 (VOLATILE)
1008 ) ;; end CVDECLMOD
1009
1010 (cv-declmods
1011 (CVDECLMOD
1012 cv-declmods
1013 ,(semantic-lambda
1014 (cons
1015 (car
1016 (nth 0 vals))
1017 (nth 1 vals)))
1018 )
1019 (CVDECLMOD
1020 ,(semantic-lambda
1021 (nth 0 vals))
1022 )
1023 ( ;;EMPTY
1024 ,(semantic-lambda)
1025 )
1026 ) ;; end cv-declmods
1027
1028 (METADECLMOD
1029 (VIRTUAL)
1030 (MUTABLE)
1031 ) ;; end METADECLMOD
1032
1033 (opt-ref
1034 (punctuation
1035 "\\`[&]\\'"
1036 ,(semantic-lambda
1037 (list
1038 1))
1039 )
1040 ( ;;EMPTY
1041 ,(semantic-lambda
1042 (list
1043 0))
1044 )
1045 ) ;; end opt-ref
1046
1047 (typeformbase
1048 (typesimple
1049 ,(semantic-lambda
1050 (nth 0 vals))
1051 )
1052 (STRUCT
1053 symbol
1054 ,(semantic-lambda
1055 (semantic-tag-new-type
1056 (nth 1 vals)
1057 (nth 0 vals) nil nil))
1058 )
1059 (UNION
1060 symbol
1061 ,(semantic-lambda
1062 (semantic-tag-new-type
1063 (nth 1 vals)
1064 (nth 0 vals) nil nil))
1065 )
1066 (ENUM
1067 symbol
1068 ,(semantic-lambda
1069 (semantic-tag-new-type
1070 (nth 1 vals)
1071 (nth 0 vals) nil nil))
1072 )
1073 (builtintype
1074 ,(semantic-lambda
1075 (nth 0 vals))
1076 )
1077 (symbol
1078 template-specifier
1079 ,(semantic-lambda
1080 (semantic-tag-new-type
1081 (nth 0 vals)
1082 "class" nil nil :template-specifier
1083 (nth 1 vals)))
1084 )
1085 (namespace-symbol-for-typeformbase
1086 opt-template-specifier
1087 ,(semantic-lambda
1088 (semantic-tag-new-type
1089 (car
1090 (nth 0 vals))
1091 "class" nil nil :template-specifier
1092 (nth 1 vals)))
1093 )
1094 (symbol
1095 ,(semantic-lambda
1096 (list
1097 (nth 0 vals)))
1098 )
1099 ) ;; end typeformbase
1100
1101 (signedmod
1102 (UNSIGNED)
1103 (SIGNED)
1104 ) ;; end signedmod
1105
1106 (builtintype-types
1107 (VOID)
1108 (CHAR)
1109 (WCHAR)
1110 (SHORT
1111 INT
1112 ,(semantic-lambda
1113 (list
1114 (concat
1115 (nth 0 vals)
1116 " "
1117 (nth 1 vals))))
1118 )
1119 (SHORT)
1120 (INT)
1121 (LONG
1122 INT
1123 ,(semantic-lambda
1124 (list
1125 (concat
1126 (nth 0 vals)
1127 " "
1128 (nth 1 vals))))
1129 )
1130 (FLOAT)
1131 (DOUBLE)
1132 (BOOL)
1133 (LONG
1134 DOUBLE
1135 ,(semantic-lambda
1136 (list
1137 (concat
1138 (nth 0 vals)
1139 " "
1140 (nth 1 vals))))
1141 )
1142 (LONG
1143 LONG
1144 ,(semantic-lambda
1145 (list
1146 (concat
1147 (nth 0 vals)
1148 " "
1149 (nth 1 vals))))
1150 )
1151 (LONG)
1152 ) ;; end builtintype-types
1153
1154 (builtintype
1155 (signedmod
1156 builtintype-types
1157 ,(semantic-lambda
1158 (list
1159 (concat
1160 (car
1161 (nth 0 vals))
1162 " "
1163 (car
1164 (nth 1 vals)))))
1165 )
1166 (builtintype-types
1167 ,(semantic-lambda
1168 (nth 0 vals))
1169 )
1170 (signedmod
1171 ,(semantic-lambda
1172 (list
1173 (concat
1174 (car
1175 (nth 0 vals))
1176 " int")))
1177 )
1178 ) ;; end builtintype
1179
1180 (codeblock-var-or-fun
1181 (declmods
1182 typeformbase
1183 declmods
1184 opt-ref
1185 var-or-func-decl
1186 ,(semantic-lambda
1187 (semantic-c-reconstitute-token
1188 (nth 4 vals)
1189 (nth 0 vals)
1190 (nth 1 vals)))
1191 )
1192 ) ;; end codeblock-var-or-fun
1193
1194 (var-or-fun
1195 (codeblock-var-or-fun
1196 ,(semantic-lambda
1197 (nth 0 vals))
1198 )
1199 (declmods
1200 var-or-func-decl
1201 ,(semantic-lambda
1202 (semantic-c-reconstitute-token
1203 (nth 1 vals)
1204 (nth 0 vals) nil))
1205 )
1206 ) ;; end var-or-fun
1207
1208 (var-or-func-decl
1209 (func-decl
1210 ,(semantic-lambda
1211 (nth 0 vals))
1212 )
1213 (var-decl
1214 ,(semantic-lambda
1215 (nth 0 vals))
1216 )
1217 ) ;; end var-or-func-decl
1218
1219 (func-decl
1220 (opt-stars
1221 opt-class
1222 opt-destructor
1223 functionname
1224 opt-template-specifier
1225 opt-under-p
1226 arg-list
1227 opt-post-fcn-modifiers
1228 opt-throw
1229 opt-initializers
1230 fun-or-proto-end
1231 ,(semantic-lambda
1232 (nth 3 vals)
1233 (list
1234 'function
1235 (nth 1 vals)
1236 (nth 2 vals)
1237 (nth 6 vals)
1238 (nth 8 vals)
1239 (nth 7 vals))
1240 (nth 0 vals)
1241 (nth 10 vals)
1242 (list
1243 (nth 4 vals))
1244 (nth 9 vals))
1245 )
1246 (opt-stars
1247 opt-class
1248 opt-destructor
1249 functionname
1250 opt-template-specifier
1251 opt-under-p
1252 opt-post-fcn-modifiers
1253 opt-throw
1254 opt-initializers
1255 fun-try-end
1256 ,(semantic-lambda
1257 (nth 3 vals)
1258 (list
1259 'function
1260 (nth 1 vals)
1261 (nth 2 vals) nil
1262 (nth 7 vals)
1263 (nth 6 vals))
1264 (nth 0 vals)
1265 (nth 9 vals)
1266 (list
1267 (nth 4 vals))
1268 (nth 8 vals))
1269 )
1270 ) ;; end func-decl
1271
1272 (var-decl
1273 (varnamelist
1274 punctuation
1275 "\\`[;]\\'"
1276 ,(semantic-lambda
1277 (list
1278 (nth 0 vals)
1279 'variable))
1280 )
1281 ) ;; end var-decl
1282
1283 (opt-under-p
1284 (UNDERP
1285 ,(semantic-lambda
1286 (list nil))
1287 )
1288 (UNDERUNDERP
1289 ,(semantic-lambda
1290 (list nil))
1291 )
1292 ( ;;EMPTY
1293 )
1294 ) ;; end opt-under-p
1295
1296 (opt-initializers
1297 (punctuation
1298 "\\`[:]\\'"
1299 namespace-symbol
1300 semantic-list
1301 opt-initializers)
1302 (punctuation
1303 "\\`[,]\\'"
1304 namespace-symbol
1305 semantic-list
1306 opt-initializers)
1307 ( ;;EMPTY
1308 )
1309 ) ;; end opt-initializers
1310
1311 (opt-post-fcn-modifiers
1312 (post-fcn-modifiers
1313 opt-post-fcn-modifiers
1314 ,(semantic-lambda
1315 (cons
1316 (nth 0 vals)
1317 (nth 1 vals)))
1318 )
1319 ( ;;EMPTY
1320 ,(semantic-lambda
1321 (list nil))
1322 )
1323 ) ;; end opt-post-fcn-modifiers
1324
1325 (post-fcn-modifiers
1326 (REENTRANT)
1327 (CONST)
1328 ) ;; end post-fcn-modifiers
1329
1330 (opt-throw
1331 (THROW
1332 semantic-list
1333 ,(lambda (vals start end)
1334 (semantic-bovinate-from-nonterminal
1335 (car
1336 (nth 1 vals))
1337 (cdr
1338 (nth 1 vals))
1339 'throw-exception-list))
1340 )
1341 ( ;;EMPTY
1342 )
1343 ) ;; end opt-throw
1344
1345 (throw-exception-list
1346 (namespace-symbol
1347 punctuation
1348 "\\`[,]\\'"
1349 throw-exception-list
1350 ,(semantic-lambda
1351 (cons
1352 (car
1353 (nth 0 vals))
1354 (nth 2 vals)))
1355 )
1356 (namespace-symbol
1357 close-paren
1358 ")"
1359 ,(semantic-lambda
1360 (nth 0 vals))
1361 )
1362 (symbol
1363 close-paren
1364 ")"
1365 ,(semantic-lambda
1366 (list
1367 (nth 0 vals)))
1368 )
1369 (open-paren
1370 "("
1371 throw-exception-list
1372 ,(semantic-lambda
1373 (nth 1 vals))
1374 )
1375 (close-paren
1376 ")"
1377 ,(semantic-lambda)
1378 )
1379 ) ;; end throw-exception-list
1380
1381 (opt-bits
1382 (punctuation
1383 "\\`[:]\\'"
1384 number
1385 ,(semantic-lambda
1386 (list
1387 (nth 1 vals)))
1388 )
1389 ( ;;EMPTY
1390 ,(semantic-lambda
1391 (list nil))
1392 )
1393 ) ;; end opt-bits
1394
1395 (opt-array
1396 (semantic-list
1397 "\\[.*\\]$"
1398 opt-array
1399 ,(semantic-lambda
1400 (list
1401 (cons
1402 1
1403 (car
1404 (nth 1 vals)))))
1405 )
1406 ( ;;EMPTY
1407 ,(semantic-lambda
1408 (list nil))
1409 )
1410 ) ;; end opt-array
1411
1412 (opt-assign
1413 (punctuation
1414 "\\`[=]\\'"
1415 expression
1416 ,(semantic-lambda
1417 (list
1418 (nth 1 vals)))
1419 )
1420 ( ;;EMPTY
1421 ,(semantic-lambda
1422 (list nil))
1423 )
1424 ) ;; end opt-assign
1425
1426 (opt-restrict
1427 (symbol
1428 "\\<\\(__\\)?restrict\\>")
1429 ( ;;EMPTY
1430 )
1431 ) ;; end opt-restrict
1432
1433 (varname
1434 (opt-stars
1435 opt-restrict
1436 namespace-symbol
1437 opt-bits
1438 opt-array
1439 ,(semantic-lambda
1440 (nth 2 vals)
1441 (nth 0 vals)
1442 (nth 3 vals)
1443 (nth 4 vals))
1444 )
1445 ) ;; end varname
1446
1447 (variablearg
1448 (declmods
1449 typeformbase
1450 cv-declmods
1451 opt-ref
1452 variablearg-opt-name
1453 ,(semantic-lambda
1454 (semantic-tag-new-variable
1455 (list
1456 (nth 4 vals))
1457 (nth 1 vals) nil :constant-flag
1458 (if
1459 (member
1460 "const"
1461 (append
1462 (nth 0 vals)
1463 (nth 2 vals))) t nil) :typemodifiers
1464 (delete
1465 "const"
1466 (append
1467 (nth 0 vals)
1468 (nth 2 vals))) :reference
1469 (car
1470 (nth 3 vals))))
1471 )
1472 ) ;; end variablearg
1473
1474 (variablearg-opt-name
1475 (varname
1476 ,(semantic-lambda
1477 (nth 0 vals))
1478 )
1479 (opt-stars
1480 ,(semantic-lambda
1481 (list
1482 "")
1483 (nth 0 vals)
1484 (list nil nil nil))
1485 )
1486 ) ;; end variablearg-opt-name
1487
1488 (varname-opt-initializer
1489 (semantic-list)
1490 (opt-assign)
1491 ( ;;EMPTY
1492 )
1493 ) ;; end varname-opt-initializer
1494
1495 (varnamelist
1496 (opt-ref
1497 varname
1498 varname-opt-initializer
1499 punctuation
1500 "\\`[,]\\'"
1501 varnamelist
1502 ,(semantic-lambda
1503 (cons
1504 (nth 1 vals)
1505 (nth 4 vals)))
1506 )
1507 (opt-ref
1508 varname
1509 varname-opt-initializer
1510 ,(semantic-lambda
1511 (list
1512 (nth 1 vals)))
1513 )
1514 ) ;; end varnamelist
1515
1516 (namespace-symbol
1517 (symbol
1518 opt-template-specifier
1519 punctuation
1520 "\\`[:]\\'"
1521 punctuation
1522 "\\`[:]\\'"
1523 namespace-symbol
1524 ,(semantic-lambda
1525 (list
1526 (concat
1527 (nth 0 vals)
1528 "::"
1529 (car
1530 (nth 4 vals)))))
1531 )
1532 (symbol
1533 opt-template-specifier
1534 ,(semantic-lambda
1535 (list
1536 (nth 0 vals)))
1537 )
1538 ) ;; end namespace-symbol
1539
1540 (namespace-symbol-for-typeformbase
1541 (symbol
1542 opt-template-specifier
1543 punctuation
1544 "\\`[:]\\'"
1545 punctuation
1546 "\\`[:]\\'"
1547 namespace-symbol-for-typeformbase
1548 ,(semantic-lambda
1549 (list
1550 (concat
1551 (nth 0 vals)
1552 "::"
1553 (car
1554 (nth 4 vals)))))
1555 )
1556 (symbol
1557 ,(semantic-lambda
1558 (list
1559 (nth 0 vals)))
1560 )
1561 ) ;; end namespace-symbol-for-typeformbase
1562
1563 (namespace-opt-class
1564 (symbol
1565 punctuation
1566 "\\`[:]\\'"
1567 punctuation
1568 "\\`[:]\\'"
1569 namespace-opt-class
1570 ,(semantic-lambda
1571 (list
1572 (concat
1573 (nth 0 vals)
1574 "::"
1575 (car
1576 (nth 3 vals)))))
1577 )
1578 (symbol
1579 opt-template-specifier
1580 punctuation
1581 "\\`[:]\\'"
1582 punctuation
1583 "\\`[:]\\'"
1584 ,(semantic-lambda
1585 (list
1586 (nth 0 vals)))
1587 )
1588 ) ;; end namespace-opt-class
1589
1590 (opt-class
1591 (namespace-opt-class
1592 ,(semantic-lambda
1593 (nth 0 vals))
1594 )
1595 ( ;;EMPTY
1596 ,(semantic-lambda
1597 (list nil))
1598 )
1599 ) ;; end opt-class
1600
1601 (opt-destructor
1602 (punctuation
1603 "\\`[~]\\'"
1604 ,(semantic-lambda
1605 (list t))
1606 )
1607 ( ;;EMPTY
1608 ,(semantic-lambda
1609 (list nil))
1610 )
1611 ) ;; end opt-destructor
1612
1613 (arg-list
1614 (semantic-list
1615 "^("
1616 knr-arguments
1617 ,(semantic-lambda
1618 (nth 1 vals))
1619 )
1620 (semantic-list
1621 "^("
1622 ,(semantic-lambda
1623 (semantic-parse-region
1624 (car
1625 (nth 0 vals))
1626 (cdr
1627 (nth 0 vals))
1628 'arg-sub-list
1629 1))
1630 )
1631 (semantic-list
1632 "^(void)$"
1633 ,(semantic-lambda)
1634 )
1635 ) ;; end arg-list
1636
1637 (knr-varnamelist
1638 (varname
1639 punctuation
1640 "\\`[,]\\'"
1641 knr-varnamelist
1642 ,(semantic-lambda
1643 (cons
1644 (nth 0 vals)
1645 (nth 2 vals)))
1646 )
1647 (varname
1648 ,(semantic-lambda
1649 (list
1650 (nth 0 vals)))
1651 )
1652 ) ;; end knr-varnamelist
1653
1654 (knr-one-variable-decl
1655 (declmods
1656 typeformbase
1657 cv-declmods
1658 knr-varnamelist
1659 ,(semantic-lambda
1660 (semantic-tag-new-variable
1661 (nreverse
1662 (nth 3 vals))
1663 (nth 1 vals) nil :constant-flag
1664 (if
1665 (member
1666 "const"
1667 (append
1668 (nth 2 vals))) t nil) :typemodifiers
1669 (delete
1670 "const"
1671 (nth 2 vals))))
1672 )
1673 ) ;; end knr-one-variable-decl
1674
1675 (knr-arguments
1676 (knr-one-variable-decl
1677 punctuation
1678 "\\`[;]\\'"
1679 knr-arguments
1680 ,(semantic-lambda
1681 (append
1682 (semantic-expand-c-tag
1683 (nth 0 vals))
1684 (nth 2 vals)))
1685 )
1686 (knr-one-variable-decl
1687 punctuation
1688 "\\`[;]\\'"
1689 ,(semantic-lambda
1690 (semantic-expand-c-tag
1691 (nth 0 vals)))
1692 )
1693 ) ;; end knr-arguments
1694
1695 (arg-sub-list
1696 (variablearg
1697 ,(semantic-lambda
1698 (nth 0 vals))
1699 )
1700 (punctuation
1701 "\\`[.]\\'"
1702 punctuation
1703 "\\`[.]\\'"
1704 punctuation
1705 "\\`[.]\\'"
1706 close-paren
1707 ")"
1708 ,(semantic-lambda
1709 (semantic-tag-new-variable
1710 "..."
1711 "vararg" nil))
1712 )
1713 (punctuation
1714 "\\`[,]\\'"
1715 ,(semantic-lambda
1716 (list nil))
1717 )
1718 (open-paren
1719 "("
1720 ,(semantic-lambda
1721 (list nil))
1722 )
1723 (close-paren
1724 ")"
1725 ,(semantic-lambda
1726 (list nil))
1727 )
1728 ) ;; end arg-sub-list
1729
1730 (operatorsym
1731 (punctuation
1732 "\\`[<]\\'"
1733 punctuation
1734 "\\`[<]\\'"
1735 punctuation
1736 "\\`[=]\\'"
1737 ,(semantic-lambda
1738 (list
1739 "<<="))
1740 )
1741 (punctuation
1742 "\\`[>]\\'"
1743 punctuation
1744 "\\`[>]\\'"
1745 punctuation
1746 "\\`[=]\\'"
1747 ,(semantic-lambda
1748 (list
1749 ">>="))
1750 )
1751 (punctuation
1752 "\\`[<]\\'"
1753 punctuation
1754 "\\`[<]\\'"
1755 ,(semantic-lambda
1756 (list
1757 "<<"))
1758 )
1759 (punctuation
1760 "\\`[>]\\'"
1761 punctuation
1762 "\\`[>]\\'"
1763 ,(semantic-lambda
1764 (list
1765 ">>"))
1766 )
1767 (punctuation
1768 "\\`[=]\\'"
1769 punctuation
1770 "\\`[=]\\'"
1771 ,(semantic-lambda
1772 (list
1773 "=="))
1774 )
1775 (punctuation
1776 "\\`[<]\\'"
1777 punctuation
1778 "\\`[=]\\'"
1779 ,(semantic-lambda
1780 (list
1781 "<="))
1782 )
1783 (punctuation
1784 "\\`[>]\\'"
1785 punctuation
1786 "\\`[=]\\'"
1787 ,(semantic-lambda
1788 (list
1789 ">="))
1790 )
1791 (punctuation
1792 "\\`[!]\\'"
1793 punctuation
1794 "\\`[=]\\'"
1795 ,(semantic-lambda
1796 (list
1797 "!="))
1798 )
1799 (punctuation
1800 "\\`[+]\\'"
1801 punctuation
1802 "\\`[=]\\'"
1803 ,(semantic-lambda
1804 (list
1805 "+="))
1806 )
1807 (punctuation
1808 "\\`[-]\\'"
1809 punctuation
1810 "\\`[=]\\'"
1811 ,(semantic-lambda
1812 (list
1813 "-="))
1814 )
1815 (punctuation
1816 "\\`[*]\\'"
1817 punctuation
1818 "\\`[=]\\'"
1819 ,(semantic-lambda
1820 (list
1821 "*="))
1822 )
1823 (punctuation
1824 "\\`[/]\\'"
1825 punctuation
1826 "\\`[=]\\'"
1827 ,(semantic-lambda
1828 (list
1829 "/="))
1830 )
1831 (punctuation
1832 "\\`[%]\\'"
1833 punctuation
1834 "\\`[=]\\'"
1835 ,(semantic-lambda
1836 (list
1837 "%="))
1838 )
1839 (punctuation
1840 "\\`[&]\\'"
1841 punctuation
1842 "\\`[=]\\'"
1843 ,(semantic-lambda
1844 (list
1845 "&="))
1846 )
1847 (punctuation
1848 "\\`[|]\\'"
1849 punctuation
1850 "\\`[=]\\'"
1851 ,(semantic-lambda
1852 (list
1853 "|="))
1854 )
1855 (punctuation
1856 "\\`[-]\\'"
1857 punctuation
1858 "\\`[>]\\'"
1859 punctuation
1860 "\\`[*]\\'"
1861 ,(semantic-lambda
1862 (list
1863 "->*"))
1864 )
1865 (punctuation
1866 "\\`[-]\\'"
1867 punctuation
1868 "\\`[>]\\'"
1869 ,(semantic-lambda
1870 (list
1871 "->"))
1872 )
1873 (semantic-list
1874 "()"
1875 ,(semantic-lambda
1876 (list
1877 "()"))
1878 )
1879 (semantic-list
1880 "\\[\\]"
1881 ,(semantic-lambda
1882 (list
1883 "[]"))
1884 )
1885 (punctuation
1886 "\\`[<]\\'")
1887 (punctuation
1888 "\\`[>]\\'")
1889 (punctuation
1890 "\\`[*]\\'")
1891 (punctuation
1892 "\\`[+]\\'"
1893 punctuation
1894 "\\`[+]\\'"
1895 ,(semantic-lambda
1896 (list
1897 "++"))
1898 )
1899 (punctuation
1900 "\\`[+]\\'")
1901 (punctuation
1902 "\\`[-]\\'"
1903 punctuation
1904 "\\`[-]\\'"
1905 ,(semantic-lambda
1906 (list
1907 "--"))
1908 )
1909 (punctuation
1910 "\\`[-]\\'")
1911 (punctuation
1912 "\\`[&]\\'"
1913 punctuation
1914 "\\`[&]\\'"
1915 ,(semantic-lambda
1916 (list
1917 "&&"))
1918 )
1919 (punctuation
1920 "\\`[&]\\'")
1921 (punctuation
1922 "\\`[|]\\'"
1923 punctuation
1924 "\\`[|]\\'"
1925 ,(semantic-lambda
1926 (list
1927 "||"))
1928 )
1929 (punctuation
1930 "\\`[|]\\'")
1931 (punctuation
1932 "\\`[/]\\'")
1933 (punctuation
1934 "\\`[=]\\'")
1935 (punctuation
1936 "\\`[!]\\'")
1937 (punctuation
1938 "\\`[~]\\'")
1939 (punctuation
1940 "\\`[%]\\'")
1941 (punctuation
1942 "\\`[,]\\'")
1943 (punctuation
1944 "\\`\\^\\'"
1945 punctuation
1946 "\\`[=]\\'"
1947 ,(semantic-lambda
1948 (list
1949 "^="))
1950 )
1951 (punctuation
1952 "\\`\\^\\'")
1953 ) ;; end operatorsym
1954
1955 (functionname
1956 (OPERATOR
1957 operatorsym
1958 ,(semantic-lambda
1959 (nth 1 vals))
1960 )
1961 (semantic-list
1962 ,(lambda (vals start end)
1963 (semantic-bovinate-from-nonterminal
1964 (car
1965 (nth 0 vals))
1966 (cdr
1967 (nth 0 vals))
1968 'function-pointer))
1969 )
1970 (symbol
1971 ,(semantic-lambda
1972 (list
1973 (nth 0 vals)))
1974 )
1975 ) ;; end functionname
1976
1977 (function-pointer
1978 (open-paren
1979 "("
1980 punctuation
1981 "\\`[*]\\'"
1982 symbol
1983 close-paren
1984 ")"
1985 ,(semantic-lambda
1986 (list
1987 (concat
1988 "*"
1989 (nth 2 vals))))
1990 )
1991 ) ;; end function-pointer
1992
1993 (fun-or-proto-end
1994 (punctuation
1995 "\\`[;]\\'"
1996 ,(semantic-lambda
1997 (list t))
1998 )
1999 (semantic-list
2000 ,(semantic-lambda
2001 (list nil))
2002 )
2003 (punctuation
2004 "\\`[=]\\'"
2005 number
2006 "^0$"
2007 punctuation
2008 "\\`[;]\\'"
2009 ,(semantic-lambda
2010 (list ':pure-virtual-flag))
2011 )
2012 (fun-try-end
2013 ,(semantic-lambda
2014 (list nil))
2015 )
2016 ) ;; end fun-or-proto-end
2017
2018 (fun-try-end
2019 (TRY
2020 opt-initializers
2021 semantic-list
2022 "^{"
2023 fun-try-several-catches
2024 ,(semantic-lambda
2025 (list nil))
2026 )
2027 ) ;; end fun-try-end
2028
2029 (fun-try-several-catches
2030 (CATCH
2031 semantic-list
2032 "^("
2033 semantic-list
2034 "^{"
2035 fun-try-several-catches
2036 ,(semantic-lambda)
2037 )
2038 (CATCH
2039 semantic-list
2040 "^{"
2041 fun-try-several-catches
2042 ,(semantic-lambda)
2043 )
2044 ( ;;EMPTY
2045 ,(semantic-lambda)
2046 )
2047 ) ;; end fun-try-several-catches
2048
2049 (type-cast
2050 (semantic-list
2051 ,(lambda (vals start end)
2052 (semantic-bovinate-from-nonterminal
2053 (car
2054 (nth 0 vals))
2055 (cdr
2056 (nth 0 vals))
2057 'type-cast-list))
2058 )
2059 ) ;; end type-cast
2060
2061 (type-cast-list
2062 (open-paren
2063 typeformbase
2064 close-paren)
2065 ) ;; end type-cast-list
2066
2067 (opt-stuff-after-symbol
2068 (semantic-list
2069 "^(")
2070 (semantic-list
2071 "\\[.*\\]$")
2072 ( ;;EMPTY
2073 )
2074 ) ;; end opt-stuff-after-symbol
2075
2076 (multi-stage-dereference
2077 (namespace-symbol
2078 opt-stuff-after-symbol
2079 punctuation
2080 "\\`[.]\\'"
2081 multi-stage-dereference)
2082 (namespace-symbol
2083 opt-stuff-after-symbol
2084 punctuation
2085 "\\`[-]\\'"
2086 punctuation
2087 "\\`[>]\\'"
2088 multi-stage-dereference)
2089 (namespace-symbol
2090 opt-stuff-after-symbol)
2091 ) ;; end multi-stage-dereference
2092
2093 (string-seq
2094 (string
2095 string-seq
2096 ,(semantic-lambda
2097 (list
2098 (concat
2099 (nth 0 vals)
2100 (car
2101 (nth 1 vals)))))
2102 )
2103 (string
2104 ,(semantic-lambda
2105 (list
2106 (nth 0 vals)))
2107 )
2108 ) ;; end string-seq
2109
2110 (expr-start
2111 (punctuation
2112 "\\`[-]\\'")
2113 (punctuation
2114 "\\`[+]\\'")
2115 (punctuation
2116 "\\`[*]\\'")
2117 (punctuation
2118 "\\`[&]\\'")
2119 ) ;; end expr-start
2120
2121 (expr-binop
2122 (punctuation
2123 "\\`[-]\\'")
2124 (punctuation
2125 "\\`[+]\\'")
2126 (punctuation
2127 "\\`[*]\\'")
2128 (punctuation
2129 "\\`[/]\\'")
2130 (punctuation
2131 "\\`[&]\\'"
2132 punctuation
2133 "\\`[&]\\'")
2134 (punctuation
2135 "\\`[&]\\'")
2136 (punctuation
2137 "\\`[|]\\'"
2138 punctuation
2139 "\\`[|]\\'")
2140 (punctuation
2141 "\\`[|]\\'")
2142 ) ;; end expr-binop
2143
2144 (expression
2145 (unaryexpression
2146 expr-binop
2147 unaryexpression
2148 ,(semantic-lambda
2149 (list
2150 (identity start)
2151 (identity end)))
2152 )
2153 (unaryexpression
2154 ,(semantic-lambda
2155 (list
2156 (identity start)
2157 (identity end)))
2158 )
2159 ) ;; end expression
2160
2161 (unaryexpression
2162 (number)
2163 (multi-stage-dereference)
2164 (NEW
2165 multi-stage-dereference)
2166 (NEW
2167 builtintype-types
2168 semantic-list)
2169 (namespace-symbol)
2170 (string-seq)
2171 (type-cast
2172 expression)
2173 (semantic-list
2174 expression)
2175 (semantic-list)
2176 (expr-start
2177 expression)
2178 ) ;; end unaryexpression
2179 )
2180 "Parser table.")
2181
2182 (defun semantic-c-by--install-parser ()
2183 "Setup the Semantic Parser."
2184 (setq semantic--parse-table semantic-c-by--parse-table
2185 semantic-debug-parser-source "c.by"
2186 semantic-debug-parser-class 'semantic-bovine-debug-parser
2187 semantic-flex-keywords-obarray semantic-c-by--keyword-table
2188 semantic-equivalent-major-modes '(c-mode c++-mode)
2189 ))
2190 \f
2191 ;;; Epilogue
2192 ;;
2193
2194 (provide 'semantic/bovine/c-by)
2195
2196 ;;; semantic/bovine/c-by.el ends here