;;; 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"
;
;; In C++, structures can have the same things as classes.
-;; So delete this somday in the figure.
+;; So delete this some day in the figure.
;;
;;structparts : semantic-list
;; (EXPANDFULL $1 structsubparts)
;; PUBLIC or PRIVATE bits. Ignore them for now.
| template
| using
+ ;; Includes inside namespaces
+ | spp-include
+ (TAG $1 'include :inside-ns t)
| ;;EMPTY
;
(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)
;; 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
function-pointer
: LPAREN STAR symbol RPAREN
( (concat "*" $3) )
+ | LPAREN symbol RPAREN
+ ( $2 )
;
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