1 ;;; semantic/bovine/c-by.el --- Generated parser support file
3 ;; Copyright (C) 1999-2012 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 admin/grammars/c.by.
26 (require 'semantic/lex)
27 (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")
37 (defconst semantic-c-by--keyword-table
38 (semantic-lex-make-keyword-table
42 ("volatile" . VOLATILE)
43 ("register" . REGISTER)
45 ("unsigned" . UNSIGNED)
49 ("explicit" . EXPLICIT)
55 ("typename" . TYPENAME)
56 ("namespace" . NAMESPACE)
60 ("template" . TEMPLATE)
62 ("reentrant" . REENTRANT)
65 ("operator" . OPERATOR)
68 ("protected" . PROTECTED)
80 ("continue" . CONTINUE)
92 ("__P" . UNDERUNDERP))
93 '(("__P" summary "Common macro to eliminate prototype compatibility on some compilers")
94 ("_P" summary "Common macro to eliminate prototype compatibility on some compilers")
95 ("bool" summary "Primitive boolean type")
96 ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
97 ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
98 ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
99 ("int" summary "Integral Primitive Type: (-2147483648 to 2147483647)")
100 ("short" summary "Integral Primitive Type: (-32768 to 32767)")
101 ("wchar_t" summary "Wide Character Type")
102 ("char" summary "Integral Character Type: (0 to 256)")
103 ("void" summary "Built in typeless type: void")
104 ("sizeof" summary "Compile time macro: sizeof(<type or variable>) // size in bytes")
105 ("continue" summary "Non-local continue within a loop (for, do/while): continue;")
106 ("break" summary "Non-local exit within a loop or switch (for, do/while, switch): break;")
107 ("return" summary "return <value>;")
108 ("default" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
109 ("case" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
110 ("switch" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
111 ("for" summary "for(<init>; <condition>; <increment>) { code }")
112 ("while" summary "do { code } while (<condition>); or while (<condition>) { code };")
113 ("do" summary " do { code } while (<condition>);")
114 ("else" summary "if (<condition>) { code } [ else { code } ]")
115 ("if" summary "if (<condition>) { code } [ else { code } ]")
116 ("friend" summary "friend class <CLASSNAME>")
117 ("catch" summary "try { <body> } catch { <catch code> }")
118 ("try" summary "try { <body> } catch { <catch code> }")
119 ("reentrant" summary "<type> <methoddef> (<method args>) reentrant ...")
120 ("throw" summary "<type> <methoddef> (<method args>) throw (<exception>) ...")
121 ("template" summary "template <class TYPE ...> TYPE_OR_FUNCTION")
122 ("delete" summary "delete <object>;")
123 ("new" summary "new <classname>();")
124 ("using" summary "using <namespace>;")
125 ("namespace" summary "Namespace Declaration: namespace <name> { ... };")
126 ("typename" summary "typename is used to handle a qualified name as a typename;")
127 ("class" summary "Class Declaration: class <name>[:parents] { ... };")
128 ("typedef" summary "Arbitrary Type Declaration: typedef <typedeclaration> <name>;")
129 ("enum" summary "Enumeration Type Declaration: enum [name] { ... };")
130 ("union" summary "Union Type Declaration: union [name] { ... };")
131 ("struct" summary "Structure Type Declaration: struct [name] { ... };")
132 ("explicit" summary "Forbids implicit type conversion: explicit <constructor>")
133 ("mutable" summary "Member Declaration Modifier: mutable <type> <name> ...")
134 ("virtual" summary "Method Modifier: virtual <type> <name>(...) ...")
135 ("inline" summary "Function Modifier: inline <return type> <name>(...) {...};")
136 ("unsigned" summary "Numeric Type Modifier: unsigned <numeric type> <name> ...")
137 ("signed" summary "Numeric Type Modifier: signed <numeric type> <name> ...")
138 ("register" summary "Declaration Modifier: register <type> <name> ...")
139 ("volatile" summary "Declaration Modifier: volatile <type> <name> ...")
140 ("const" summary "Declaration Modifier: const <type> <name> ...")
141 ("static" summary "Declaration Modifier: static <type> <name> ...")
142 ("extern" summary "Declaration Modifier: extern <type> <name> ...")))
143 "Table of language keywords.")
145 (defconst semantic-c-by--token-table
146 (semantic-lex-make-type-table
148 (BRACKETS . "\\[\\]")
150 (VOID_BLCK . "^(void)$")
153 (BRACK_BLCK . "\\[.*\\]$"))
161 (RESTRICT . "\\<\\(__\\)?restrict\\>"))
165 (CPP . "\"C\\+\\+\"")
171 (TILDE . "\\`[~]\\'")
173 (GREATER . "\\`[>]\\'")
175 (EQUAL . "\\`[=]\\'")
177 (MINUS . "\\`[-]\\'")
179 (DIVIDE . "\\`[/]\\'")
180 (AMPERSAND . "\\`[&]\\'")
182 (SEMICOLON . "\\`[;]\\'")
183 (COLON . "\\`[:]\\'")
184 (PERIOD . "\\`[.]\\'")
185 (HASH . "\\`[#]\\'")))
187 "Table of lexical tokens.")
189 (defconst semantic-c-by--parse-table
193 ) ;; end bovine-toplevel
197 ) ;; end bovine-inner-scope
211 (codeblock-var-or-fun)
226 ) ;; end extern-c-contents
237 (semantic-parse-region
253 (semantic-parse-region
278 (semantic-tag-new-variable
279 (nth 0 vals) nil nil :constant-flag t))
283 (semantic-tag-new-include
288 (semantic-tag-new-include
296 (semantic-tag-new-variable
297 (nth 0 vals) nil nil :constant-flag t))
308 (semantic-parse-region
367 ) ;; end classsubparts
373 opt-template-specifier
381 ) ;; end opt-class-parents
384 (opt-class-protection
388 (semantic-tag-new-type
391 "class" nil nil :protection
399 (semantic-tag-new-type
402 "class" nil nil :protection
406 ) ;; end one-class-parent
423 ) ;; end class-parents
433 ) ;; end opt-class-declmods
437 ) ;; end class-declmods
443 ) ;; end class-protection
445 (opt-class-protection
455 ) ;; end opt-class-protection
460 (semantic-parse-region
468 ) ;; end namespaceparts
499 'include :inside-ns t))
503 ) ;; end namespacesubparts
508 (semantic-parse-region
522 (semantic-tag-new-variable
526 (nth 1 vals)) :constant-flag t))
543 ) ;; end enumsubparts
558 opt-template-specifier
562 (semantic-tag-new-type
569 (semantic-c-classname
575 (semantic-parse-region
582 (nth 4 vals) :template-specifier
590 opt-template-specifier
593 (semantic-tag-new-type
598 (nth 4 vals) :template-specifier
599 (nth 3 vals) :prototype t :parent
608 (semantic-tag-new-type
612 (nth 3 vals) nil :parent
621 (semantic-tag-new-type
625 (nth 3 vals) nil :parent
635 (semantic-tag-new-type
658 ) ;; end typedef-symbol-list
675 ) ;; end struct-or-class
688 (semantic-tag-new-type
696 (semantic-tag-new-type
709 (semantic-tag-new-type
713 (semantic-tag-new-type
716 (nth 0 vals) nil nil)) nil :kind
738 (semantic-tag-new-type
741 "class" nil nil :prototype t))
746 (semantic-tag-new-type
749 "namespace" nil nil :prototype t))
759 (semantic-c-reconstitute-template
771 (opt-template-specifier
779 ) ;; end opt-template-specifier
784 template-specifier-types
790 ) ;; end template-specifier
792 (template-specifier-types
794 template-specifier-type-list
802 ) ;; end template-specifier-types
804 (template-specifier-type-list
807 template-specifier-types
814 ) ;; end template-specifier-type-list
853 ) ;; end template-var
861 template-specifier-types
878 ) ;; end opt-template-equal
884 (semantic-tag-new-type
891 (semantic-tag-new-type
898 (semantic-tag-new-type
909 (semantic-tag-new-type
911 (nth 1 vals)) nil nil nil :constant-flag
917 (nth 2 vals))) t nil) :typemodifiers
922 (nth 2 vals))) :reference
924 (nth 4 vals)) :pointer
928 ) ;; end template-type
939 ) ;; end template-definition
1014 ) ;; end metadeclmod
1037 ) ;; end cv-declmods
1042 ) ;; end METADECLMOD
1066 (semantic-tag-new-type
1068 (nth 0 vals) nil nil))
1073 (semantic-tag-new-type
1075 (nth 0 vals) nil nil))
1080 (semantic-tag-new-type
1082 (nth 0 vals) nil nil))
1091 (semantic-tag-new-type
1093 "class" nil nil :template-specifier
1096 (namespace-symbol-for-typeformbase
1097 opt-template-specifier
1099 (semantic-tag-new-type
1102 "class" nil nil :template-specifier
1110 ) ;; end typeformbase
1163 ) ;; end builtintype-types
1189 ) ;; end builtintype
1191 (codeblock-var-or-fun
1198 (semantic-c-reconstitute-token
1203 ) ;; end codeblock-var-or-fun
1206 (codeblock-var-or-fun
1213 (semantic-c-reconstitute-token
1228 ) ;; end var-or-func-decl
1235 opt-template-specifier
1238 opt-post-fcn-modifiers
1261 opt-template-specifier
1263 opt-post-fcn-modifiers
1305 ) ;; end opt-under-p
1320 ) ;; end opt-initializers
1322 (opt-post-fcn-modifiers
1324 opt-post-fcn-modifiers
1334 ) ;; end opt-post-fcn-modifiers
1339 ) ;; end post-fcn-modifiers
1344 ,(lambda (vals start end)
1345 (semantic-bovinate-from-nonterminal
1350 'throw-exception-list))
1356 (throw-exception-list
1360 throw-exception-list
1382 throw-exception-list
1390 ) ;; end throw-exception-list
1439 "\\<\\(__\\)?restrict\\>")
1442 ) ;; end opt-restrict
1463 variablearg-opt-name
1465 (semantic-tag-new-variable
1468 (nth 1 vals) nil :constant-flag
1474 (nth 2 vals))) t nil) :typemodifiers
1479 (nth 2 vals))) :reference
1483 ) ;; end variablearg
1485 (variablearg-opt-name
1497 ) ;; end variablearg-opt-name
1499 (varname-opt-initializer
1504 ) ;; end varname-opt-initializer
1509 varname-opt-initializer
1520 varname-opt-initializer
1525 ) ;; end varnamelist
1529 opt-template-specifier
1544 opt-template-specifier
1549 ) ;; end namespace-symbol
1551 (namespace-symbol-for-typeformbase
1553 opt-template-specifier
1558 namespace-symbol-for-typeformbase
1572 ) ;; end namespace-symbol-for-typeformbase
1574 (namespace-opt-class
1590 opt-template-specifier
1599 ) ;; end namespace-opt-class
1602 (namespace-opt-class
1622 ) ;; end opt-destructor
1634 (semantic-parse-region
1663 ) ;; end knr-varnamelist
1665 (knr-one-variable-decl
1671 (semantic-tag-new-variable
1674 (nth 1 vals) nil :constant-flag
1679 (nth 2 vals))) t nil) :typemodifiers
1684 ) ;; end knr-one-variable-decl
1687 (knr-one-variable-decl
1693 (semantic-expand-c-tag
1697 (knr-one-variable-decl
1701 (semantic-expand-c-tag
1704 ) ;; end knr-arguments
1720 (semantic-tag-new-variable
1739 ) ;; end arg-sub-list
1964 ) ;; end operatorsym
1973 ,(lambda (vals start end)
1974 (semantic-bovinate-from-nonterminal
1986 ) ;; end functionname
2011 ) ;; end function-pointer
2030 (list ':pure-virtual-flag))
2036 ) ;; end fun-or-proto-end
2043 fun-try-several-catches
2047 ) ;; end fun-try-end
2049 (fun-try-several-catches
2055 fun-try-several-catches
2061 fun-try-several-catches
2067 ) ;; end fun-try-several-catches
2071 ,(lambda (vals start end)
2072 (semantic-bovinate-from-nonterminal
2085 ) ;; end type-cast-list
2087 (opt-stuff-after-symbol
2094 ) ;; end opt-stuff-after-symbol
2096 (multi-stage-dereference
2098 opt-stuff-after-symbol
2101 multi-stage-dereference)
2103 opt-stuff-after-symbol
2108 multi-stage-dereference)
2110 opt-stuff-after-symbol)
2111 ) ;; end multi-stage-dereference
2183 (multi-stage-dereference)
2185 multi-stage-dereference)
2198 ) ;; end unaryexpression
2202 (defun semantic-c-by--install-parser ()
2203 "Setup the Semantic Parser."
2204 (setq semantic--parse-table semantic-c-by--parse-table
2205 semantic-debug-parser-source "c.by"
2206 semantic-debug-parser-class 'semantic-bovine-debug-parser
2207 semantic-flex-keywords-obarray semantic-c-by--keyword-table
2208 semantic-equivalent-major-modes '(c-mode c++-mode)
2218 (provide 'semantic/bovine/c-by)
2220 ;;; semantic/bovine/c-by.el ends here