1 ;;; semantic/bovine/c-by.el --- Generated parser support file
3 ;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
4 ;;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
6 ;; This file is part of GNU Emacs.
8 ;; GNU Emacs is free software: you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; GNU Emacs is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23 ;; This file was generated from the grammar file semantic/bovine/c.by
24 ;; in the CEDET repository.
28 (require 'semantic/lex)
29 (eval-when-compile (require 'semantic/bovine))
31 (declare-function semantic-c-reconstitute-token "semantic/bovine/c")
32 (declare-function semantic-c-reconstitute-template "semantic/bovine/c")
33 (declare-function semantic-expand-c-tag "semantic/bovine/c")
35 (defconst semantic-c-by--keyword-table
36 (semantic-lex-make-keyword-table
40 ("volatile" . VOLATILE)
41 ("register" . REGISTER)
43 ("unsigned" . UNSIGNED)
52 ("typename" . TYPENAME)
53 ("namespace" . NAMESPACE)
57 ("template" . TEMPLATE)
59 ("reentrant" . REENTRANT)
62 ("operator" . OPERATOR)
65 ("protected" . PROTECTED)
77 ("continue" . CONTINUE)
89 ("__P" . UNDERUNDERP))
90 '(("__P" summary "Common macro to eliminate prototype compatibility on some compilers")
91 ("_P" summary "Common macro to eliminate prototype compatibility on some compilers")
92 ("bool" summary "Primitive boolean type")
93 ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
94 ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
95 ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
96 ("int" summary "Integral Primitive Type: (-2147483648 to 2147483647)")
97 ("short" summary "Integral Primitive Type: (-32768 to 32767)")
98 ("wchar_t" summary "Wide Character Type")
99 ("char" summary "Integral Character Type: (0 to 256)")
100 ("void" summary "Built in typeless type: void")
101 ("sizeof" summary "Compile time macro: sizeof(<type or variable>) // size in bytes")
102 ("continue" summary "Non-local continue within a loop (for, do/while): continue;")
103 ("break" summary "Non-local exit within a loop or switch (for, do/while, switch): break;")
104 ("return" summary "return <value>;")
105 ("default" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
106 ("case" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
107 ("switch" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
108 ("for" summary "for(<init>; <condition>; <increment>) { code }")
109 ("while" summary "do { code } while (<condition>); or while (<condition>) { code };")
110 ("do" summary " do { code } while (<condition>);")
111 ("else" summary "if (<condition>) { code } [ else { code } ]")
112 ("if" summary "if (<condition>) { code } [ else { code } ]")
113 ("friend" summary "friend class <CLASSNAME>")
114 ("catch" summary "try { <body> } catch { <catch code> }")
115 ("try" summary "try { <body> } catch { <catch code> }")
116 ("reentrant" summary "<type> <methoddef> (<method args>) reentrant ...")
117 ("throw" summary "<type> <methoddef> (<method args>) throw (<exception>) ...")
118 ("template" summary "template <class TYPE ...> TYPE_OR_FUNCTION")
119 ("delete" summary "delete <object>;")
120 ("new" summary "new <classname>();")
121 ("using" summary "using <namespace>;")
122 ("namespace" summary "Namespace Declaration: namespace <name> { ... };")
123 ("typename" summary "typename is used to handle a qualified name as a typename;")
124 ("class" summary "Class Declaration: class <name>[:parents] { ... };")
125 ("typedef" summary "Arbitrary Type Declaration: typedef <typedeclaration> <name>;")
126 ("enum" summary "Enumeration Type Declaration: enum [name] { ... };")
127 ("union" summary "Union Type Declaration: union [name] { ... };")
128 ("struct" summary "Structure Type Declaration: struct [name] { ... };")
129 ("mutable" summary "Member Declaration Modifier: mutable <type> <name> ...")
130 ("virtual" summary "Method Modifier: virtual <type> <name>(...) ...")
131 ("inline" summary "Function Modifier: inline <return type> <name>(...) {...};")
132 ("unsigned" summary "Numeric Type Modifier: unsigned <numeric type> <name> ...")
133 ("signed" summary "Numeric Type Modifier: signed <numeric type> <name> ...")
134 ("register" summary "Declaration Modifier: register <type> <name> ...")
135 ("volatile" summary "Declaration Modifier: volatile <type> <name> ...")
136 ("const" summary "Declaration Modifier: const <type> <name> ...")
137 ("static" summary "Declaration Modifier: static <type> <name> ...")
138 ("extern" summary "Declaration Modifier: extern <type> <name> ...")))
139 "Table of language keywords.")
141 (defconst semantic-c-by--token-table
142 (semantic-lex-make-type-table
144 (BRACKETS . "\\[\\]")
146 (VOID_BLCK . "^(void)$")
149 (BRACK_BLCK . "\\[.*\\]$"))
157 (RESTRICT . "\\<\\(__\\)?restrict\\>"))
161 (CPP . "\"C\\+\\+\"")
167 (TILDE . "\\`[~]\\'")
169 (GREATER . "\\`[>]\\'")
171 (EQUAL . "\\`[=]\\'")
173 (MINUS . "\\`[-]\\'")
175 (DIVIDE . "\\`[/]\\'")
176 (AMPERSAND . "\\`[&]\\'")
178 (SEMICOLON . "\\`[;]\\'")
179 (COLON . "\\`[:]\\'")
180 (PERIOD . "\\`[.]\\'")
181 (HASH . "\\`[#]\\'")))
183 "Table of lexical tokens.")
185 (defconst semantic-c-by--parse-table
189 ) ;; end bovine-toplevel
193 ) ;; end bovine-inner-scope
207 (codeblock-var-or-fun)
222 ) ;; end extern-c-contents
233 (semantic-parse-region
249 (semantic-parse-region
274 (semantic-tag-new-variable
275 (nth 0 vals) nil nil :constant-flag t))
279 (semantic-tag-new-include
284 (semantic-tag-new-include
292 (semantic-tag-new-variable
293 (nth 0 vals) nil nil :constant-flag t))
304 (semantic-parse-region
363 ) ;; end classsubparts
369 opt-template-specifier
377 ) ;; end opt-class-parents
380 (opt-class-protection
384 (semantic-tag-new-type
387 "class" nil nil :protection
395 (semantic-tag-new-type
398 "class" nil nil :protection
402 ) ;; end one-class-parent
419 ) ;; end class-parents
429 ) ;; end opt-class-declmods
433 ) ;; end class-declmods
439 ) ;; end class-protection
441 (opt-class-protection
451 ) ;; end opt-class-protection
456 (semantic-parse-region
464 ) ;; end namespaceparts
493 ) ;; end namespacesubparts
498 (semantic-parse-region
512 (semantic-tag-new-variable
516 (nth 1 vals)) :constant-flag t))
533 ) ;; end enumsubparts
548 opt-template-specifier
552 (semantic-tag-new-type
559 (semantic-c-classname
565 (semantic-parse-region
572 (nth 4 vals) :template-specifier
580 opt-template-specifier
583 (semantic-tag-new-type
588 (nth 4 vals) :template-specifier
589 (nth 3 vals) :prototype t :parent
598 (semantic-tag-new-type
602 (nth 3 vals) nil :parent
611 (semantic-tag-new-type
615 (nth 3 vals) nil :parent
625 (semantic-tag-new-type
648 ) ;; end typedef-symbol-list
665 ) ;; end struct-or-class
678 (semantic-tag-new-type
686 (semantic-tag-new-type
699 (semantic-tag-new-type
703 (semantic-tag-new-type
706 (nth 0 vals) nil nil)) nil :kind
728 (semantic-tag-new-type
731 "class" nil nil :prototype t))
736 (semantic-tag-new-type
739 "namespace" nil nil :prototype t))
749 (semantic-c-reconstitute-template
761 (opt-template-specifier
769 ) ;; end opt-template-specifier
774 template-specifier-types
780 ) ;; end template-specifier
782 (template-specifier-types
784 template-specifier-type-list
792 ) ;; end template-specifier-types
794 (template-specifier-type-list
797 template-specifier-types
804 ) ;; end template-specifier-type-list
843 ) ;; end template-var
851 template-specifier-types
868 ) ;; end opt-template-equal
874 (semantic-tag-new-type
881 (semantic-tag-new-type
888 (semantic-tag-new-type
899 (semantic-tag-new-type
901 (nth 1 vals)) nil nil nil :constant-flag
907 (nth 2 vals))) t nil) :typemodifiers
912 (nth 2 vals))) :reference
914 (nth 4 vals)) :pointer
918 ) ;; end template-type
929 ) ;; end template-definition
1004 ) ;; end metadeclmod
1027 ) ;; end cv-declmods
1032 ) ;; end METADECLMOD
1056 (semantic-tag-new-type
1058 (nth 0 vals) nil nil))
1063 (semantic-tag-new-type
1065 (nth 0 vals) nil nil))
1070 (semantic-tag-new-type
1072 (nth 0 vals) nil nil))
1081 (semantic-tag-new-type
1083 "class" nil nil :template-specifier
1086 (namespace-symbol-for-typeformbase
1087 opt-template-specifier
1089 (semantic-tag-new-type
1092 "class" nil nil :template-specifier
1100 ) ;; end typeformbase
1153 ) ;; end builtintype-types
1179 ) ;; end builtintype
1181 (codeblock-var-or-fun
1188 (semantic-c-reconstitute-token
1193 ) ;; end codeblock-var-or-fun
1196 (codeblock-var-or-fun
1203 (semantic-c-reconstitute-token
1218 ) ;; end var-or-func-decl
1225 opt-template-specifier
1228 opt-post-fcn-modifiers
1251 opt-template-specifier
1253 opt-post-fcn-modifiers
1295 ) ;; end opt-under-p
1310 ) ;; end opt-initializers
1312 (opt-post-fcn-modifiers
1314 opt-post-fcn-modifiers
1324 ) ;; end opt-post-fcn-modifiers
1329 ) ;; end post-fcn-modifiers
1334 ,(lambda (vals start end)
1335 (semantic-bovinate-from-nonterminal
1340 'throw-exception-list))
1346 (throw-exception-list
1350 throw-exception-list
1372 throw-exception-list
1380 ) ;; end throw-exception-list
1429 "\\<\\(__\\)?restrict\\>")
1432 ) ;; end opt-restrict
1453 variablearg-opt-name
1455 (semantic-tag-new-variable
1458 (nth 1 vals) nil :constant-flag
1464 (nth 2 vals))) t nil) :typemodifiers
1469 (nth 2 vals))) :reference
1473 ) ;; end variablearg
1475 (variablearg-opt-name
1487 ) ;; end variablearg-opt-name
1489 (varname-opt-initializer
1494 ) ;; end varname-opt-initializer
1499 varname-opt-initializer
1510 varname-opt-initializer
1515 ) ;; end varnamelist
1519 opt-template-specifier
1534 opt-template-specifier
1539 ) ;; end namespace-symbol
1541 (namespace-symbol-for-typeformbase
1543 opt-template-specifier
1548 namespace-symbol-for-typeformbase
1562 ) ;; end namespace-symbol-for-typeformbase
1564 (namespace-opt-class
1580 opt-template-specifier
1589 ) ;; end namespace-opt-class
1592 (namespace-opt-class
1612 ) ;; end opt-destructor
1624 (semantic-parse-region
1653 ) ;; end knr-varnamelist
1655 (knr-one-variable-decl
1661 (semantic-tag-new-variable
1664 (nth 1 vals) nil :constant-flag
1669 (nth 2 vals))) t nil) :typemodifiers
1674 ) ;; end knr-one-variable-decl
1677 (knr-one-variable-decl
1683 (semantic-expand-c-tag
1687 (knr-one-variable-decl
1691 (semantic-expand-c-tag
1694 ) ;; end knr-arguments
1710 (semantic-tag-new-variable
1729 ) ;; end arg-sub-list
1954 ) ;; end operatorsym
1963 ,(lambda (vals start end)
1964 (semantic-bovinate-from-nonterminal
1976 ) ;; end functionname
1992 ) ;; end function-pointer
2011 (list ':pure-virtual-flag))
2017 ) ;; end fun-or-proto-end
2024 fun-try-several-catches
2028 ) ;; end fun-try-end
2030 (fun-try-several-catches
2036 fun-try-several-catches
2042 fun-try-several-catches
2048 ) ;; end fun-try-several-catches
2052 ,(lambda (vals start end)
2053 (semantic-bovinate-from-nonterminal
2066 ) ;; end type-cast-list
2068 (opt-stuff-after-symbol
2075 ) ;; end opt-stuff-after-symbol
2077 (multi-stage-dereference
2079 opt-stuff-after-symbol
2082 multi-stage-dereference)
2084 opt-stuff-after-symbol
2089 multi-stage-dereference)
2091 opt-stuff-after-symbol)
2092 ) ;; end multi-stage-dereference
2164 (multi-stage-dereference)
2166 multi-stage-dereference)
2179 ) ;; end unaryexpression
2183 (defun semantic-c-by--install-parser ()
2184 "Setup the Semantic Parser."
2185 (setq semantic--parse-table semantic-c-by--parse-table
2186 semantic-debug-parser-source "c.by"
2187 semantic-debug-parser-class 'semantic-bovine-debug-parser
2188 semantic-flex-keywords-obarray semantic-c-by--keyword-table
2189 semantic-equivalent-major-modes '(c-mode c++-mode)
2195 (provide 'semantic/bovine/c-by)
2197 ;;; semantic/bovine/c-by.el ends here