Commits

Anonymous committed 515b22d

fixup commit for tag 'sumo-current'

Comments (0)

Files changed (9)

+;;; semantic-c.el --- Semantic details for C
+
+;;; Copyright (C) 1999, 2000, 2001, 2002, 2003 Eric M. Ludlam
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+;; X-RCS: $Id$
+
+;; This file is not part of GNU Emacs.
+
+;; This is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This software is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+;;
+
+;;; History:
+;; 
+
+(require 'semantic)
+(require 'backquote)
+
+(eval-when-compile
+  (require 'semantic-ctxt)
+  (require 'semantic-imenu)
+  (require 'document)
+  (require 'senator)
+  (require 'cc-mode))
+
+;;; Code:
+(defvar semantic-toplevel-c-bovine-table
+`((bovine-toplevel
+ ( macro)
+ ( type)
+ ( define)
+ ( var-or-fun)
+ ( extern-c)
+ ( template)
+ ( using)
+ ) ; end declaration
+ (bovine-inner-scope
+ ( define)
+ ( codeblock-var-or-fun)
+ ( type)
+ ) ; end codeblock
+ (extern-c-contents
+ ( open-paren
+  ,(semantic-lambda
+  (list nil)))
+ ( bovine-toplevel)
+ ( close-paren
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end extern-c-contents
+ (extern-c
+ ( EXTERN string "\"C\"" semantic-list
+  ,(semantic-lambda
+  (list 'extern
+ (semantic-bovinate-from-nonterminal-full (car (nth 2 vals)) (cdr (nth 2 vals)) 'extern-c-contents)
+ )))
+ ( EXTERN string "\"C\""
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end extern-c
+ (macro-expression-list
+ ( expression macro-expression-list punctuation "\\b;\\b"
+  ,(semantic-lambda
+  (list nil)))
+ ( expression
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end macro-expression-list
+ (macro-def
+ ( macro-expression-list
+  ,(semantic-lambda
+  (list nil)))
+ ( expression
+  ,(semantic-lambda
+  (list nil)))
+ ()
+ ) ; end macro-def
+ (macro
+ ( punctuation "\\b#\\b" macro-or-include
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ) ; end macro
+ (macro-or-include
+ ( DEFINE symbol opt-define-arglist macro-def
+  ,(semantic-lambda
+  (list (nth 1 vals) 'variable nil (nth 2 vals) ( semantic-bovinate-make-assoc-list 'const t) nil)))
+ ( INCLUDE system-include
+  ,(semantic-lambda
+  (list ( substring (nth 1 vals) 1 ( 1- ( length (nth 1 vals)))) 'include t nil)))
+ ( INCLUDE string
+  ,(semantic-lambda
+  (list ( read (nth 1 vals)) 'include nil nil)))
+ ) ; end macro-or-include
+ (opt-define-arglist
+ ( semantic-list
+  ,(semantic-lambda
+  (list nil)))
+ ()
+ ) ; end opt-define-arglist
+ (define
+ ( punctuation "\\b#\\b" DEFINE symbol opt-define-arglist macro-def
+  ,(semantic-lambda
+  (list (nth 2 vals) 'variable nil (nth 3 vals) ( semantic-bovinate-make-assoc-list 'const t) nil)))
+ ) ; end define
+ (unionparts
+ ( semantic-list
+  ,(semantic-lambda
+ 
+ (semantic-bovinate-from-nonterminal-full (car (nth 0 vals)) (cdr (nth 0 vals)) 'classsubparts)
+ ))
+ ) ; end unionparts
+ (opt-symbol
+ ( symbol)
+ ()
+ ) ; end opt-symbol
+ (classsubparts
+ ( open-paren "{"
+  ,(semantic-lambda
+  (list nil)))
+ ( close-paren "}"
+  ,(semantic-lambda
+  (list nil)))
+ ( class-protection opt-symbol punctuation "\\b:\\b"
+  ,(semantic-lambda
+  (nth 0 vals) (list 'label)))
+ ( var-or-fun)
+ ( type)
+ ( define
+  ,(semantic-lambda
+  (nth 0 vals) (list 'protection)))
+ ( template)
+ ()
+ ) ; end classsubparts
+ (opt-class-parents
+ ( punctuation "\\b:\\b" class-parents opt-template-specifier
+  ,(semantic-lambda
+  (list (nth 1 vals))))
+ (
+  ,(semantic-lambda
+ ))
+ ) ; end opt-class-parents
+ (class-parents
+ ( opt-class-protection opt-class-declmods namespace-symbol punctuation "\\b,\\b" class-parents
+  ,(semantic-lambda
+  ( cons (nth 2 vals) (nth 4 vals))))
+ ( opt-class-protection opt-class-declmods namespace-symbol
+  ,(semantic-lambda
+  (nth 2 vals)))
+ ) ; end class-parents
+ (opt-class-declmods
+ ( class-declmods opt-class-declmods
+  ,(semantic-lambda
+  (list nil)))
+ ()
+ ) ; end opt-class-declmods
+ (class-declmods
+ ( VIRTUAL)
+ ) ; end class-declmods
+ (class-protection
+ ( PUBLIC)
+ ( PRIVATE)
+ ( PROTECTED)
+ ) ; end class-protection
+ (opt-class-protection
+ ( class-protection
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ()
+ ) ; end opt-class-protection
+ (namespaceparts
+ ( semantic-list
+  ,(semantic-lambda
+ 
+ (semantic-bovinate-from-nonterminal-full (car (nth 0 vals)) (cdr (nth 0 vals)) 'namespacesubparts)
+ ))
+ ) ; end namespaceparts
+ (namespacesubparts
+ ( open-paren "{"
+  ,(semantic-lambda
+  (list nil)))
+ ( close-paren "}"
+  ,(semantic-lambda
+  (list nil)))
+ ( type)
+ ( var-or-fun)
+ ( define)
+ ( class-protection punctuation "\\b:\\b"
+  ,(semantic-lambda
+  (list (nth 0 vals) 'protection)))
+ ( template)
+ ( using)
+ ()
+ ) ; end namespacesubparts
+ (enumparts
+ ( semantic-list
+  ,(semantic-lambda
+ 
+ (semantic-bovinate-from-nonterminal-full (car (nth 0 vals)) (cdr (nth 0 vals)) 'enumsubparts)
+ ))
+ ) ; end enumparts
+ (enumsubparts
+ ( symbol opt-assign
+  ,(semantic-lambda
+  (list (nth 0 vals) 'variable "int") (nth 1 vals) (list ( semantic-bovinate-make-assoc-list 'const t) nil)))
+ ( open-paren "{"
+  ,(semantic-lambda
+  (list nil)))
+ ( close-paren "}"
+  ,(semantic-lambda
+  (list nil)))
+ ( punctuation "\\b,\\b"
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end enumsubparts
+ (opt-name
+ ( symbol)
+ (
+  ,(semantic-lambda
+  (list "")))
+ ) ; end opt-name
+ (opt-class-declmods
+ ( symbol declespec semantic-list)
+ ( symbol)
+ ()
+ ) ; end opt-class-declmods
+ (typesimple
+ ( struct-or-class opt-name opt-template-specifier opt-class-parents semantic-list
+  ,(semantic-lambda
+  (nth 1 vals) (list 'type) (nth 0 vals) (list ( let ( ( semantic-c-classname ( cons ( car (nth 1 vals)) ( car (nth 0 vals)))))
+ (semantic-bovinate-from-nonterminal-full (car (nth 4 vals)) (cdr (nth 4 vals)) 'classsubparts)
+ ) (nth 3 vals) ( semantic-bovinate-make-assoc-list (append 'template-specifier) (nth 2 vals)) nil)))
+ ( struct-or-class opt-name opt-template-specifier opt-class-parents
+  ,(semantic-lambda
+  (nth 1 vals) (list 'type) (nth 0 vals) (list nil (nth 3 vals) ( semantic-bovinate-make-assoc-list (append 'template-specifier) (nth 2 vals)) nil)))
+ ( UNION opt-name unionparts
+  ,(semantic-lambda
+  (nth 1 vals) (list 'type (nth 0 vals) (nth 2 vals) nil nil nil)))
+ ( ENUM opt-name enumparts
+  ,(semantic-lambda
+  (nth 1 vals) (list 'type (nth 0 vals) (nth 2 vals) nil nil nil)))
+ ( TYPEDEF declmods typeformbase cv-declmods typedef-symbol-list
+  ,(semantic-lambda
+  (list (nth 4 vals) 'type (nth 0 vals) nil (nth 2 vals) nil nil)))
+ ) ; end typesimple
+ (typedef-symbol-list
+ ( typedefname punctuation "\\b,\\b" typedef-symbol-list
+  ,(semantic-lambda
+  ( cons (nth 0 vals) (nth 2 vals))))
+ ( typedefname
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end typedef-symbol-list
+ (typedefname
+ ( opt-stars symbol opt-bits opt-array
+  ,(semantic-lambda
+  (list (nth 0 vals) (nth 1 vals))))
+ ) ; end typedefname
+ (struct-or-class
+ ( STRUCT)
+ ( CLASS)
+ ) ; end struct-or-class
+ (type
+ ( typesimple punctuation "\\b;\\b"
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( NAMESPACE symbol namespaceparts
+  ,(semantic-lambda
+  (list (nth 1 vals) 'type (nth 0 vals) (nth 2 vals) nil nil nil)))
+ ( NAMESPACE namespaceparts
+  ,(semantic-lambda
+  (list "unnamed" 'type (nth 0 vals) (nth 1 vals) nil nil nil)))
+ ) ; end type
+ (using
+ ( USING typeformbase punctuation "\\b;\\b"
+  ,(semantic-lambda
+  (list nil)))
+ ( USING NAMESPACE typeformbase punctuation "\\b;\\b"
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end using
+ (template
+ ( TEMPLATE template-specifier opt-friend template-definition
+  ,(semantic-lambda
+  ( semantic-c-reconstitute-template (nth 3 vals) (nth 1 vals))))
+ ) ; end template
+ (opt-friend
+ ( FRIEND)
+ ()
+ ) ; end opt-friend
+ (opt-template-specifier
+ ( template-specifier
+  ,(semantic-lambda
+  (nth 0 vals)))
+ (
+  ,(semantic-lambda
+ ))
+ ) ; end opt-template-specifier
+ (template-specifier
+ ( punctuation "\\b<\\b" template-specifier-types punctuation "\\b>\\b"
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ) ; end template-specifier
+ (template-specifier-types
+ ( template-var template-specifier-type-list
+  ,(semantic-lambda
+  ( cons (nth 0 vals) (nth 1 vals))))
+ ()
+ ) ; end template-specifier-types
+ (template-specifier-type-list
+ ( punctuation "\\b,\\b" template-specifier-types
+  ,(semantic-lambda
+  (nth 1 vals)))
+ (
+  ,(semantic-lambda
+ ))
+ ) ; end template-specifier-type-list
+ (template-var
+ ( template-type opt-template-equal
+  ,(semantic-lambda
+  ( cons ( car (nth 0 vals)) ( cdr (nth 0 vals)))))
+ ( string
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ( number
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ( opt-stars opt-ref namespace-symbol
+  ,(semantic-lambda
+  (nth 2 vals)))
+ ) ; end template-var
+ (opt-template-equal
+ ( punctuation "\\b=\\b" symbol punctuation "\\b<\\b" template-specifier-types punctuation "\\b>\\b"
+  ,(semantic-lambda
+  (list (nth 1 vals))))
+ ()
+ ) ; end opt-template-equal
+ (template-type
+ ( CLASS symbol
+  ,(semantic-lambda
+  (list (nth 1 vals) 'type "class" nil nil)))
+ ( STRUCT symbol
+  ,(semantic-lambda
+  (list (nth 1 vals) 'type "struct" nil nil)))
+ ( TYPENAME symbol
+  ,(semantic-lambda
+  (list (nth 1 vals) 'type "class" nil nil)))
+ ( declmods typeformbase cv-declmods opt-stars opt-ref variablearg-opt-name
+  ,(semantic-lambda
+  (list ( car (nth 1 vals)) 'type nil nil ( semantic-bovinate-make-assoc-list 'const ( if ( member "const" ( append (nth 0 vals) (nth 2 vals))) t nil) 'typemodifiers ( delete "const" ( append (nth 0 vals) (nth 2 vals))) 'reference ( car (nth 4 vals)) 'pointer ( car (nth 3 vals))))))
+ ) ; end template-type
+ (template-definition
+ ( type
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( var-or-fun
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end template-definition
+ (opt-stars
+ ( punctuation "\\b\\*\\b" opt-starmod opt-stars
+  ,(semantic-lambda
+  (list ( 1+ ( car (nth 2 vals))))))
+ (
+  ,(semantic-lambda
+  (list 0)))
+ ) ; end opt-stars
+ (opt-starmod
+ ( STARMOD opt-starmod
+  ,(semantic-lambda
+  ( cons ( car (nth 0 vals)) (nth 1 vals))))
+ (
+  ,(semantic-lambda
+ ))
+ ) ; end opt-starmod
+ (STARMOD
+ ( CONST)
+ ) ; end STARMOD
+ (declmods
+ ( DECLMOD declmods
+  ,(semantic-lambda
+  ( cons ( car (nth 0 vals)) (nth 1 vals))))
+ ( DECLMOD
+  ,(semantic-lambda
+  (nth 0 vals)))
+ (
+  ,(semantic-lambda
+ ))
+ ) ; end declmods
+ (DECLMOD
+ ( EXTERN)
+ ( STATIC)
+ ( CVDECLMOD)
+ ( INLINE)
+ ( REGISTER)
+ ( FRIEND)
+ ( TYPENAME)
+ ( METADECLMOD)
+ ( VIRTUAL)
+ ) ; end DECLMOD
+ (metadeclmod
+ ( METADECLMOD
+  ,(semantic-lambda
+ ))
+ (
+  ,(semantic-lambda
+ ))
+ ) ; end metadeclmod
+ (CVDECLMOD
+ ( CONST)
+ ( VOLATILE)
+ ) ; end CVDECLMOD
+ (cv-declmods
+ ( CVDECLMOD cv-declmods
+  ,(semantic-lambda
+  ( cons ( car (nth 0 vals)) (nth 1 vals))))
+ ( CVDECLMOD
+  ,(semantic-lambda
+  (nth 0 vals)))
+ (
+  ,(semantic-lambda
+ ))
+ ) ; end cv-declmods
+ (METADECLMOD
+ ( VIRTUAL)
+ ( MUTABLE)
+ ) ; end METADECLMOD
+ (opt-ref
+ ( punctuation "\\b&\\b"
+  ,(semantic-lambda
+  (list 1)))
+ (
+  ,(semantic-lambda
+  (list 0)))
+ ) ; end opt-ref
+ (typeformbase
+ ( typesimple
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( STRUCT symbol
+  ,(semantic-lambda
+  (list (nth 1 vals) 'type (nth 0 vals))))
+ ( UNION symbol
+  ,(semantic-lambda
+  (list (nth 1 vals) 'type (nth 0 vals))))
+ ( ENUM symbol
+  ,(semantic-lambda
+  (list (nth 1 vals) 'type (nth 0 vals))))
+ ( builtintype
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( namespace-symbol
+  ,(semantic-lambda
+  (nth 0 vals) (list 'type "class")))
+ ( symbol
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end typeformbase
+ (signedmod
+ ( UNSIGNED)
+ ( SIGNED)
+ ) ; end signedmod
+ (builtintype-types
+ ( VOID)
+ ( CHAR)
+ ( WCHAR)
+ ( SHORT)
+ ( INT)
+ ( LONG INT
+  ,(semantic-lambda
+  (list ( concat (nth 0 vals) " " (nth 1 vals)))))
+ ( FLOAT)
+ ( DOUBLE)
+ ( LONG DOUBLE
+  ,(semantic-lambda
+  (list ( concat (nth 0 vals) " " (nth 1 vals)))))
+ ( LONG LONG
+  ,(semantic-lambda
+  (list ( concat (nth 0 vals) " " (nth 1 vals)))))
+ ( LONG)
+ ) ; end builtintype-types
+ (builtintype
+ ( signedmod builtintype-types
+  ,(semantic-lambda
+  (list ( concat ( car (nth 0 vals)) " " ( car (nth 1 vals))))))
+ ( builtintype-types
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( signedmod
+  ,(semantic-lambda
+  (list ( concat ( car (nth 0 vals)) " int"))))
+ ) ; end builtintype
+ (codeblock-var-or-fun
+ ( declmods typeformbase declmods opt-ref var-or-func-decl
+  ,(semantic-lambda
+  ( semantic-c-reconstitute-token (nth 4 vals) (nth 0 vals) (nth 1 vals))))
+ ) ; end codeblock-var-or-fun
+ (var-or-fun
+ ( codeblock-var-or-fun
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( declmods var-or-func-decl
+  ,(semantic-lambda
+  ( semantic-c-reconstitute-token (nth 1 vals) (nth 0 vals) nil)))
+ ) ; end var-or-fun
+ (var-or-func-decl
+ ( func-decl
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( var-decl
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end var-or-func-decl
+ (func-decl
+ ( opt-stars opt-class opt-destructor functionname opt-template-specifier opt-under-p arg-list opt-post-fcn-modifiers opt-throw opt-initializers fun-or-proto-end
+  ,(semantic-lambda
+  (nth 3 vals) (list 'function (nth 1 vals) (nth 2 vals) (nth 6 vals) (nth 8 vals) (nth 7 vals)) (nth 0 vals) (nth 10 vals)))
+ ) ; end func-decl
+ (var-decl
+ ( varnamelist punctuation "\\b;\\b"
+  ,(semantic-lambda
+  (list (nth 0 vals) 'variable)))
+ ) ; end var-decl
+ (opt-under-p
+ ( UNDERP
+  ,(semantic-lambda
+  (list nil)))
+ ( UNDERUNDERP
+  ,(semantic-lambda
+  (list nil)))
+ ()
+ ) ; end opt-under-p
+ (opt-initializers
+ ( punctuation "\\b:\\b" namespace-symbol semantic-list opt-initializers)
+ ( punctuation "\\b,\\b" namespace-symbol semantic-list opt-initializers)
+ ()
+ ) ; end opt-initializers
+ (opt-post-fcn-modifiers
+ ( post-fcn-modifiers opt-post-fcn-modifiers
+  ,(semantic-lambda
+  ( cons (nth 0 vals) (nth 1 vals))))
+ (
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end opt-post-fcn-modifiers
+ (post-fcn-modifiers
+ ( REENTRANT)
+ ( CONST)
+ ) ; end post-fcn-modifiers
+ (opt-throw
+ ( THROW semantic-list
+ ,(lambda (vals start end)
+ 
+ (semantic-bovinate-from-nonterminal (car (nth 1 vals)) (cdr (nth 1 vals)) 'throw-exception-list)
+ ))
+ ()
+ ) ; end opt-throw
+ (throw-exception-list
+ ( namespace-symbol punctuation "\\b,\\b" throw-exception-list
+  ,(semantic-lambda
+  ( cons ( car (nth 0 vals)) (nth 2 vals))))
+ ( namespace-symbol close-paren ")"
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( open-paren "(" throw-exception-list
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ( close-paren ")"
+  ,(semantic-lambda
+ ))
+ ) ; end throw-exception-list
+ (opt-bits
+ ( punctuation "\\b:\\b" number
+  ,(semantic-lambda
+  (list (nth 1 vals))))
+ (
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end opt-bits
+ (opt-array
+ ( semantic-list "\\[.*\\]$" opt-array
+  ,(semantic-lambda
+  (list ( cons 1 ( car (nth 1 vals))))))
+ (
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end opt-array
+ (opt-assign
+ ( punctuation "\\b=\\b" expression
+  ,(semantic-lambda
+  (list (nth 1 vals))))
+ (
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end opt-assign
+ (opt-restrict
+ ( symbol "\\<\\(__\\)?restrict\\>")
+ ()
+ ) ; end opt-restrict
+ (varname
+ ( opt-stars opt-restrict namespace-symbol opt-bits opt-array opt-assign
+  ,(semantic-lambda
+  (nth 2 vals) (nth 0 vals) (nth 3 vals) (nth 4 vals) (nth 5 vals)))
+ ) ; end varname
+ (variablearg
+ ( declmods typeformbase cv-declmods opt-ref variablearg-opt-name
+  ,(semantic-lambda
+  (list ( list (nth 4 vals)) 'variable (nth 1 vals) nil ( semantic-bovinate-make-assoc-list 'const ( if ( member "const" ( append (nth 0 vals) (nth 2 vals))) t nil) 'typemodifiers ( delete "const" ( append (nth 0 vals) (nth 2 vals))) 'reference ( car (nth 3 vals))) nil)))
+ ) ; end variablearg
+ (variablearg-opt-name
+ ( varname
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( opt-stars
+  ,(semantic-lambda
+  (list "") (nth 0 vals) (list nil nil nil)))
+ ) ; end variablearg-opt-name
+ (varnamelist
+ ( varname punctuation "\\b,\\b" varnamelist
+  ,(semantic-lambda
+  ( cons (nth 0 vals) (nth 2 vals))))
+ ( varname
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end varnamelist
+ (namespace-symbol
+ ( symbol opt-template-specifier punctuation "\\b:\\b" punctuation "\\b:\\b" namespace-symbol
+  ,(semantic-lambda
+  (list ( concat (nth 0 vals) "::" ( car (nth 4 vals))))))
+ ( symbol opt-template-specifier
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end namespace-symbol
+ (namespace-opt-class
+ ( symbol punctuation "\\b:\\b" punctuation "\\b:\\b" namespace-opt-class
+  ,(semantic-lambda
+  (list ( concat (nth 0 vals) "::" ( car (nth 3 vals))))))
+ ( symbol opt-template-specifier punctuation "\\b:\\b" punctuation "\\b:\\b"
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end namespace-opt-class
+ (opt-class
+ ( namespace-opt-class
+  ,(semantic-lambda
+  (nth 0 vals)))
+ (
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end opt-class
+ (opt-destructor
+ ( punctuation "\\b~\\b"
+  ,(semantic-lambda
+  (list t)))
+ (
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end opt-destructor
+ (arg-list
+ ( semantic-list "^(" knr-arguments
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ( semantic-list "^("
+  ,(semantic-lambda
+ 
+ (semantic-bovinate-from-nonterminal-full (car (nth 0 vals)) (cdr (nth 0 vals)) 'arg-sub-list)
+ ))
+ ( semantic-list "^(void)$"
+  ,(semantic-lambda
+ ))
+ ) ; end arg-list
+ (knr-arguments
+ ( variablearg punctuation "\\b;\\b" knr-arguments
+  ,(semantic-lambda
+  ( cons ( car ( semantic-expand-c-nonterminal (nth 0 vals))) (nth 2 vals))))
+ ( variablearg punctuation "\\b;\\b"
+  ,(semantic-lambda
+  (list ( car ( semantic-expand-c-nonterminal (nth 0 vals))))))
+ ) ; end knr-arguments
+ (arg-sub-list
+ ( variablearg
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( punctuation "\\b\\.\\b" punctuation "\\b\\.\\b" punctuation "\\b\\.\\b" close-paren ")"
+  ,(semantic-lambda
+  (list "...")))
+ ( punctuation "\\b,\\b"
+  ,(semantic-lambda
+  (list nil)))
+ ( open-paren "("
+  ,(semantic-lambda
+  (list nil)))
+ ( close-paren ")"
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end arg-sub-list
+ (operatorsym
+ ( punctuation "\\b<\\b" punctuation "\\b<\\b"
+  ,(semantic-lambda
+  (list "<<")))
+ ( punctuation "\\b>\\b" punctuation "\\b>\\b"
+  ,(semantic-lambda
+  (list ">>")))
+ ( punctuation "\\b=\\b" punctuation "\\b=\\b"
+  ,(semantic-lambda
+  (list "==")))
+ ( punctuation "\\b<\\b" punctuation "\\b=\\b"
+  ,(semantic-lambda
+  (list "<=")))
+ ( punctuation "\\b>\\b" punctuation "\\b=\\b"
+  ,(semantic-lambda
+  (list ">=")))
+ ( punctuation "\\b!\\b" punctuation "\\b=\\b"
+  ,(semantic-lambda
+  (list "!=")))
+ ( punctuation "\\b-\\b" punctuation "\\b>\\b"
+  ,(semantic-lambda
+  (list "->")))
+ ( semantic-list "()"
+  ,(semantic-lambda
+  (list "()")))
+ ( semantic-list "\\[\\]"
+  ,(semantic-lambda
+  (list "[]")))
+ ( punctuation "\\b<\\b")
+ ( punctuation "\\b>\\b")
+ ( punctuation "\\b\\*\\b")
+ ( punctuation "\\b\\+\\b")
+ ( punctuation "\\b-\\b")
+ ( punctuation "\\b/\\b")
+ ( punctuation "\\b=\\b")
+ ( punctuation "\\b!\\b")
+ ) ; end operatorsym
+ (functionname
+ ( OPERATOR operatorsym
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ( symbol
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end functionname
+ (fun-or-proto-end
+ ( punctuation "\\b;\\b"
+  ,(semantic-lambda
+  (list t)))
+ ( semantic-list
+  ,(semantic-lambda
+  (list nil)))
+ ( punctuation "\\b=\\b" number "^0$" punctuation "\\b;\\b"
+  ,(semantic-lambda
+  (list 'pure-virtual)))
+ ) ; end fun-or-proto-end
+ (type-cast
+ ( semantic-list
+ ,(lambda (vals start end)
+ 
+ (semantic-bovinate-from-nonterminal (car (nth 0 vals)) (cdr (nth 0 vals)) 'type-cast-list)
+ ))
+ ) ; end type-cast
+ (type-cast-list
+ ( open-paren typeformbase close-paren)
+ ) ; end type-cast-list
+ (function-call
+ ( namespace-symbol semantic-list)
+ ) ; end function-call
+ (string-seq
+ ( string string-seq
+  ,(semantic-lambda
+  (list ( concat (nth 0 vals) ( car (nth 1 vals))))))
+ ( string
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end string-seq
+ (expression
+ ( number
+  ,(semantic-lambda
+  (list ( identity start) ( identity end))))
+ ( function-call
+  ,(semantic-lambda
+  (list ( identity start) ( identity end))))
+ ( namespace-symbol
+  ,(semantic-lambda
+  (list ( identity start) ( identity end))))
+ ( string-seq
+  ,(semantic-lambda
+  (list ( identity start) ( identity end))))
+ ( type-cast expression
+  ,(semantic-lambda
+  (list ( identity start) ( identity end))))
+ ( semantic-list
+  ,(semantic-lambda
+  (list ( identity start) ( identity end))))
+ ( punctuation "[-+*/%^|&]" expression
+  ,(semantic-lambda
+  (list ( identity start) ( identity end))))
+ ) ; end expression
+ )
+ "C language specification.")
+
+(defvar semantic-flex-c-extensions
+  '(("^\\s-*#if\\s-*0$" . semantic-flex-c-if-0)
+    ("^#\\(if\\(def\\)?\\|el\\(if\\|se\\)\\|endif\\)" . semantic-flex-c-if)
+    ("<[^\n>]+>" . semantic-flex-c-include-system)
+    ("\\(\\\\\n\\)" . semantic-flex-backslash-newline)
+    ("L\\s\"" . semantic-flex-wide-char-literal)
+    )
+  "Extensions to the flexer for C and C++.")
+
+(defun semantic-flex-wide-char-literal ()
+  "Identify wide-char string- and char-literals like L\"string\" and L'c'
+and return them as string-token."
+  (let ((start (point)))
+    (forward-char 1)
+    ;; now we should be onto the string-delimiter direct after the L
+    (forward-sexp 1)
+    (cons 'string (cons start (point)))))
+
+(defun semantic-flex-backslash-newline ()
+  "If there is a \ ending a line, then it isn't really a newline. Move cursor
+direct after the \"backslashed\"-newline and return nothing."
+  (goto-char (match-end 1))
+  nil)
+
+(defun semantic-flex-c-include-system ()
+  "Move cursor to the end of system includes and return it.
+Identifies the system include by looking backwards."
+  (if (and (save-excursion
+	     (beginning-of-line)
+	     (looking-at "#\\s-*include\\s-+<"))
+	   (= (match-end 0) (1+ (point))))
+      ;; We found a system include.
+      (let ((start (point)))
+	;; This should always pass
+	(re-search-forward ">")
+	;; We have the whole thing.
+	(cons 'system-include (cons start (point)))
+	)
+    ;; No system include, do nothing but return what the real
+    ;; parser would have returned.
+    (forward-char 1)
+    (cons 'punctuation (cons (1- (point)) (point)))
+    ))
+
+(defun semantic-flex-c-if-0 ()
+  "Move cursor to the matching endif, and return nothing."
+  (beginning-of-line)
+  (c-forward-conditional 1)
+  nil)
+
+(defun semantic-flex-c-if ()
+  "Move the cursor and return nil when a #if is found."
+  ;; Future enhancement: Enable only the then or else clause depending on
+  ;; some mysterious knowledge.
+  (if (bolp) (end-of-line))
+  nil)
+
+(defun semantic-expand-c-nonterminal (nonterm)
+  "Expand NONTERM into a list of equivalent nonterminals, or nil."
+  (cond ((eq (car nonterm) 'extern)
+	 ;; We have hit an exter "C" command with a list after it.
+	 (car (cdr nonterm))
+	 )
+	((listp (car nonterm))
+	 (cond ((eq (semantic-token-token nonterm) 'variable)
+		;; The name part comes back in the form of:
+		;; ( NAME NUMSTARS BITS ARRAY ASSIGN )
+		(let ((vl nil)
+		      (basety (semantic-token-type nonterm))
+		      (ty "")
+		      (mods (semantic-token-variable-extra-spec nonterm 'typemodifiers))
+		      (suffix "")
+		      (lst (semantic-token-name nonterm))
+		      (default nil)
+		      (cur nil))
+		  (while lst
+		    (setq suffix "" ty "")
+		    (setq cur (car lst))
+		    (if (nth 2 cur)
+			(setq suffix (concat ":" (nth 2 cur))))
+		    (if (= (length basety) 1)
+			(setq ty (car basety))
+		      (setq ty basety))
+		    (setq default (nth 4 cur))
+		    (setq vl (cons
+			      (list
+			       (car cur) ;name
+			       'variable
+			       ty	;type
+			       (if default
+				   (buffer-substring-no-properties
+				    (car default) (car (cdr default))))
+			       (semantic-bovinate-make-assoc-list
+				'const (semantic-token-variable-const nonterm)
+				'suffix suffix
+				'typemodifiers mods
+				'dereference (length (nth 3 cur))
+				'pointer (nth 1 cur)
+				)
+			       (semantic-token-docstring nonterm) ;doc
+			       (semantic-token-properties nonterm) ;properties
+			       (semantic-token-overlay nonterm))
+			      vl))
+		    (setq lst (cdr lst)))
+		  vl))
+	       ((eq (semantic-token-token nonterm) 'type)
+		;; We may someday want to add an extra check for a type
+		;; of type "typedef".
+		;; Each elt of NAME is ( STARS NAME )
+		(let ((vl nil)
+		      (names (semantic-token-name nonterm)))
+		  (while names
+		    (setq vl (cons (list
+				    (nth 1 (car names)) ; name
+				    'type
+				    "typedef"
+				    (semantic-token-type-parts nonterm)
+				    ;; parent is just tbe name of what
+				    ;; is passed down as a nonterminal.
+				    (list
+				     (semantic-token-name
+				      (semantic-token-type-parent nonterm)))
+				    (semantic-bovinate-make-assoc-list
+				     'pointer
+				     (let ((stars (car (car (car names)))))
+				       (if (= stars 0) nil stars))
+				     ;; This specifies what the typedef
+				     ;; is expanded out as.  Just the
+				     ;; name shows up as a parent of this
+				     ;; typedef.
+				     'typedef
+				     (semantic-token-type-parent nonterm))
+				    (semantic-token-docstring nonterm)
+				    (semantic-token-properties nonterm)
+				    (semantic-token-overlay nonterm))
+				   vl))
+		    (setq names (cdr names)))
+		  vl))
+	       ((and (listp (car nonterm))
+		     (eq (semantic-token-token (car nonterm)) 'variable))
+		;; Argument lists come in this way.  Append all the expansions!
+		(let ((vl nil))
+		  (while nonterm
+		    (setq vl (append (semantic-expand-c-nonterminal (car vl))
+				     vl)
+			  nonterm (cdr nonterm)))
+		  vl))
+	       (t nil)))
+	(t nil)))
+
+(defvar semantic-c-classname nil
+  "At parse time, assign a class or struct name text here.
+It is picked up by `semantic-c-reconstitute-token' to determine
+if something is a constructor.  Value should be:
+  ( TYPENAME .  TYPEOFTYPE)
+where typename is the name of the type, and typeoftype is \"class\"
+or \"struct\".")
+
+(defun semantic-c-reconstitute-token (tokenpart declmods typedecl)
+  "Reconstitute a token TOKENPART with DECLMODS and TYPEDECL.
+This is so we don't have to match the same starting text several times.
+Optional argument STAR and REF indicate the number of * and & in the typedef."
+  (cond ((eq (nth 1 tokenpart) 'variable)
+	 (list (car tokenpart)
+	       'variable
+	       (or typedecl "int")	;type
+	       nil			;default value (filled with expand)
+	       (semantic-bovinate-make-assoc-list
+		'const (if (member "const" declmods) t nil)
+		'typemodifiers (delete "const" declmods)
+		)
+	       nil)
+	 )
+	((eq (nth 1 tokenpart) 'function)
+	 ;; We should look at part 4 (the arglist) here, and throw an
+	 ;; error of some sort if it contains parser errors so that we
+	 ;; don't parser function calls, but that is a little beyond what
+	 ;; is available for data here.
+	 (let ((constructor
+		(and (or (and semantic-c-classname
+			      (string= (car semantic-c-classname)
+				       (car tokenpart)))
+			 (and (stringp (car (nth 2 tokenpart)))
+			      (string= (car (nth 2 tokenpart)) (car tokenpart)))
+			 )
+		     (not (car (nth 3 tokenpart))))))
+	   (list (car tokenpart)
+		 'function
+		 (or typedecl		;type
+		     (cond ((car (nth 3 tokenpart) )
+			    "void")	; Destructors have no return?
+			   (constructor
+			    ;; Constructors return an object.			  ;; in our
+			    (list (or (car semantic-c-classname)
+				      (car (nth 2 tokenpart)))
+				  'type
+				  (or (cdr semantic-c-classname)
+				      "class")))
+			   (t "int")))
+		 (nth 4 tokenpart)	;arglist
+		 (semantic-bovinate-make-assoc-list
+		  'const (if (member "const" declmods) t nil)
+		  'typemodifiers (delete "const" declmods)
+		  'parent (car (nth 2 tokenpart))
+		  'destructor (if (car (nth 3 tokenpart) ) t)
+		  'constructor (if constructor t)
+		  'pointer (nth 7 tokenpart)
+		  ;; Even though it is "throw" in C++, we use
+		  ;; `throws' as a common name for things that toss
+		  ;; exceptions about.
+		  'throws (nth 5 tokenpart)
+		  ;; Reemtrant is a C++ thingy.  Add it here
+		  'reentrant (if (member "reentrant" (nth 6 tokenpart)) t)
+		  ;; A function post-const is funky.  Try stuff
+		  'methodconst (if (member "const" (nth 6 tokenpart)) t)
+		  ;; prototypes are functions w/ no body
+		  'prototype (if (nth 8 tokenpart) t)
+		  ;; Pure virtual
+		  'pure-virtual (if (eq (nth 8 tokenpart) 'pure-virtual) t)
+		  )
+		 nil))
+	 )
+	))
+
+(defun semantic-c-reconstitute-template (def specifier)
+  "Reconstitute the token DEF with the template SPECIFIER."
+  (semantic-token-add-extra-spec def 'template (or specifier ""))
+  def)
+
+(defvar semantic-c-keyword-table
+  (semantic-flex-make-keyword-table 
+   `( ("include" . INCLUDE)
+      ("define" . DEFINE)
+      ("extern" . EXTERN)
+      ("static" . STATIC)
+      ("const" . CONST)
+      ("volatile" . VOLATILE)
+      ("register" . REGISTER)
+      ("signed" . SIGNED)
+      ("unsigned" . UNSIGNED)
+      ("inline" . INLINE)
+      ("virtual" . VIRTUAL)
+      ("mutable" . MUTABLE)
+      ("struct" . STRUCT)
+      ("union" . UNION)
+      ("enum" . ENUM)
+      ("typedef" . TYPEDEF)
+      ("class" . CLASS)
+      ("typename" . TYPENAME)
+      ("namespace" . NAMESPACE)
+      ("using" . USING)
+      ("template" . TEMPLATE)
+      ("throw" . THROW)
+      ("reentrant" . REENTRANT)
+      ("operator" . OPERATOR)
+      ("public" . PUBLIC)
+      ("private" . PRIVATE)
+      ("protected" . PROTECTED)
+      ("friend" . FRIEND)
+      ("if" . IF)
+      ("else" . ELSE)
+      ("do" . DO)
+      ("while" . WHILE)
+      ("for" . FOR)
+      ("switch" . SWITCH)
+      ("case" . CASE)
+      ("default" . DEFAULT)
+      ("return" . RETURN)
+      ("break" . BREAK)
+      ("continue" . CONTINUE)
+      ("sizeof" . SIZEOF)
+      ("void" . VOID)
+      ("char" . CHAR)
+      ("wchar_t" . WCHAR)
+      ("short" . SHORT)
+      ("int" . INT)
+      ("long" . LONG)
+      ("float" . FLOAT)
+      ("double" . DOUBLE)
+      ("_P" . UNDERP)
+      ("__P" . UNDERUNDERP)
+      )
+   '(
+     ("extern" summary "Declaration Modifier: extern <type> <name> ...")
+     ("static" summary "Declaration Modifier: static <type> <name> ...")
+     ("const" summary "Declaration Modifier: const <type> <name> ...")
+     ("volatile" summary "Declaration Modifier: volatile <type> <name> ...")
+     ("register" summary "Declaration Modifier: register <type> <name> ...")
+     ("signed" summary "Numeric Type Modifier: signed <numeric type> <name> ...")
+     ("unsigned" summary "Numeric Type Modifier: unsigned <numeric type> <name> ...")
+     ("inline" summary "Function Modifier: inline <return  type> <name>(...) {...};")
+     ("virtual" summary "Method Modifier: virtual <type> <name>(...) ...")
+     ("mutable" summary "Member Declaration Modifier: mutable <type> <name> ...")
+     ("struct" summary "Structure Type Declaration: struct [name] { ... };")
+     ("union" summary "Union Type Declaration: union [name] { ... };")
+     ("enum" summary "Enumeration Type Declaration: enum [name] { ... };")
+     ("typedef" summary "Arbitrary Type Declaration: typedef <typedeclaration> <name>;")
+     ("class" summary "Class Declaration: class <name>[:parents] { ... };")
+     ("typename" summary "typename is used to handle a qualified name as a typename;")
+     ("namespace" summary "Namespace Declaration: namespace <name> { ... };")
+     ("using" summary "using <namespace>;")
+     ("template" summary "template <class TYPE ...> TYPE_OR_FUNCTION")
+     ("throw" summary "<type> <methoddef> (<method args>) throw (<exception>) ...")
+     ("reentrant" summary "<type> <methoddef> (<method args>) reentrant ...")
+     ("if" summary "if (<condition>) { code } [ else { code } ]")
+     ("else" summary "if (<condition>) { code } [ else { code } ]")
+     ("do" summary " do { code } while (<condition>);")
+     ("while" summary "do { code } while (<condition>); or while (<condition>) { code };")
+     ("for" summary "for(<init>; <condition>; <increment>) { code }")
+     ("switch" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
+     ("case" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
+     ("default" summary "switch (<variable>) { case <constvalue>: code; ... default: code; }")
+     ("return" summary "return <value>;")
+     ("break" summary "Non-local exit within a loop or switch (for, do/while, switch): break;")
+     ("continue" summary "Non-local continue within a lool (for, do/while): continue;")
+     ("sizeof" summary "Compile time macro: sizeof(<type or variable>) // size in bytes")
+     ("void" summary "Built in typeless type: void")
+     ("char" summary "Integral Character Type: (0 to 256)")
+     ("wchar_t" summary "Wide Character Type")
+     ("short" summary "Integral Primitive Type: (-32768 to 32767)")
+     ("int" summary "Integral Primitive Type: (-2147483648 to 2147483647)")
+     ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
+     ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
+     ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
+     ("_P" summary "Common macro to eliminate prototype compatibility on some compilers")
+     ("__P" summary "Common macro to eliminate prototype compatibility on some compilers")
+     ))
+  "Some keywords used in C.")
+
+
+;;; Override methods & Variables
+;;
+(defcustom semantic-default-c-path '("/usr/include" "/usr/dt/include"
+					 "/usr/X11R6/include")
+  "Default set of include paths for C code.
+Used by `semantic-inc' to define an include path.  This should
+probably do some sort of search to see what is actually on the local
+machine."
+  :group 'c
+  :type '(repeat (string :tag "Path")))
+
+(defun semantic-c-nonterminal-protection (token &optional parent)
+  "Return the protection of TOKEN in PARENT.
+Override function for `semantic-nonterminal-protection'."
+  (let ((mods (semantic-token-type-modifiers token))
+	(prot nil))
+    ;; Check the modifiers for protection if we are not a child
+    ;; of some class type.
+    (when (or (not parent) (not (eq (semantic-token-token parent) 'type)))
+      (while (and (not prot) mods)
+	(if (stringp (car mods))
+	    (let ((s (car mods)))
+	      ;; A few silly defaults to get things started.
+	      (cond ((or (string= s "extern")
+			 (string= s "export"))
+		     'public)
+		    ((string= s "static")
+		     'private))))
+	(setq mods (cdr mods))))
+    ;; If we have a typed parent, look for :public style labels.
+    (when (and parent (eq (semantic-token-token parent) 'type))
+      (let ((pp (semantic-token-type-parts parent)))
+	(while (and pp (not (eq (car pp) token)))
+	  (when (eq (semantic-token-token (car pp)) 'label)
+	    (setq prot
+		  (cond ((string= (semantic-token-name (car pp)) "public")
+			 'public)
+			((string= (semantic-token-name (car pp)) "private")
+			 'private)
+			((string= (semantic-token-name (car pp)) "protected")
+			 'protected)))
+	    )
+	  (setq pp (cdr pp)))))
+    (when (and (not prot) (eq (semantic-token-token parent) 'type))
+      (setq prot
+	    (cond ((string= (semantic-token-type parent) "class") 'private)
+		  ((string= (semantic-token-type parent) "struct") 'public)
+		  (t 'unknown))))
+    (or prot 'public)))
+
+(defun semantic-c-nonterminal-children (token)
+  "Return children for the C token TOKEN."
+  (if (and (eq (semantic-token-token token) 'type)
+	   (string= (semantic-token-type token) "typedef"))
+      ;; A typedef can contain a parent who has positional children,
+      ;; but that parent will not have a position.  Do this funny hack
+      ;; to make sure we can apply overlays properly.
+      (semantic-nonterminal-children (semantic-token-type-parent token))
+    (semantic-nonterminal-children-default token)))
+
+(defun semantic-c-nonterminal-template (token)
+  "Return the template specification for TOKEN, or nil."
+  (semantic-token-extra-spec token 'template))
+
+(defun semantic-c-nonterminal-template-specifier (token)
+  "Return the template specifier specification for TOKEN, or nil."
+  (semantic-token-extra-spec token 'template-specifier))
+
+(defun semantic-c-template-string-body (templatespec)
+  "Convert TEMPLATESPEC into a string.
+This might be a string, or a list of tokens."
+  (cond ((stringp templatespec)
+	 templatespec)
+	((semantic-token-p templatespec)
+	 (semantic-abbreviate-nonterminal templatespec))
+	((listp templatespec)
+	 (mapconcat 'semantic-abbreviate-nonterminal templatespec ", "))))
+
+(defun semantic-c-template-string (token &optional parent color)
+  "Return a string representing the TEMPLATE attribute of TOKEN.
+This string is prefixed with a space, or is the empty string.
+Argument PARENT specifies a parent type.
+Argument COLOR specifies that the string should be colorized."
+  (let ((t2 (semantic-c-nonterminal-template-specifier token))
+	(t1 (semantic-c-nonterminal-template token))
+	(pt1 (if parent (semantic-c-nonterminal-template parent)))
+	(pt2 (if parent (semantic-c-nonterminal-template-specifier parent)))
+	)
+    (cond (t2 ;; we have a template with specifier
+	   (concat " <"
+		   ;; Fill in the parts here
+		   (semantic-c-template-string-body t2)
+		   ">"))
+	  (t1 ;; we have a template without specifier
+	   " <>")
+	  (t
+	   ""))))
+
+(defun semantic-c-concise-prototype-nonterminal (token &optional parent color)
+  "Return an abbreviated string describing TOKEN for C and C++.
+Optional PARENT and COLOR as specified with
+`semantic-abbreviate-nonterminal-default'."
+  ;; If we have special template things, append.
+  (concat  (semantic-concise-prototype-nonterminal-default token parent color)
+	   (semantic-c-template-string token parent color)))
+
+(defun semantic-c-uml-prototype-nonterminal (token &optional parent color)
+  "Return an uml string describing TOKEN for C and C++.
+Optional PARENT and COLOR as specified with
+`semantic-abbreviate-nonterminal-default'."
+  ;; If we have special template things, append.
+  (concat  (semantic-uml-prototype-nonterminal-default token parent color)
+	   (semantic-c-template-string token parent color)))
+
+(defun semantic-c-nonterminal-abstract (token &optional parent)
+  "Return non-nil if TOKEN is considered abstract.
+PARENT is token's parent.
+In C, a method is abstract if it is `virtual', which is already
+handled.  A class is abstract iff it's destructor is virtual."
+  (cond
+   ((eq (semantic-token-token token) 'type)
+    (or (semantic-find-nonterminal-by-extra-spec 'pure-virtual
+						 (semantic-nonterminal-children token)
+						 nil nil)
+	(let* ((ds (semantic-find-nonterminal-by-extra-spec
+		    'destructor
+		    (semantic-nonterminal-children token)
+		    nil nil))
+	       (cs (semantic-find-nonterminal-by-extra-spec
+		    'constructor
+		    (semantic-nonterminal-children token)
+		    nil nil)))
+	  (and ds (member "virtual" (semantic-token-modifiers (car ds)))
+	       cs (eq 'protected (semantic-nonterminal-protection cs token))
+	       )
+	  )))
+   ((eq (semantic-token-token token) 'function)
+    (semantic-token-extra-spec token 'pure-virtual))
+   (t (semantic-nonterminal-abstract-default token parent))))
+
+(defun semantic-c-analyze-dereference-metatype (type)
+  "Dereference TYPE as described in `semantic-analyze-dereference-metatype'.
+If TYPE is a typedef, get TYPE's type by name or token, and return."
+  (if (and (eq (semantic-token-token type) 'type)
+	   (string= (semantic-token-type type) "typedef"))
+      (semantic-token-type-extra-spec type 'typedef)
+    type))
+
+(defun semantic-c-analyze-type-constants (type)
+  "When TYPE is a token for an enum, return it's parts.
+These are constants which are of type TYPE."
+  (if (and (eq (semantic-token-token type) 'type)
+	   (string= (semantic-token-type type) "enum"))
+      (semantic-token-type-parts type)))
+
+;;;###autoload
+(defun semantic-default-c-setup ()
+  "Set up a buffer for semantic parsing of the C language."
+  (semantic-install-function-overrides
+   '((nonterminal-protection . semantic-c-nonterminal-protection)
+     (nonterminal-children . semantic-c-nonterminal-children)
+     (concise-prototype-nonterminal . semantic-c-concise-prototype-nonterminal)
+     (uml-prototype-nonterminal . semantic-c-uml-prototype-nonterminal)
+     (nonterminal-abstract . semantic-c-nonterminal-abstract)
+     (analyze-dereference-metatype . semantic-c-analyze-dereference-metatype)
+     (analyze-type-constants . semantic-c-analyze-type-constants)
+     ))
+  ;; Code generated from c.bnf
+  (setq semantic-toplevel-bovine-table semantic-toplevel-c-bovine-table
+        semantic-toplevel-bovine-table-source "c.bnf")
+  (setq semantic-flex-keywords-obarray semantic-c-keyword-table)
+  (setq semantic-equivalent-major-modes '(c-mode c++-mode))
+  (setq semantic-expand-nonterminal 'semantic-expand-c-nonterminal
+        semantic-flex-extensions semantic-flex-c-extensions
+        semantic-dependency-include-path semantic-default-c-path
+        semantic-orphaned-member-metaparent-type "struct"
+        semantic-symbol->name-assoc-list
+        '((type     . "Types")
+	  (variable . "Variables")
+	  (function . "Functions")
+	  (include  . "Includes"))
+        semantic-symbol->name-assoc-list-for-type-parts
+        '((type     . "Types")
+	  (variable . "Attributes")
+	  (function . "Methods")
+	  (label    . "Labels")
+	  )
+        imenu-create-index-function 'semantic-create-imenu-index
+        semantic-type-relation-separator-character '("." "->")
+        semantic-command-separation-character ";"
+        document-comment-start "/*"
+        document-comment-line-prefix " *"
+        document-comment-end " */"
+        ;; Semantic navigation inside 'type children
+        senator-step-at-token-ids '(function variable)
+        )
+ 
+ ;; End code generated from c.bnf
+)
+
+(add-hook 'c-mode-hook 'semantic-default-c-setup)
+(add-hook 'c++-mode-hook 'semantic-default-c-setup)
+
+(provide 'semantic-c)
+
+;;; semantic-c.el ends here
+;;; semantic-el.el --- Semantic details for Emacs Lisp
+
+;;; Copyright (C) 1999, 2000, 2001, 2002 Eric M. Ludlam
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+;; X-RCS: $Id$
+
+;; This file is not part of GNU Emacs.
+
+;; Semantic-ex is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; This software is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+;;
+;; Use the Semantic Bovinator for Emacs Lisp
+
+(require 'semantic)
+(require 'backquote)
+(eval-when-compile
+  (require 'semantic-imenu)
+  )
+
+;;; Code:
+(defvar semantic-toplevel-elisp-bovine-table
+  `((bovine-toplevel
+     (semantic-list
+      ,(lambda (vals start end)
+	 (append (semantic-elisp-use-read (car vals))
+		 (list start end)))))
+    )
+  "Top level bovination table for elisp.")
+
+(defun semantic-elisp-desymbolify (arglist)
+  "Convert symbols to strings for ARGLIST."
+  (let ((out nil))
+    (while arglist
+      (setq out
+	    (cons
+	     (if (symbolp (car arglist))
+		 (symbol-name (car arglist))
+	       (if (and (listp (car arglist))
+			(symbolp (car (car arglist))))
+		   (symbol-name (car (car arglist)))
+		 (format "%S" (car arglist))))
+	     out)
+	    arglist (cdr arglist)))
+    (nreverse out)))
+
+(defun semantic-elisp-clos-slot-property-string (slot property)
+  "For SLOT, a string representing PROPERTY."
+  (let ((p (member property slot)))
+    (if (not p)
+	nil
+      (setq p (cdr p))
+      (cond
+       ((stringp (car p))
+	(car p))
+       ((or (symbolp (car p)) (listp (car p)))
+	(format "%S" (car p)))
+       (t nil)))))
+
+(defun semantic-elisp-clos-args-to-semantic (partlist)
+  "Convert a list of CLOS class slot PARTLIST to `variable' tokens."
+  (let ((vars nil))
+    (while partlist
+      (let ((part (car partlist)))
+	(setq vars
+	      (cons
+	       (list (symbol-name (car part))
+		     'variable
+		     (semantic-elisp-clos-slot-property-string
+		      part :type)
+		     (semantic-elisp-clos-slot-property-string
+		      part :initform)
+		     (semantic-bovinate-make-assoc-list
+		      'protection
+		      (semantic-elisp-clos-slot-property-string
+		       part :protection)
+		      'static
+		      (equal (semantic-elisp-clos-slot-property-string
+			      part :allocation)
+			     ":class")
+		      )
+		     (semantic-elisp-clos-slot-property-string
+		      part :documentation))
+	       vars)))
+      (setq partlist (cdr partlist)))
+    (nreverse vars)))
+
+(defun semantic-elisp-form-to-doc-string (form)
+  "After reading a form FORM, covert it to a doc string.
+For Emacs Lisp, sometimes that string is non-existant.
+Recently discovered, sometimes it is a form which is evaluated
+at compile time, permitting compound strings."
+  (cond ((stringp form) form)
+	((and (listp form) (eq (car form) 'concat)
+	      (stringp (nth 1 form)))
+	 (nth 1 form))
+	(t nil)))
+
+(defun semantic-elisp-use-read (sl)
+  "Use `read' on the semantic list SL.
+Return a bovination list to use."
+  (let* ((rt (read (buffer-substring (car sl) (cdr sl)))) ; read text
+	 (ts (car rt)) ; type symbol
+	 (tss (nth 1 rt))
+	 (ss (if (not (listp tss)) tss
+	       (if (eq (car tss) 'quote)
+		   (nth 1 tss)
+		 (car tss))))
+	 (sn (format "%S" ss))
+	 )
+    (cond
+     ((listp ts)
+      ;; If the first elt is a list, then it is some arbitrary code.
+      (list "anonymous" 'code))
+     ((eq ts 'eval-and-compile)
+      ;; Eval and compile can be wrapped around definitions, such as in
+      ;; eieio.el, so splice it's parts back into the main list.
+      (semantic-bovinate-from-nonterminal-full (car sl) (cdr sl)
+					       'bovine-toplevel 1)
+      )
+     ((or (eq ts 'defvar)
+	  (eq ts 'defconst)
+	  (eq ts 'defcustom)
+	  (eq ts 'defface)
+	  (eq ts 'defimage))
+      (let ((doc (semantic-elisp-form-to-doc-string (nth 3 rt))))
+        ;; Variables and constants
+        (list sn 'variable nil (nth 2 rt)
+              (semantic-bovinate-make-assoc-list
+               'const (if (eq ts 'defconst) t nil)
+               'user-visible (and doc
+                                  (> (length doc) 0)
+                                  (= (aref doc 0) ?*))
+               )
+              doc)
+        ))
+     ((or (eq ts 'defun)
+	  (eq ts 'defun*)
+	  (eq ts 'defsubst)
+	  (eq ts 'defmacro))
+      ;; functions and macros
+      (list sn 'function nil (semantic-elisp-desymbolify (nth 2 rt))
+	    (semantic-bovinate-make-assoc-list
+	     'user-visible (equal (car-safe (nth 4 rt)) 'interactive)
+	     )
+	    (nth 3 rt))
+      )
+     ((eq ts 'autoload)
+      (list (format "%S" (car (cdr (car (cdr rt)))))
+	    'function
+	    nil nil
+	    (semantic-bovinate-make-assoc-list
+	     'use-visible (and (nth 4 rt)
+			       (not (eq (nth 4 rt) 'nil)))
+	     'prototype t)
+	    (nth 3 rt))
+      )
+     ((or (eq ts 'defmethod)
+	  (eq ts 'defgeneric))
+      ;; methods
+      (let* ((a2 (nth 2 rt))
+	     (a3 (nth 3 rt))
+	     (args (if (listp a2) a2 a3))
+	     (doc (nth (if (listp a2) 3 4) rt)))
+	(list sn 'function nil
+	      (if (listp (car args))
+		  (cons (symbol-name (car (car args)))
+			(semantic-elisp-desymbolify (cdr args)))
+		(semantic-elisp-desymbolify (cdr args)))
+	      (semantic-bovinate-make-assoc-list
+	       'parent (symbol-name
+			(if (listp (car args)) (car (cdr (car args))))))
+	      doc)
+	))
+     ((eq ts 'defadvice)
+      ;; Advice
+      (list sn 'function nil (semantic-elisp-desymbolify (nth 2 rt))
+	    nil (nth 3 rt)))
+     ((eq ts 'defclass)
+      ;; classes
+      (let ((docpart (nthcdr 4 rt)))
+	(list sn 'type "class"
+	      (semantic-elisp-clos-args-to-semantic (nth 3 rt))
+	      (semantic-elisp-desymbolify (nth 2 rt))
+	      (semantic-bovinate-make-assoc-list
+	       'typemodifiers
+	       (semantic-elisp-desymbolify
+		(if (not (stringp docpart))
+		    docpart))
+	       )
+	      (if (stringp (car docpart))
+		  (car docpart)
+		(car (cdr (member :documentation docpart))))))
+      )
+     ((eq ts 'defstruct)
+      ;; structs
+      (list sn 'type "struct" (semantic-elisp-desymbolify (nthcdr 2 rt))
+	    nil ;(semantic-elisp-desymbolify (nth 2 rt))
+	    nil (nth 4 rt))
+      )
+     ;; Now for other stuff
+     ((eq ts 'require)
+      (list sn 'include nil nil))
+     ((eq ts 'provide)
+      (list sn 'package (nth 3 rt) nil))
+     (t
+      ;; Other stuff
+      (list (symbol-name ts) 'code)
+      ))))
+
+(defun semantic-expand-elisp-nonterminal (nonterm)
+  "Expand Emacs Lisp nonterminals.
+Finds compound nonterminals embedded in sub-lists.
+Argument NONTERM is the nonterminal to test for expansion."
+  (if (semantic-token-p (car nonterm))
+      (progn
+        ;; Nuke the overlay from the end.
+        ;; For some reason, it takes token in reverse order.
+        (setq nonterm (nreverse nonterm))
+        ;; Don't forget to delete the overlay from its buffer!
+        ;; Otherwise `semantic-find-nonterminal-by-overlay' will
+        ;; return this invalid NONTERM as a token.
+        (if (semantic-overlay-p (car nonterm))
+            (semantic-overlay-delete (car nonterm)))
+      (cdr (cdr nonterm)))
+    nil))
+
+(defun semantic-elisp-find-dependency (token)
+  "Find the file BUFFER depends on described by TOKEN."
+  (let ((f (file-name-sans-extension
+	    (locate-library (semantic-token-name token)))))
+    (concat f ".el")))
+
+(defun semantic-elisp-find-documentation (token &optional nosnarf)
+  "Return the documentation string for TOKEN.
+Optional argument NOSNARF is ignored."
+  (let ((d (semantic-token-docstring token)))
+    (if (and d (> (length d) 0) (= (aref d 0) ?*))
+	(substring d 1)
+      d)))
+
+(defun semantic-elisp-insert-foreign-token (token tokenfile)
+  "Insert TOKEN from TOKENFILE at point.
+Attempts a simple prototype for calling or using TOKEN."
+  (cond ((eq (semantic-token-token token) 'function)
+	 (insert "(" (semantic-token-name token) " )")
+	 (forward-char -1))
+	(t
+	 (insert (semantic-token-name token)))))
+
+(defun semantic-elisp-nonterminal-protection (token &optional parent)
+  "Return the protection of TOKEN in PARENT.
+Override function for `semantic-nonterminal-protection'."
+  (let ((prot (semantic-token-extra-spec token 'protection)))
+    (cond
+     ((not prot) 'public)
+     ((string= prot ":public") 'public)
+     ((string= prot "public") 'public)
+     ((string= prot ":private") 'private)
+     ((string= prot "private") 'private)
+     ((string= prot ":protected") 'protected)
+     ((string= prot "protected") 'protected))))
+
+(defun semantic-elisp-nonterminal-static (token &optional parent)
+  "Return non-nil of TOKEN is static in PARENT class.
+Overrides `semantic-nonterminal-static'."
+  ;; This can only be true (theoretically) in a class where it is assigned.
+  (semantic-token-extra-spec token 'static))
+
+;;;###autoload
+(defun semantic-default-elisp-setup ()
+  "Setup hook function for Emacs Lisp files and Semantic."
+  (semantic-install-function-overrides
+   '((find-dependency . semantic-elisp-find-dependency)
+     (find-documentation . semantic-elisp-find-documentation)
+     (insert-foreign-token . semantic-elisp-insert-foreign-token)
+     (nonterminal-protection . semantic-elisp-nonterminal-protection)
+     (nonterminal-static . semantic-elisp-nonterminal-static)
+     )
+   t)
+  (setq semantic-toplevel-bovine-table semantic-toplevel-elisp-bovine-table
+	semantic-expand-nonterminal 'semantic-expand-elisp-nonterminal
+	semantic-function-argument-separator " "
+	semantic-function-argument-separation-character " "
+	semantic-symbol->name-assoc-list
+	'( (type     . "Types")
+	   (variable . "Variables")
+	   (function . "Defuns")
+	   (include  . "Requires")
+	   (package  . "Provides"))
+	imenu-create-index-function 'semantic-create-imenu-index
+	))
+
+(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup)
+
+(provide 'semantic-el)
+
+;;; semantic-el.el ends here
+;;; semantic-java.el --- Semantic details for Java
+
+;;; Copyright (C) 1999, 2000, 2001 David Ponce
+
+;; Author: David Ponce <david@dponce.com>
+;; X-RCS: $Id$
+
+;; This file is not part of GNU Emacs.
+
+;; semantic-java is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2, or (at
+;; your option) any later version.
+
+;; This software is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+;;
+;; Setup the Semantic Bovinator for Java.  See also the grammar in
+;; java.bnf.
+
+;;; History:
+;; 
+
+;;; Code:
+(require 'semantic)
+
+(eval-when-compile
+  (require 'semantic-ctxt)
+  (require 'semantic-imenu)
+  (require 'document)
+  (require 'senator))
+
+;; Generated parser table
+(defvar semantic-toplevel-java-bovine-table
+`((bovine-toplevel
+ ( package_declaration)
+ ( import_declaration)
+ ( type_declaration)
+ ) ; end bovine-toplevel
+ (literal
+ ( number)
+ ( qualified_name)
+ ( string)
+ ) ; end literal
+ (type
+ ( reference_type
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( primitive_type
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end type
+ (primitive_type
+ ( BOOLEAN)
+ ( BYTE)
+ ( SHORT)
+ ( INT)
+ ( LONG)
+ ( CHAR)
+ ( FLOAT)
+ ( DOUBLE)
+ ) ; end primitive_type
+ (reference_type
+ ( array_type
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( qualified_name
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end reference_type
+ (array_type
+ ( primitive_type dims
+  ,(semantic-lambda
+  (list ( concat ( car (nth 0 vals)) ( car (nth 1 vals))))))
+ ( qualified_name dims
+  ,(semantic-lambda
+  (list ( concat ( car (nth 0 vals)) ( car (nth 1 vals))))))
+ ) ; end array_type
+ (qualified_name
+ ( symbol punctuation "\\." qualified_name
+  ,(semantic-lambda
+  (list ( concat (nth 0 vals) (nth 1 vals) ( car (nth 2 vals))))))
+ ( symbol
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end qualified_name
+ (package_declaration
+ ( PACKAGE qualified_name punctuation ";"
+  ,(semantic-lambda
+  (nth 1 vals) (list 'package nil nil)))
+ ) ; end package_declaration
+ (import_declaration
+ ( IMPORT qualified_name punctuation ";"
+  ,(semantic-lambda
+  (nth 1 vals) (list 'include nil nil)))
+ ( IMPORT qualified_name punctuation "\\." punctuation "*" punctuation ";"
+  ,(semantic-lambda
+  (list ( concat ( car (nth 1 vals)) (nth 2 vals) (nth 3 vals)) 'include nil nil)))
+ ) ; end import_declaration
+ (type_declaration
+ ( punctuation ";")
+ ( class_declaration)
+ ( interface_declaration)
+ ) ; end type_declaration
+ (modifiers_opt
+ ( modifiers
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ()
+ ) ; end modifiers_opt
+ (modifiers
+ ( modifier modifiers
+  ,(semantic-lambda
+  ( cons ( car (nth 0 vals)) (nth 1 vals))))
+ ( modifier
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end modifiers
+ (modifier
+ ( PUBLIC)
+ ( PROTECTED)
+ ( PRIVATE)
+ ( STATIC)
+ ( ABSTRACT)
+ ( FINAL)
+ ( NATIVE)
+ ( SYNCHRONIZED)
+ ( TRANSIENT)
+ ( VOLATILE)
+ ( STRICTFP)
+ ) ; end modifier
+ (class_declaration
+ ( modifiers_opt CLASS qualified_name class_parents class_body
+  ,(semantic-lambda
+  (nth 2 vals) (list 'type "class" (nth 4 vals) (nth 3 vals) ( semantic-bovinate-make-assoc-list 'typemodifiers (nth 0 vals)) nil)))
+ ) ; end class_declaration
+ (class_parents
+ ( super interfaces
+  ,(semantic-lambda
+  ( append (nth 0 vals) (nth 1 vals))))
+ ( interfaces super
+  ,(semantic-lambda
+  ( append (nth 1 vals) (nth 0 vals))))
+ ( super
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( interfaces
+  ,(semantic-lambda
+  ( cons nil (nth 0 vals))))
+ ()
+ ) ; end class_parents
+ (super
+ ( EXTENDS qualified_name
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ) ; end super
+ (interfaces
+ ( IMPLEMENTS qualified_name_list
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ) ; end interfaces
+ (qualified_name_list
+ ( qualified_name punctuation "," qualified_name_list
+  ,(semantic-lambda
+  ( cons ( car (nth 0 vals)) (nth 2 vals))))
+ ( qualified_name
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end qualified_name_list
+ (class_body
+ ( semantic-list
+  ,(semantic-lambda
+ 
+ (semantic-bovinate-from-nonterminal-full (car (nth 0 vals)) (cdr (nth 0 vals)) 'class_body_declarations)
+ ))
+ ) ; end class_body
+ (class_body_declarations
+ ( class_declaration
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( interface_declaration
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( field_declaration
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( method_declaration
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( constructor_declaration
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end class_body_declarations
+ (field_declaration
+ ( modifiers_opt type variable_declarators punctuation ";"
+  ,(semantic-lambda
+  (nth 2 vals) (list 'variable) (nth 1 vals) (list nil ( semantic-bovinate-make-assoc-list 'typemodifiers (nth 0 vals)) nil)))
+ ) ; end field_declaration
+ (field_declaration_multi
+ ( modifiers_opt type variable_declarator punctuation ","
+  ,(semantic-lambda
+  (nth 2 vals)))
+ ( modifiers_opt type variable_declarator punctuation ";"
+  ,(semantic-lambda
+  (nth 2 vals)))
+ ( variable_declarator punctuation ","
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( variable_declarator punctuation ";"
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end field_declaration_multi
+ (variable_declarators
+ ( variable_declarator variable_declarators_opt
+  ,(semantic-lambda
+  (list ( cons ( car (nth 0 vals)) ( car (nth 1 vals))))))
+ ) ; end variable_declarators
+ (variable_declarators_opt
+ ( punctuation "," variable_declarators
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ()
+ ) ; end variable_declarators_opt
+ (variable_declarator
+ ( variable_declarator_id variable_assign_opt
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end variable_declarator
+ (variable_assign_opt
+ ( punctuation "=" variable_initializer)
+ ()
+ ) ; end variable_assign_opt
+ (variable_declarator_id
+ ( symbol dims
+  ,(semantic-lambda
+  (list ( concat (nth 0 vals) ( car (nth 1 vals))))))
+ ( symbol
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ) ; end variable_declarator_id
+ (variable_initializer
+ ( array_initializer)
+ ( expression)
+ ) ; end variable_initializer
+ (method_declaration
+ ( method_header method_body
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end method_declaration
+ (method_header
+ ( modifiers_opt method_type symbol formal_parameter_list_opt throws_opt
+  ,(semantic-lambda
+  (list (nth 2 vals) 'function) (nth 1 vals) (list (nth 3 vals) ( semantic-bovinate-make-assoc-list 'typemodifiers (nth 0 vals) 'throws (nth 4 vals)) nil)))
+ ) ; end method_header
+ (method_type
+ ( VOID
+  ,(semantic-lambda
+  (list (nth 0 vals))))
+ ( type
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end method_type
+ (formal_parameter_list_opt
+ ( semantic-list
+  ,(semantic-lambda
+ 
+ (semantic-bovinate-from-nonterminal-full (car (nth 0 vals)) (cdr (nth 0 vals)) 'formal_parameter_list)
+ ))
+ ()
+ ) ; end formal_parameter_list_opt
+ (formal_parameter_list
+ ( formal_parameter punctuation ","
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( formal_parameter
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end formal_parameter_list
+ (formal_parameter-modifier
+ ( FINAL)
+ ()
+ ) ; end formal_parameter-modifier
+ (formal_parameter
+ ( formal_parameter-modifier type variable_declarator_id
+  ,(semantic-lambda
+  (nth 2 vals) (list 'variable) (nth 1 vals) (list nil ( semantic-bovinate-make-assoc-list 'typemodifiers (nth 0 vals)) nil)))
+ ) ; end formal_parameter
+ (throws_opt
+ ( throws
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ()
+ ) ; end throws_opt
+ (throws
+ ( THROWS qualified_name_list
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ) ; end throws
+ (method_body
+ ( punctuation ";")
+ ( block)
+ ) ; end method_body
+ (constructor_declaration
+ ( modifiers_opt symbol formal_parameter_list_opt throws_opt constructor_body
+  ,(semantic-lambda
+  (list (nth 1 vals) 'function nil (nth 2 vals) ( semantic-bovinate-make-assoc-list 'typemodifiers (nth 0 vals) 'throws (nth 3 vals)) nil)))
+ ) ; end constructor_declaration
+ (constructor_body
+ ( block)
+ ) ; end constructor_body
+ (interface_declaration
+ ( modifiers_opt INTERFACE symbol interface_parents interface_body
+  ,(semantic-lambda
+  (list (nth 2 vals) 'type "interface" (nth 4 vals) (nth 3 vals) ( semantic-bovinate-make-assoc-list 'typemodifiers (nth 0 vals)) nil)))
+ ) ; end interface_declaration
+ (interface_parents
+ ( EXTENDS qualified_name_list
+  ,(semantic-lambda
+  (nth 1 vals)))
+ ()
+ ) ; end interface_parents
+ (interface_body
+ ( semantic-list
+  ,(semantic-lambda
+ 
+ (semantic-bovinate-from-nonterminal-full (car (nth 0 vals)) (cdr (nth 0 vals)) 'interface_body_declarations)
+ ))
+ ) ; end interface_body
+ (interface_body_declarations
+ ( class_declaration
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( interface_declaration
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( method_header punctuation ";"
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ( field_declaration
+  ,(semantic-lambda
+  (nth 0 vals)))
+ ) ; end interface_body_declarations
+ (array_initializer
+ ( semantic-list "\\`{")
+ ) ; end array_initializer
+ (block
+ ( semantic-list "\\`{")
+ ) ; end block
+ (primary
+ ( array_creation_expression)
+ ( primary_no_new_array primary_dim_opt)
+ ) ; end primary
+ (primary_dim_opt
+ ( semantic-list "\\`\\[")
+ ()
+ ) ; end primary_dim_opt
+ (primary_no_new_array
+ ( qualified_name semantic-list "\\`(")
+ ( class_instance_creation_expression)
+ ( semantic-list "\\`(")
+ ( array_type punctuation "\\." CLASS)
+ ( literal)
+ ) ; end primary_no_new_array
+ (class_instance_creation_expression
+ ( NEW qualified_name semantic-list "\\`(" semantic-list "\\`{")
+ ( NEW qualified_name semantic-list "\\`(")
+ ) ; end class_instance_creation_expression
+ (array_creation_expression
+ ( NEW array_type array_initializer)
+ ( NEW array_type)
+ ) ; end array_creation_expression
+ (dims_opt
+ ( dims
+  ,(semantic-lambda
+  (nth 0 vals)))
+ (
+  ,(semantic-lambda
+  (list nil)))
+ ) ; end dims_opt
+ (dims
+ ( semantic-list "\\`\\[" dims_opt
+  ,(semantic-lambda
+  (list ( concat "[]" ( car (nth 1 vals))))))
+ ) ; end dims
+ (field_access
+ ( primary punctuation "\\." symbol)
+ ( qualified_name)
+ ) ; end field_access
+ (postfix_expression
+ ( primary postfix_operator_opt)
+ ) ; end postfix_expression
+ (postfix_operator_opt
+ ( punctuation "[-+]" punctuation "[-+]")
+ ()
+ ) ; end postfix_operator_opt
+ (unary_expression
+ ( punctuation "[-+^!]" unary_expression)
+ ( punctuation "[-+]" punctuation "[-+]" unary_expression)
+ ( semantic-list "\\`(" unary_expression)
+ ( postfix_expression)
+ ) ; end unary_expression
+ (operator
+ ( punctuation "[-+*/%=<>^~&|!?:.]")
+ ( INSTANCEOF)
+ ) ; end operator
+ (operators
+ ( operator operators)
+ ( operator)
+ ) ; end operators
+ (operators_expression_opt
+ ( operators expression)
+ ()
+ ) ; end operators_expression_opt
+ (expression
+ ( unary_expression operators_expression_opt)
+ ) ; end expression
+ )
+                   "Java language specification.")
+
+;; Generated keyword table
+(defvar semantic-java-keyword-table
+  (semantic-flex-make-keyword-table
+   `( ("abstract" . ABSTRACT)
+      ("boolean" . BOOLEAN)
+      ("break" . BREAK)
+      ("byte" . BYTE)
+      ("case" . CASE)
+      ("catch" . CATCH)
+      ("char" . CHAR)
+      ("class" . CLASS)
+      ("const" . CONST)
+      ("continue" . CONTINUE)
+      ("default" . DEFAULT)
+      ("do" . DO)
+      ("double" . DOUBLE)
+      ("else" . ELSE)
+      ("extends" . EXTENDS)
+      ("final" . FINAL)
+      ("finally" . FINALLY)
+      ("float" . FLOAT)
+      ("for" . FOR)
+      ("goto" . GOTO)
+      ("if" . IF)
+      ("implements" . IMPLEMENTS)
+      ("import" . IMPORT)
+      ("instanceof" . INSTANCEOF)
+      ("int" . INT)
+      ("interface" . INTERFACE)
+      ("long" . LONG)
+      ("native" . NATIVE)
+      ("new" . NEW)
+      ("package" . PACKAGE)
+      ("private" . PRIVATE)
+      ("protected" . PROTECTED)
+      ("public" . PUBLIC)
+      ("return" . RETURN)
+      ("short" . SHORT)
+      ("static" . STATIC)
+      ("strictfp" . STRICTFP)
+      ("super" . SUPER)
+      ("switch" . SWITCH)
+      ("synchronized" . SYNCHRONIZED)
+      ("this" . THIS)
+      ("throw" . THROW)
+      ("throws" . THROWS)
+      ("transient" . TRANSIENT)
+      ("try" . TRY)
+      ("void" . VOID)
+      ("volatile" . VOLATILE)
+      ("while" . WHILE)
+      ("@author" . _AUTHOR)
+      ("@version" . _VERSION)
+      ("@param" . _PARAM)
+      ("@return" . _RETURN)
+      ("@exception" . _EXCEPTION)
+      ("@throws" . _THROWS)
+      ("@see" . _SEE)
+      ("@since" . _SINCE)
+      ("@serial" . _SERIAL)
+      ("@serialData" . _SERIALDATA)
+      ("@serialField" . _SERIALFIELD)
+      ("@deprecated" . _DEPRECATED)
+      )
+   '(
+     ("abstract" summary "Class|Method declaration modifier: abstract {class|<type>} <name> ...")
+     ("boolean" summary "Primitive logical quantity type (true or false)")
+     ("break" summary "break [<label>] ;")
+     ("byte" summary "Integral primitive type (-128 to 127)")
+     ("case" summary "switch(<expr>) {case <const-expr>: <stmts> ... }")
+     ("catch" summary "try {<stmts>} catch(<parm>) {<stmts>} ... ")
+     ("char" summary "Integral primitive type ('\\u0000' to '\\uffff') (0 to 65535)")
+     ("class" summary "Class declaration: class <name>")
+     ("const" summary "Unused reserved word")
+     ("continue" summary "continue [<label>] ;")
+     ("default" summary "switch(<expr>) { ... default: <stmts>}")
+     ("do" summary "do <stmt> while (<expr>);")
+     ("double" summary "Primitive floating-point type (double-precision 64-bit IEEE 754)")
+     ("else" summary "if (<expr>) <stmt> else <stmt>")
+     ("extends" summary "SuperClass|SuperInterfaces declaration: extends <name> [, ...]")
+     ("final" summary "Class|Member declaration modifier: final {class|<type>} <name> ...")
+     ("finally" summary "try {<stmts>} ... finally {<stmts>}")
+     ("float" summary "Primitive floating-point type (single-precision 32-bit IEEE 754)")
+     ("for" summary "for ([<init-expr>]; [<expr>]; [<update-expr>]) <stmt>")
+     ("goto" summary "Unused reserved word")
+     ("if" summary "if (<expr>) <stmt> [else <stmt>]")
+     ("implements" summary "Class SuperInterfaces declaration: implements <name> [, ...]")
+     ("import" summary "Import package declarations: import <package>")
+     ("int" summary "Integral primitive type (-2147483648 to 2147483647)")
+     ("interface" summary "Interface declaration: interface <name>")
+     ("long" summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)")
+     ("native" summary "Method declaration modifier: native <type> <name> ...")
+     ("package" summary "Package declaration: package <name>")
+     ("private" summary "Access level modifier: private {class|interface|<type>} <name> ...")
+     ("protected" summary "Access level modifier: protected {class|interface|<type>} <name> ...")
+     ("public" summary "Access level modifier: public {class|interface|<type>} <name> ...")
+     ("return" summary "return [<expr>] ;")
+     ("short" summary "Integral primitive type (-32768 to 32767)")
+     ("static" summary "Declaration modifier: static {class|interface|<type>} <name> ...")
+     ("strictfp" summary "Declaration modifier: strictfp {class|interface|<type>} <name> ...")
+     ("switch" summary "switch(<expr>) {[case <const-expr>: <stmts> ...] [default: <stmts>]}")
+     ("synchronized" summary "synchronized (<expr>) ... | Method decl. modifier: synchronized <type> <name> ...")
+     ("throw" summary "throw <expr> ;")
+     ("throws" summary "Method|Constructor declaration: throws <classType>, ...")
+     ("transient" summary "Field declaration modifier: transient <type> <name> ...")
+     ("try" summary "try {<stmts>} [catch(<parm>) {<stmts>} ...] [finally {<stmts>}]")
+     ("void" summary "Method return type: void <name> ...")
+     ("volatile" summary "Field declaration modifier: volatile <type> <name> ...")
+     ("while" summary "while (<expr>) <stmt> | do <stmt> while (<expr>);")
+     ("@author" javadoc (seq 1 usage (type)))
+     ("@version" javadoc (seq 2 usage (type)))
+     ("@param" javadoc (seq 3 usage (function) with-name t))
+     ("@return" javadoc (seq 4 usage (function)))
+     ("@exception" javadoc (seq 5 usage (function) with-name t))
+     ("@throws" javadoc (seq 6 usage (function) with-name t))
+     ("@see" javadoc (seq 7 usage (type function variable) opt t with-ref t))
+     ("@since" javadoc (seq 8 usage (type function variable) opt t))
+     ("@serial" javadoc (seq 9 usage (variable) opt t))
+     ("@serialData" javadoc (seq 10 usage (function) opt t))
+     ("@serialField" javadoc (seq 11 usage (variable) opt t))
+     ("@deprecated" javadoc (seq 12 usage (type function variable) opt t))
+     ))
+  "Java keywords.")
+
+(defconst semantic-java-number-regexp
+  (eval-when-compile
+    (concat "\\("
+            "\\<[0-9]+[.][0-9]+\\([eE][-+]?[0-9]+\\)?[fFdD]?\\>"
+            "\\|"