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 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
1249 opt-template-specifier
1251 opt-post-fcn-modifiers
1291 ) ;; end opt-under-p
1306 ) ;; end opt-initializers
1308 (opt-post-fcn-modifiers
1310 opt-post-fcn-modifiers
1320 ) ;; end opt-post-fcn-modifiers
1325 ) ;; end post-fcn-modifiers
1330 ,(lambda (vals start end
)
1331 (semantic-bovinate-from-nonterminal
1336 'throw-exception-list
))
1342 (throw-exception-list
1346 throw-exception-list
1368 throw-exception-list
1376 ) ;; end throw-exception-list
1425 "\\<\\(__\\)?restrict\\>")
1428 ) ;; 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
1504 ) ;; end varnamelist
1508 opt-template-specifier
1523 opt-template-specifier
1528 ) ;; end namespace-symbol
1530 (namespace-symbol-for-typeformbase
1532 opt-template-specifier
1537 namespace-symbol-for-typeformbase
1551 ) ;; end namespace-symbol-for-typeformbase
1553 (namespace-opt-class
1569 opt-template-specifier
1578 ) ;; end namespace-opt-class
1581 (namespace-opt-class
1601 ) ;; end opt-destructor
1613 (semantic-parse-region
1642 ) ;; end knr-varnamelist
1644 (knr-one-variable-decl
1650 (semantic-tag-new-variable
1653 (nth 1 vals
) nil
:constant-flag
1658 (nth 2 vals
))) t nil
) :typemodifiers
1663 ) ;; end knr-one-variable-decl
1666 (knr-one-variable-decl
1672 (semantic-expand-c-tag
1676 (knr-one-variable-decl
1680 (semantic-expand-c-tag
1683 ) ;; end knr-arguments
1699 (semantic-tag-new-variable
1718 ) ;; end arg-sub-list
1943 ) ;; end operatorsym
1952 ,(lambda (vals start end
)
1953 (semantic-bovinate-from-nonterminal
1965 ) ;; end functionname
1981 ) ;; end function-pointer
2000 (list ':pure-virtual-flag
))
2006 ) ;; end fun-or-proto-end
2013 fun-try-several-catches
2017 ) ;; end fun-try-end
2019 (fun-try-several-catches
2025 fun-try-several-catches
2031 fun-try-several-catches
2037 ) ;; end fun-try-several-catches
2041 ,(lambda (vals start end
)
2042 (semantic-bovinate-from-nonterminal
2055 ) ;; end type-cast-list
2057 (opt-stuff-after-symbol
2064 ) ;; end opt-stuff-after-symbol
2066 (multi-stage-dereference
2068 opt-stuff-after-symbol
2071 multi-stage-dereference
)
2073 opt-stuff-after-symbol
2078 multi-stage-dereference
)
2080 opt-stuff-after-symbol
)
2081 ) ;; end multi-stage-dereference
2118 (multi-stage-dereference
2125 multi-stage-dereference
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 ;; arch-tag: 27da9f71-d2ef-473f-92a7-b0006b1a8491
2197 ;;; semantic/bovine/c-by.el ends here