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 etc/grammars/c.by.
26 (require 'semantic
/lex
)
27 (eval-when-compile (require 'semantic
/bovine
))
29 (declare-function semantic-c-reconstitute-token
"semantic/bovine/c")
30 (declare-function semantic-c-reconstitute-template
"semantic/bovine/c")
31 (declare-function semantic-expand-c-tag
"semantic/bovine/c")
33 (defconst semantic-c-by--keyword-table
34 (semantic-lex-make-keyword-table
38 ("volatile" . VOLATILE
)
39 ("register" . REGISTER
)
41 ("unsigned" . UNSIGNED
)
50 ("typename" . TYPENAME
)
51 ("namespace" . NAMESPACE
)
55 ("template" . TEMPLATE
)
57 ("reentrant" . REENTRANT
)
60 ("operator" . OPERATOR
)
63 ("protected" . PROTECTED
)
75 ("continue" . CONTINUE
)
87 ("__P" . UNDERUNDERP
))
88 '(("__P" summary
"Common macro to eliminate prototype compatibility on some compilers")
89 ("_P" summary
"Common macro to eliminate prototype compatibility on some compilers")
90 ("bool" summary
"Primitive boolean type")
91 ("double" summary
"Primitive floating-point type (double-precision 64-bit IEEE 754)")
92 ("float" summary
"Primitive floating-point type (single-precision 32-bit IEEE 754)")
93 ("long" summary
"Integral primitive type (-9223372036854775808 to 9223372036854775807)")
94 ("int" summary
"Integral Primitive Type: (-2147483648 to 2147483647)")
95 ("short" summary
"Integral Primitive Type: (-32768 to 32767)")
96 ("wchar_t" summary
"Wide Character Type")
97 ("char" summary
"Integral Character Type: (0 to 256)")
98 ("void" summary
"Built in typeless type: void")
99 ("sizeof" summary
"Compile time macro: sizeof(<type or variable>) // size in bytes")
100 ("continue" summary
"Non-local continue within a loop (for, do/while): continue;")
101 ("break" summary
"Non-local exit within a loop or switch (for, do/while, switch): break;")
102 ("return" summary
"return <value>;")
103 ("default" summary
"switch (<variable>) { case <constvalue>: code; ... default: code; }")
104 ("case" summary
"switch (<variable>) { case <constvalue>: code; ... default: code; }")
105 ("switch" summary
"switch (<variable>) { case <constvalue>: code; ... default: code; }")
106 ("for" summary
"for(<init>; <condition>; <increment>) { code }")
107 ("while" summary
"do { code } while (<condition>); or while (<condition>) { code };")
108 ("do" summary
" do { code } while (<condition>);")
109 ("else" summary
"if (<condition>) { code } [ else { code } ]")
110 ("if" summary
"if (<condition>) { code } [ else { code } ]")
111 ("friend" summary
"friend class <CLASSNAME>")
112 ("catch" summary
"try { <body> } catch { <catch code> }")
113 ("try" summary
"try { <body> } catch { <catch code> }")
114 ("reentrant" summary
"<type> <methoddef> (<method args>) reentrant ...")
115 ("throw" summary
"<type> <methoddef> (<method args>) throw (<exception>) ...")
116 ("template" summary
"template <class TYPE ...> TYPE_OR_FUNCTION")
117 ("delete" summary
"delete <object>;")
118 ("new" summary
"new <classname>();")
119 ("using" summary
"using <namespace>;")
120 ("namespace" summary
"Namespace Declaration: namespace <name> { ... };")
121 ("typename" summary
"typename is used to handle a qualified name as a typename;")
122 ("class" summary
"Class Declaration: class <name>[:parents] { ... };")
123 ("typedef" summary
"Arbitrary Type Declaration: typedef <typedeclaration> <name>;")
124 ("enum" summary
"Enumeration Type Declaration: enum [name] { ... };")
125 ("union" summary
"Union Type Declaration: union [name] { ... };")
126 ("struct" summary
"Structure Type Declaration: struct [name] { ... };")
127 ("mutable" summary
"Member Declaration Modifier: mutable <type> <name> ...")
128 ("virtual" summary
"Method Modifier: virtual <type> <name>(...) ...")
129 ("inline" summary
"Function Modifier: inline <return type> <name>(...) {...};")
130 ("unsigned" summary
"Numeric Type Modifier: unsigned <numeric type> <name> ...")
131 ("signed" summary
"Numeric Type Modifier: signed <numeric type> <name> ...")
132 ("register" summary
"Declaration Modifier: register <type> <name> ...")
133 ("volatile" summary
"Declaration Modifier: volatile <type> <name> ...")
134 ("const" summary
"Declaration Modifier: const <type> <name> ...")
135 ("static" summary
"Declaration Modifier: static <type> <name> ...")
136 ("extern" summary
"Declaration Modifier: extern <type> <name> ...")))
137 "Table of language keywords.")
139 (defconst semantic-c-by--token-table
140 (semantic-lex-make-type-table
142 (BRACKETS .
"\\[\\]")
144 (VOID_BLCK .
"^(void)$")
147 (BRACK_BLCK .
"\\[.*\\]$"))
155 (RESTRICT .
"\\<\\(__\\)?restrict\\>"))
159 (CPP .
"\"C\\+\\+\"")
165 (TILDE .
"\\`[~]\\'")
167 (GREATER .
"\\`[>]\\'")
169 (EQUAL .
"\\`[=]\\'")
171 (MINUS .
"\\`[-]\\'")
173 (DIVIDE .
"\\`[/]\\'")
174 (AMPERSAND .
"\\`[&]\\'")
176 (SEMICOLON .
"\\`[;]\\'")
177 (COLON .
"\\`[:]\\'")
178 (PERIOD .
"\\`[.]\\'")
179 (HASH .
"\\`[#]\\'")))
181 "Table of lexical tokens.")
183 (defconst semantic-c-by--parse-table
187 ) ;; end bovine-toplevel
191 ) ;; end bovine-inner-scope
205 (codeblock-var-or-fun)
220 ) ;; end extern-c-contents
231 (semantic-parse-region
247 (semantic-parse-region
272 (semantic-tag-new-variable
273 (nth 0 vals
) nil nil
:constant-flag t
))
277 (semantic-tag-new-include
282 (semantic-tag-new-include
290 (semantic-tag-new-variable
291 (nth 0 vals
) nil nil
:constant-flag t
))
302 (semantic-parse-region
361 ) ;; end classsubparts
367 opt-template-specifier
375 ) ;; end opt-class-parents
378 (opt-class-protection
382 (semantic-tag-new-type
385 "class" nil nil
:protection
393 (semantic-tag-new-type
396 "class" nil nil
:protection
400 ) ;; end one-class-parent
417 ) ;; end class-parents
427 ) ;; end opt-class-declmods
431 ) ;; end class-declmods
437 ) ;; end class-protection
439 (opt-class-protection
449 ) ;; end opt-class-protection
454 (semantic-parse-region
462 ) ;; end namespaceparts
491 ) ;; end namespacesubparts
496 (semantic-parse-region
510 (semantic-tag-new-variable
514 (nth 1 vals
)) :constant-flag t
))
531 ) ;; end enumsubparts
546 opt-template-specifier
550 (semantic-tag-new-type
557 (semantic-c-classname
563 (semantic-parse-region
570 (nth 4 vals
) :template-specifier
578 opt-template-specifier
581 (semantic-tag-new-type
586 (nth 4 vals
) :template-specifier
587 (nth 3 vals
) :prototype t
:parent
596 (semantic-tag-new-type
600 (nth 3 vals
) nil
:parent
609 (semantic-tag-new-type
613 (nth 3 vals
) nil
:parent
623 (semantic-tag-new-type
646 ) ;; end typedef-symbol-list
663 ) ;; end struct-or-class
676 (semantic-tag-new-type
684 (semantic-tag-new-type
697 (semantic-tag-new-type
701 (semantic-tag-new-type
704 (nth 0 vals
) nil nil
)) nil
:kind
726 (semantic-tag-new-type
729 "class" nil nil
:prototype t
))
734 (semantic-tag-new-type
737 "namespace" nil nil
:prototype t
))
747 (semantic-c-reconstitute-template
759 (opt-template-specifier
767 ) ;; end opt-template-specifier
772 template-specifier-types
778 ) ;; end template-specifier
780 (template-specifier-types
782 template-specifier-type-list
790 ) ;; end template-specifier-types
792 (template-specifier-type-list
795 template-specifier-types
802 ) ;; end template-specifier-type-list
841 ) ;; end template-var
849 template-specifier-types
866 ) ;; end opt-template-equal
872 (semantic-tag-new-type
879 (semantic-tag-new-type
886 (semantic-tag-new-type
897 (semantic-tag-new-type
899 (nth 1 vals
)) nil nil nil
:constant-flag
905 (nth 2 vals
))) t nil
) :typemodifiers
910 (nth 2 vals
))) :reference
912 (nth 4 vals
)) :pointer
916 ) ;; end template-type
927 ) ;; end template-definition
1002 ) ;; end metadeclmod
1025 ) ;; end cv-declmods
1030 ) ;; end METADECLMOD
1054 (semantic-tag-new-type
1056 (nth 0 vals
) nil nil
))
1061 (semantic-tag-new-type
1063 (nth 0 vals
) nil nil
))
1068 (semantic-tag-new-type
1070 (nth 0 vals
) nil nil
))
1079 (semantic-tag-new-type
1081 "class" nil nil
:template-specifier
1084 (namespace-symbol-for-typeformbase
1085 opt-template-specifier
1087 (semantic-tag-new-type
1090 "class" nil nil
:template-specifier
1098 ) ;; end typeformbase
1151 ) ;; end builtintype-types
1177 ) ;; end builtintype
1179 (codeblock-var-or-fun
1186 (semantic-c-reconstitute-token
1191 ) ;; end codeblock-var-or-fun
1194 (codeblock-var-or-fun
1201 (semantic-c-reconstitute-token
1216 ) ;; end var-or-func-decl
1223 opt-template-specifier
1226 opt-post-fcn-modifiers
1249 opt-template-specifier
1251 opt-post-fcn-modifiers
1293 ) ;; end opt-under-p
1308 ) ;; end opt-initializers
1310 (opt-post-fcn-modifiers
1312 opt-post-fcn-modifiers
1322 ) ;; end opt-post-fcn-modifiers
1327 ) ;; end post-fcn-modifiers
1332 ,(lambda (vals start end
)
1333 (semantic-bovinate-from-nonterminal
1338 'throw-exception-list
))
1344 (throw-exception-list
1348 throw-exception-list
1370 throw-exception-list
1378 ) ;; end throw-exception-list
1427 "\\<\\(__\\)?restrict\\>")
1430 ) ;; end opt-restrict
1451 variablearg-opt-name
1453 (semantic-tag-new-variable
1456 (nth 1 vals
) nil
:constant-flag
1462 (nth 2 vals
))) t nil
) :typemodifiers
1467 (nth 2 vals
))) :reference
1471 ) ;; end variablearg
1473 (variablearg-opt-name
1485 ) ;; end variablearg-opt-name
1487 (varname-opt-initializer
1492 ) ;; end varname-opt-initializer
1497 varname-opt-initializer
1508 varname-opt-initializer
1513 ) ;; end varnamelist
1517 opt-template-specifier
1532 opt-template-specifier
1537 ) ;; end namespace-symbol
1539 (namespace-symbol-for-typeformbase
1541 opt-template-specifier
1546 namespace-symbol-for-typeformbase
1560 ) ;; end namespace-symbol-for-typeformbase
1562 (namespace-opt-class
1578 opt-template-specifier
1587 ) ;; end namespace-opt-class
1590 (namespace-opt-class
1610 ) ;; end opt-destructor
1622 (semantic-parse-region
1651 ) ;; end knr-varnamelist
1653 (knr-one-variable-decl
1659 (semantic-tag-new-variable
1662 (nth 1 vals
) nil
:constant-flag
1667 (nth 2 vals
))) t nil
) :typemodifiers
1672 ) ;; end knr-one-variable-decl
1675 (knr-one-variable-decl
1681 (semantic-expand-c-tag
1685 (knr-one-variable-decl
1689 (semantic-expand-c-tag
1692 ) ;; end knr-arguments
1708 (semantic-tag-new-variable
1727 ) ;; end arg-sub-list
1952 ) ;; end operatorsym
1961 ,(lambda (vals start end
)
1962 (semantic-bovinate-from-nonterminal
1974 ) ;; end functionname
1990 ) ;; end function-pointer
2009 (list ':pure-virtual-flag
))
2015 ) ;; end fun-or-proto-end
2022 fun-try-several-catches
2026 ) ;; end fun-try-end
2028 (fun-try-several-catches
2034 fun-try-several-catches
2040 fun-try-several-catches
2046 ) ;; end fun-try-several-catches
2050 ,(lambda (vals start end
)
2051 (semantic-bovinate-from-nonterminal
2064 ) ;; end type-cast-list
2066 (opt-stuff-after-symbol
2073 ) ;; end opt-stuff-after-symbol
2075 (multi-stage-dereference
2077 opt-stuff-after-symbol
2080 multi-stage-dereference
)
2082 opt-stuff-after-symbol
2087 multi-stage-dereference
)
2089 opt-stuff-after-symbol
)
2090 ) ;; end multi-stage-dereference
2162 (multi-stage-dereference)
2164 multi-stage-dereference
)
2177 ) ;; end unaryexpression
2181 (defun semantic-c-by--install-parser ()
2182 "Setup the Semantic Parser."
2183 (setq semantic--parse-table semantic-c-by--parse-table
2184 semantic-debug-parser-source
"c.by"
2185 semantic-debug-parser-class
'semantic-bovine-debug-parser
2186 semantic-flex-keywords-obarray semantic-c-by--keyword-table
2187 semantic-equivalent-major-modes
'(c-mode c
++-mode
)
2193 (provide 'semantic
/bovine
/c-by
)
2195 ;;; semantic/bovine/c-by.el ends here