1 ;;; semantic/bovine/c-by.el --- Generated parser support file
3 ;;; Copyright (C) 1999-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 the grammar file semantic/bovine/c.by
23 ;; in the CEDET repository.
27 (require 'semantic/lex)
28 (eval-when-compile (require 'semantic/bovine))
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")
34 (defconst semantic-c-by--keyword-table
35 (semantic-lex-make-keyword-table
39 ("volatile" . VOLATILE)
40 ("register" . REGISTER)
42 ("unsigned" . UNSIGNED)
51 ("typename" . TYPENAME)
52 ("namespace" . NAMESPACE)
56 ("template" . TEMPLATE)
58 ("reentrant" . REENTRANT)
61 ("operator" . OPERATOR)
64 ("protected" . PROTECTED)
76 ("continue" . CONTINUE)
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.")
140 (defconst semantic-c-by--token-table
141 (semantic-lex-make-type-table
143 (BRACKETS . "\\[\\]")
145 (VOID_BLCK . "^(void)$")
148 (BRACK_BLCK . "\\[.*\\]$"))
156 (RESTRICT . "\\<\\(__\\)?restrict\\>"))
160 (CPP . "\"C\\+\\+\"")
166 (TILDE . "\\`[~]\\'")
168 (GREATER . "\\`[>]\\'")
170 (EQUAL . "\\`[=]\\'")
172 (MINUS . "\\`[-]\\'")
174 (DIVIDE . "\\`[/]\\'")
175 (AMPERSAND . "\\`[&]\\'")
177 (SEMICOLON . "\\`[;]\\'")
178 (COLON . "\\`[:]\\'")
179 (PERIOD . "\\`[.]\\'")
180 (HASH . "\\`[#]\\'")))
182 "Table of lexical tokens.")
184 (defconst semantic-c-by--parse-table
188 ) ;; end bovine-toplevel
192 ) ;; end bovine-inner-scope
206 (codeblock-var-or-fun)
221 ) ;; end extern-c-contents
232 (semantic-parse-region
248 (semantic-parse-region
273 (semantic-tag-new-variable
274 (nth 0 vals) nil nil :constant-flag t))
278 (semantic-tag-new-include
283 (semantic-tag-new-include
291 (semantic-tag-new-variable
292 (nth 0 vals) nil nil :constant-flag t))
303 (semantic-parse-region
362 ) ;; end classsubparts
368 opt-template-specifier
376 ) ;; end opt-class-parents
379 (opt-class-protection
383 (semantic-tag-new-type
386 "class" nil nil :protection
394 (semantic-tag-new-type
397 "class" nil nil :protection
401 ) ;; end one-class-parent
418 ) ;; end class-parents
428 ) ;; end opt-class-declmods
432 ) ;; end class-declmods
438 ) ;; end class-protection
440 (opt-class-protection
450 ) ;; end opt-class-protection
455 (semantic-parse-region
463 ) ;; end namespaceparts
492 ) ;; end namespacesubparts
497 (semantic-parse-region
511 (semantic-tag-new-variable
515 (nth 1 vals)) :constant-flag t))
532 ) ;; end enumsubparts
547 opt-template-specifier
551 (semantic-tag-new-type
558 (semantic-c-classname
564 (semantic-parse-region
571 (nth 4 vals) :template-specifier
579 opt-template-specifier
582 (semantic-tag-new-type
587 (nth 4 vals) :template-specifier
588 (nth 3 vals) :prototype t :parent
597 (semantic-tag-new-type
601 (nth 3 vals) nil :parent
610 (semantic-tag-new-type
614 (nth 3 vals) nil :parent
624 (semantic-tag-new-type
647 ) ;; end typedef-symbol-list
664 ) ;; end struct-or-class
677 (semantic-tag-new-type
685 (semantic-tag-new-type
698 (semantic-tag-new-type
702 (semantic-tag-new-type
705 (nth 0 vals) nil nil)) nil :kind
727 (semantic-tag-new-type
730 "class" nil nil :prototype t))
735 (semantic-tag-new-type
738 "namespace" nil nil :prototype t))
748 (semantic-c-reconstitute-template
760 (opt-template-specifier
768 ) ;; end opt-template-specifier
773 template-specifier-types
779 ) ;; end template-specifier
781 (template-specifier-types
783 template-specifier-type-list
791 ) ;; end template-specifier-types
793 (template-specifier-type-list
796 template-specifier-types
803 ) ;; end template-specifier-type-list
842 ) ;; end template-var
850 template-specifier-types
867 ) ;; end opt-template-equal
873 (semantic-tag-new-type
880 (semantic-tag-new-type
887 (semantic-tag-new-type
898 (semantic-tag-new-type
900 (nth 1 vals)) nil nil nil :constant-flag
906 (nth 2 vals))) t nil) :typemodifiers
911 (nth 2 vals))) :reference
913 (nth 4 vals)) :pointer
917 ) ;; end template-type
928 ) ;; end template-definition
1003 ) ;; end metadeclmod
1026 ) ;; end cv-declmods
1031 ) ;; end METADECLMOD
1055 (semantic-tag-new-type
1057 (nth 0 vals) nil nil))
1062 (semantic-tag-new-type
1064 (nth 0 vals) nil nil))
1069 (semantic-tag-new-type
1071 (nth 0 vals) nil nil))
1080 (semantic-tag-new-type
1082 "class" nil nil :template-specifier
1085 (namespace-symbol-for-typeformbase
1086 opt-template-specifier
1088 (semantic-tag-new-type
1091 "class" nil nil :template-specifier
1099 ) ;; end typeformbase
1152 ) ;; end builtintype-types
1178 ) ;; end builtintype
1180 (codeblock-var-or-fun
1187 (semantic-c-reconstitute-token
1192 ) ;; end codeblock-var-or-fun
1195 (codeblock-var-or-fun
1202 (semantic-c-reconstitute-token
1217 ) ;; end var-or-func-decl
1224 opt-template-specifier
1227 opt-post-fcn-modifiers
1250 opt-template-specifier
1252 opt-post-fcn-modifiers
1294 ) ;; end opt-under-p
1309 ) ;; end opt-initializers
1311 (opt-post-fcn-modifiers
1313 opt-post-fcn-modifiers
1323 ) ;; end opt-post-fcn-modifiers
1328 ) ;; end post-fcn-modifiers
1333 ,(lambda (vals start end)
1334 (semantic-bovinate-from-nonterminal
1339 'throw-exception-list))
1345 (throw-exception-list
1349 throw-exception-list
1371 throw-exception-list
1379 ) ;; end throw-exception-list
1428 "\\<\\(__\\)?restrict\\>")
1431 ) ;; end opt-restrict
1452 variablearg-opt-name
1454 (semantic-tag-new-variable
1457 (nth 1 vals) nil :constant-flag
1463 (nth 2 vals))) t nil) :typemodifiers
1468 (nth 2 vals))) :reference
1472 ) ;; end variablearg
1474 (variablearg-opt-name
1486 ) ;; end variablearg-opt-name
1488 (varname-opt-initializer
1493 ) ;; end varname-opt-initializer
1498 varname-opt-initializer
1509 varname-opt-initializer
1514 ) ;; end varnamelist
1518 opt-template-specifier
1533 opt-template-specifier
1538 ) ;; end namespace-symbol
1540 (namespace-symbol-for-typeformbase
1542 opt-template-specifier
1547 namespace-symbol-for-typeformbase
1561 ) ;; end namespace-symbol-for-typeformbase
1563 (namespace-opt-class
1579 opt-template-specifier
1588 ) ;; end namespace-opt-class
1591 (namespace-opt-class
1611 ) ;; end opt-destructor
1623 (semantic-parse-region
1652 ) ;; end knr-varnamelist
1654 (knr-one-variable-decl
1660 (semantic-tag-new-variable
1663 (nth 1 vals) nil :constant-flag
1668 (nth 2 vals))) t nil) :typemodifiers
1673 ) ;; end knr-one-variable-decl
1676 (knr-one-variable-decl
1682 (semantic-expand-c-tag
1686 (knr-one-variable-decl
1690 (semantic-expand-c-tag
1693 ) ;; end knr-arguments
1709 (semantic-tag-new-variable
1728 ) ;; end arg-sub-list
1953 ) ;; end operatorsym
1962 ,(lambda (vals start end)
1963 (semantic-bovinate-from-nonterminal
1975 ) ;; end functionname
1991 ) ;; end function-pointer
2010 (list ':pure-virtual-flag))
2016 ) ;; end fun-or-proto-end
2023 fun-try-several-catches
2027 ) ;; end fun-try-end
2029 (fun-try-several-catches
2035 fun-try-several-catches
2041 fun-try-several-catches
2047 ) ;; end fun-try-several-catches
2051 ,(lambda (vals start end)
2052 (semantic-bovinate-from-nonterminal
2065 ) ;; end type-cast-list
2067 (opt-stuff-after-symbol
2074 ) ;; end opt-stuff-after-symbol
2076 (multi-stage-dereference
2078 opt-stuff-after-symbol
2081 multi-stage-dereference)
2083 opt-stuff-after-symbol
2088 multi-stage-dereference)
2090 opt-stuff-after-symbol)
2091 ) ;; end multi-stage-dereference
2163 (multi-stage-dereference)
2165 multi-stage-dereference)
2178 ) ;; end unaryexpression
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)
2194 (provide 'semantic/bovine/c-by)
2196 ;;; semantic/bovine/c-by.el ends here