1 ;;; semantic-c-by.el --- Generated parser support file
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Eric M. Ludlam
5 ;; Author: Eric M. Ludlam <zappo@projectile.siege-engine.com>
6 ;; Created: 2007-06-05 21:47:07-0400
8 ;; X-RCS: $Id: semantic-c-by.el,v 1.1 2007-11-26 15:11:54 michaels Exp $
10 ;; This file is not part of GNU Emacs.
12 ;; This program is free software; you can redistribute it and/or
13 ;; modify it under the terms of the GNU General Public License as
14 ;; published by the Free Software Foundation; either version 2, or (at
15 ;; your option) any later version.
17 ;; This software is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
29 ;; PLEASE DO NOT MANUALLY EDIT THIS FILE! It is automatically
30 ;; generated from the grammar file c.by.
42 (defconst semantic-c-by--keyword-table
43 (semantic-lex-make-keyword-table
44 '(("include" . INCLUDE)
48 ("volatile" . VOLATILE)
49 ("register" . REGISTER)
51 ("unsigned" . UNSIGNED)
60 ("typename" . TYPENAME)
61 ("namespace" . NAMESPACE)
63 ("template" . TEMPLATE)
65 ("reentrant" . REENTRANT)
68 ("operator" . OPERATOR)
71 ("protected" . PROTECTED)
83 ("continue" . CONTINUE)
96 ("__attribute__" . __ATTRIBUTE__))
97 '(("__attribute__" summary "<cdecl> __attribute__ ((<attributeoption>))")
98 ("__P" summary "Common macro to eliminate prototype compatibility on some compilers")
99 ("_P" summary "Common macro to eliminate prototype compatibility on some compilers")
100 ("bool" summary "Primitive boolean type")
101 ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
102 ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
103 ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
104 ("int" summary "Integral Primitive Type: (-2147483648 to 2147483647)")
105 ("short" summary "Integral Primitive Type: (-32768 to 32767)")
106 ("wchar_t" summary "Wide Character Type")
107 ("char" summary "Integral Character Type: (0 to 256)")
108 ("void" summary "Built in typeless type: void")
109 ("sizeof" summary "Compile time macro: sizeof(<type or variable>) // size in bytes")
110 ("continue" summary "Non-local continue within a loop (for, do/while): continue;")
111 ("break" summary "Non-local exit within a loop or switch (for, do/while, switch): break;")
112 ("return" summary "return <value>;")
113 ("default" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
114 ("case" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
115 ("switch" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
116 ("for" summary "for(<init>; <condition>; <increment>) { code }")
117 ("while" summary "do { code } while (<condition>); or while (<condition>) { code };")
118 ("do" summary " do { code } while (<condition>);")
119 ("else" summary "if (<condition>) { code } [ else { code } ]")
120 ("if" summary "if (<condition>) { code } [ else { code } ]")
121 ("catch" summary "try { <body> } catch { <catch code> }")
122 ("try" summary "try { <body> } catch { <catch code> }")
123 ("reentrant" summary "<type> <methoddef> (<method args>) reentrant ...")
124 ("throw" summary "<type> <methoddef> (<method args>) throw (<exception>) ...")
125 ("template" summary "template <class TYPE ...> TYPE_OR_FUNCTION")
126 ("using" summary "using <namespace>;")
127 ("namespace" summary "Namespace Declaration: namespace <name> { ... };")
128 ("typename" summary "typename is used to handle a qualified name as a typename;")
129 ("class" summary "Class Declaration: class <name>[:parents] { ... };")
130 ("typedef" summary "Arbitrary Type Declaration: typedef <typedeclaration> <name>;")
131 ("enum" summary "Enumeration Type Declaration: enum [name] { ... };")
132 ("union" summary "Union Type Declaration: union [name] { ... };")
133 ("struct" summary "Structure Type Declaration: struct [name] { ... };")
134 ("mutable" summary "Member Declaration Modifier: mutable <type> <name> ...")
135 ("virtual" summary "Method Modifier: virtual <type> <name>(...) ...")
136 ("inline" summary "Function Modifier: inline <return type> <name>(...) {...};")
137 ("unsigned" summary "Numeric Type Modifier: unsigned <numeric type> <name> ...")
138 ("signed" summary "Numeric Type Modifier: signed <numeric type> <name> ...")
139 ("register" summary "Declaration Modifier: register <type> <name> ...")
140 ("volatile" summary "Declaration Modifier: volatile <type> <name> ...")
141 ("const" summary "Declaration Modifier: const <type> <name> ...")
142 ("static" summary "Declaration Modifier: static <type> <name> ...")
143 ("extern" summary "Declaration Modifier: extern <type> <name> ...")))
144 "Table of language keywords.")
146 (defconst semantic-c-by--token-table
147 (semantic-lex-make-type-table
149 (BRACKETS . "\\[\\]")
151 (VOID_BLCK . "^(void)$")
154 (BRACK_BLCK . "\\[.*\\]$"))
162 (RESTRICT . "\\<\\(__\\)?restrict\\>"))
168 (OPSTART . "[-+*/%^|&]")
172 (TILDE . "\\`[~]\\'")
174 (GREATER . "\\`[>]\\'")
176 (EQUAL . "\\`[=]\\'")
178 (MINUS . "\\`[-]\\'")
180 (DIVIDE . "\\`[/]\\'")
181 (AMPERSAND . "\\`[&]\\'")
183 (SEMICOLON . "\\`[;]\\'")
184 (COLON . "\\`[:]\\'")
185 (PERIOD . "\\`[.]\\'")
186 (HASH . "\\`[#]\\'")))
188 "Table of lexical tokens.")
190 (defconst semantic-c-by--parse-table
194 ) ;; end bovine-toplevel
198 ) ;; end bovine-inner-scope
212 (codeblock-var-or-fun)
226 ) ;; end extern-c-contents
237 (semantic-parse-region
253 (macro-expression-list
255 macro-expression-list
265 ) ;; end macro-expression-list
268 (macro-expression-list
285 (semantic-tag-new-variable
287 (nth 2 vals) :constant-flag t))
301 (semantic-tag-new-include
312 (semantic-tag-new-include
316 ) ;; end macro-or-include
325 ) ;; end opt-define-arglist
332 (semantic-tag-new-variable
334 (nth 2 vals) :constant-flag t))
345 (semantic-parse-region
388 ) ;; end classsubparts
394 opt-template-specifier
402 ) ;; end opt-class-parents
405 (opt-class-protection
416 (opt-class-protection
422 ) ;; end class-parents
432 ) ;; end opt-class-declmods
436 ) ;; end class-declmods
442 ) ;; end class-protection
444 (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
551 ) ;; end opt-class-declmods
557 opt-template-specifier
561 (semantic-tag-new-type
568 (semantic-c-classname
574 (semantic-parse-region
581 (nth 4 vals) :template-specifier
589 opt-template-specifier
592 (semantic-tag-new-type
597 (nth 4 vals) :template-specifier
598 (nth 3 vals) :prototype t :parent
607 (semantic-tag-new-type
611 (nth 3 vals) nil :parent
620 (semantic-tag-new-type
624 (nth 3 vals) nil :parent
634 (semantic-tag-new-type
657 ) ;; end typedef-symbol-list
674 ) ;; end struct-or-class
688 (semantic-tag-new-type
696 (semantic-tag-new-type
713 ) ;; end opt-attribute
739 (semantic-c-reconstitute-template
751 (opt-template-specifier
759 ) ;; end opt-template-specifier
764 template-specifier-types
770 ) ;; end template-specifier
772 (template-specifier-types
774 template-specifier-type-list
782 ) ;; end template-specifier-types
784 (template-specifier-type-list
787 template-specifier-types
794 ) ;; end template-specifier-type-list
822 ) ;; end template-var
830 template-specifier-types
847 ) ;; end opt-template-equal
853 (semantic-tag-new-type
860 (semantic-tag-new-type
867 (semantic-tag-new-type
878 (semantic-tag-new-type
880 (nth 1 vals)) nil nil nil :constant-flag
886 (nth 2 vals))) t nil) :typemodifiers
891 (nth 2 vals))) :reference
893 (nth 4 vals)) :pointer
897 ) ;; end template-type
908 ) ;; end template-definition
1006 ) ;; end cv-declmods
1011 ) ;; end METADECLMOD
1035 (semantic-tag-new-type
1037 (nth 0 vals) nil nil))
1042 (semantic-tag-new-type
1044 (nth 0 vals) nil nil))
1049 (semantic-tag-new-type
1051 (nth 0 vals) nil nil))
1059 (semantic-tag-new-type
1069 ) ;; end typeformbase
1122 ) ;; end builtintype-types
1148 ) ;; end builtintype
1150 (codeblock-var-or-fun
1157 (semantic-c-reconstitute-token
1162 ) ;; end codeblock-var-or-fun
1165 (codeblock-var-or-fun
1172 (semantic-c-reconstitute-token
1187 ) ;; end var-or-func-decl
1194 opt-template-specifier
1197 opt-post-fcn-modifiers
1217 opt-template-specifier
1219 opt-post-fcn-modifiers
1258 ) ;; end opt-under-p
1273 ) ;; end opt-initializers
1275 (opt-post-fcn-modifiers
1277 opt-post-fcn-modifiers
1287 ) ;; end opt-post-fcn-modifiers
1292 ) ;; end post-fcn-modifiers
1297 ,(lambda (vals start end)
1298 (semantic-bovinate-from-nonterminal
1303 'throw-exception-list))
1309 (throw-exception-list
1313 throw-exception-list
1335 throw-exception-list
1343 ) ;; end throw-exception-list
1392 "\\<\\(__\\)?restrict\\>")
1395 ) ;; end opt-restrict
1418 variablearg-opt-name
1420 (semantic-tag-new-variable
1423 (nth 1 vals) nil :constant-flag
1429 (nth 2 vals))) t nil) :typemodifiers
1434 (nth 2 vals))) :reference
1438 ) ;; end variablearg
1440 (variablearg-opt-name
1452 ) ;; end variablearg-opt-name
1469 ) ;; end varnamelist
1473 opt-template-specifier
1488 opt-template-specifier
1493 ) ;; end namespace-symbol
1495 (namespace-opt-class
1511 opt-template-specifier
1520 ) ;; end namespace-opt-class
1523 (namespace-opt-class
1543 ) ;; end opt-destructor
1555 (semantic-parse-region
1577 (semantic-expand-c-tag
1587 (semantic-expand-c-tag
1590 ) ;; end knr-arguments
1606 (semantic-tag-new-variable
1625 ) ;; end arg-sub-list
1850 ) ;; end operatorsym
1859 ,(lambda (vals start end)
1860 (semantic-bovinate-from-nonterminal
1872 ) ;; end functionname
1888 ) ;; end function-pointer
1908 (list ':pure-virtual-flag))
1914 ) ;; end fun-or-proto-end
1921 fun-try-several-catches
1925 ) ;; end fun-try-end
1927 (fun-try-several-catches
1933 fun-try-several-catches
1939 fun-try-several-catches
1945 ) ;; end fun-try-several-catches
1949 ,(lambda (vals start end)
1950 (semantic-bovinate-from-nonterminal
1963 ) ;; end type-cast-list
1978 ) ;; end function-call
2047 (defun semantic-c-by--install-parser ()
2048 "Setup the Semantic Parser."
2049 (setq semantic--parse-table semantic-c-by--parse-table
2050 semantic-debug-parser-source "c.by"
2051 semantic-debug-parser-class 'semantic-bovine-debug-parser
2052 semantic-flex-keywords-obarray semantic-c-by--keyword-table
2053 semantic-equivalent-major-modes '(c-mode c++-mode)
2059 (require 'semantic-lex)
2065 (provide 'semantic-c-by)
2067 ;;; semantic-c-by.el ends here