Merge from emacs-24; up to 2012-12-27T08:21:08Z!rgm@gnu.org
[bpt/emacs.git] / admin / grammars / c.by
index 1797827..5d2f407 100644 (file)
@@ -1,6 +1,5 @@
 ;;; c.by -- LL grammar for C/C++ language specification
-
-;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
 ;;
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;;         David Ponce <david@dponce.com>
 ;; >  * Can't parse signature element: "RmcBucStatus* rftBucStatus"
 
 %package semantic-c-by
+%provide semantic/bovine/c-by
+
+%{
+(declare-function semantic-c-reconstitute-token "semantic/bovine/c")
+(declare-function semantic-c-reconstitute-template "semantic/bovine/c")
+(declare-function semantic-expand-c-tag "semantic/bovine/c")
+}
 
 %languagemode  c-mode c++-mode
 %start         declaration
 %put VIRTUAL summary "Method Modifier: virtual <type> <name>(...) ..."
 %token MUTABLE "mutable"
 %put MUTABLE summary "Member Declaration Modifier: mutable <type> <name> ..."
+%token EXPLICIT "explicit"
+%put EXPLICIT summary "Forbids implicit type conversion: explicit <constructor>"
 
 %token STRUCT "struct"
 %put STRUCT summary "Structure Type Declaration: struct [name] { ... };"
 %put DELETE summary "delete <object>;"
 
 ;; Despite this, this parser can find templates by ignoring the TEMPLATE
-;; keyword, and finding the class/method being templateized.
+;; keyword, and finding the class/method being templatized.
 %token TEMPLATE "template"
 %put TEMPLATE summary "template <class TYPE ...> TYPE_OR_FUNCTION"
 
@@ -261,7 +269,7 @@ define
   ;
 
 ;; In C++, structures can have the same things as classes.
-;; So delete this somday in the figure.
+;; So delete this somday in the figure.
 ;;
 ;;structparts : semantic-list
 ;;            (EXPANDFULL $1 structsubparts)
@@ -370,6 +378,9 @@ namespacesubparts
  ;; PUBLIC or PRIVATE bits.  Ignore them for now.
   | template
   | using
+ ;; Includes inside namespaces
+  | spp-include
+    (TAG $1 'include :inside-ns t)
   | ;;EMPTY
   ;
 
@@ -566,7 +577,7 @@ template-type
     (TYPE-TAG $2 "class" nil nil )
   | STRUCT symbol
     (TYPE-TAG $2 "struct" nil nil )
- ;; TODO: Klaus Berndl: For the moment is is ok, that we parse the C++
+ ;; TODO: Klaus Berndl: For the moment it is ok, that we parse the C++
  ;; keyword typename as a class....
   | TYPENAME symbol
     (TYPE-TAG $2 "class" nil nil)
@@ -734,7 +745,7 @@ builtintype
 
 ;; Klaus Berndl: This parses also nonsense like "const volatile int
 ;; const volatile const const volatile a ..." but IMHO nobody writes
-;; such code. Normaly we shoud define a rule like typeformbase-mode
+;; such code. Normally we should define a rule like typeformbase-mode
 ;; which exactly defines the different allowed cases and combinations
 ;; of declmods (minus the CVDECLMOD) typeformbase and cv-declmods so
 ;; we could recognize more invalid code but IMHO this is not worth the
@@ -1098,6 +1109,8 @@ functionname
 function-pointer
   : LPAREN STAR symbol RPAREN
     ( (concat "*" $3) )
+  | LPAREN symbol RPAREN
+    ( $2 )
   ;
 
 fun-or-proto-end
@@ -1105,7 +1118,7 @@ fun-or-proto-end
     ( t )
   | semantic-list
     ( nil )
- ;; Here is an anoying feature of C++ pure virtual methods
+ ;; Here is an annoying feature of C++ pure virtual methods
   | EQUAL ZERO SEMICOLON
     ( :pure-virtual-flag )
   | fun-try-end