;;; c.by -- LL grammar for C/C++ language specification
-;; Copyright (C) 1999-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
;;
;; Author: Eric M. Ludlam <zappo@gnu.org>
;; David Ponce <david@dponce.com>
%token <punctuation> PLUS "\\`[+]\\'"
%token <punctuation> MINUS "\\`[-]\\'"
%token <punctuation> BANG "\\`[!]\\'"
+%token <punctuation> QUESTION "\\`[?]\\'"
%token <punctuation> EQUAL "\\`[=]\\'"
%token <punctuation> LESS "\\`[<]\\'"
%token <punctuation> GREATER "\\`[>]\\'"
| declmods typeformbase cv-declmods opt-stars
opt-ref variablearg-opt-name
(TYPE-TAG (car $2) nil nil nil
+ :template-specifier (plist-get (nth 2 $2) :template-specifier)
:constant-flag (if (member "const" (append $1 $3)) t nil)
:typemodifiers (delete "const" (append $1 $3))
:reference (car ,$5)
:pointer (car $4)
+ :typevar (car $6)
)
;
opt-post-fcn-modifiers
: post-fcn-modifiers opt-post-fcn-modifiers
- ( ,(cons ,$1 $2) )
+ ( ,(cons ,(car $1) $2) )
| ;;EMPTY
( nil )
;
;; Use expression for parsing only. Don't actually return anything
;; for now. Hopefully we can fix this later.
expression
- : unaryexpression expr-binop unaryexpression
+ : unaryexpression QUESTION unaryexpression COLON unaryexpression
+ ( (identity start) (identity end) )
+ | unaryexpression expr-binop unaryexpression
( (identity start) (identity end) )
| unaryexpression
( (identity start) (identity end) )