1 ;;; c.by -- LL grammar for C/C++ language specification
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 ;; 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
6 ;; Author: Eric M. Ludlam <zappo@gnu.org>
7 ;; David Ponce <david@dponce.com>
8 ;; Klaus Berndl <klaus.berndl@sdm.de>
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs 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
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;; TODO: From Nate Schley
26 ;; > * Can't parse signature element: "const char* const rmc_ClrTxt"
27 ;; > * Can't parse signature element: "char* const dellog_ClrTxt"
28 ;; > * Can't parse signature element: "const char* dellog_SetTxt"
29 ;; > * Can't parse signature element: "const RmcCmdSSPADetailedStatus& status"
31 ;; > And FWIW I have seen the following argument cases not handled, even
32 ;; > with no leading/trailing spaces in the split:
34 ;; > * Can't parse signature element: "const bool currentAlarmStatus"
35 ;; > * Can't parse signature element: "unsigned char mode"
36 ;; > * Can't parse signature element: "TskTimingTask* tsktimingtask"
37 ;; > * Can't parse signature element: "unsigned char htrStatus"
38 ;; > * Can't parse signature element: "char trackPower[]"
39 ;; > * Can't parse signature element: "const RmcCmdMCDetailedStatus& status"
40 ;; > * Can't parse signature element: "RmcBucStatus* rftBucStatus"
42 %package semantic-c-by
44 %languagemode c-mode c++-mode
48 %token <punctuation> HASH "\\`[#]\\'"
49 %token <punctuation> PERIOD "\\`[.]\\'"
50 %token <punctuation> COLON "\\`[:]\\'"
51 %token <punctuation> SEMICOLON "\\`[;]\\'"
52 %token <punctuation> STAR "\\`[*]\\'"
53 %token <punctuation> AMPERSAND "\\`[&]\\'"
54 %token <punctuation> DIVIDE "\\`[/]\\'"
55 %token <punctuation> PLUS "\\`[+]\\'"
56 %token <punctuation> MINUS "\\`[-]\\'"
57 %token <punctuation> BANG "\\`[!]\\'"
58 %token <punctuation> EQUAL "\\`[=]\\'"
59 %token <punctuation> LESS "\\`[<]\\'"
60 %token <punctuation> GREATER "\\`[>]\\'"
61 %token <punctuation> COMA "\\`[,]\\'"
62 %token <punctuation> TILDE "\\`[~]\\'"
63 %token <punctuation> MOD "\\`[%]\\'"
64 %token <punctuation> HAT "\\`\\^\\'"
65 %token <punctuation> OR "\\`[|]\\'"
66 %token <string> C "\"C\""
67 %token <string> CPP "\"C\\+\\+\""
68 %token <number> ZERO "^0$"
69 %token <symbol> RESTRICT "\\<\\(__\\)?restrict\\>"
70 %token <open-paren> LPAREN "("
71 %token <close-paren> RPAREN ")"
72 %token <open-paren> LBRACE "{"
73 %token <close-paren> RBRACE "}"
74 %token <semantic-list> BRACK_BLCK "\\[.*\\]$"
75 %token <semantic-list> PAREN_BLCK "^("
76 %token <semantic-list> BRACE_BLCK "^{"
77 %token <semantic-list> VOID_BLCK "^(void)$"
78 %token <semantic-list> PARENS "()"
79 %token <semantic-list> BRACKETS "\\[\\]"
81 %token EXTERN "extern"
82 %put EXTERN summary "Declaration Modifier: extern <type> <name> ..."
83 %token STATIC "static"
84 %put STATIC summary "Declaration Modifier: static <type> <name> ..."
86 %put CONST summary "Declaration Modifier: const <type> <name> ..."
87 %token VOLATILE "volatile"
88 %put VOLATILE summary "Declaration Modifier: volatile <type> <name> ..."
89 %token REGISTER "register"
90 %put REGISTER summary "Declaration Modifier: register <type> <name> ..."
91 %token SIGNED "signed"
92 %put SIGNED summary "Numeric Type Modifier: signed <numeric type> <name> ..."
93 %token UNSIGNED "unsigned"
94 %put UNSIGNED summary "Numeric Type Modifier: unsigned <numeric type> <name> ..."
96 %token INLINE "inline"
97 %put INLINE summary "Function Modifier: inline <return type> <name>(...) {...};"
98 %token VIRTUAL "virtual"
99 %put VIRTUAL summary "Method Modifier: virtual <type> <name>(...) ..."
100 %token MUTABLE "mutable"
101 %put MUTABLE summary "Member Declaration Modifier: mutable <type> <name> ..."
103 %token STRUCT "struct"
104 %put STRUCT summary "Structure Type Declaration: struct [name] { ... };"
106 %put UNION summary "Union Type Declaration: union [name] { ... };"
108 %put ENUM summary "Enumeration Type Declaration: enum [name] { ... };"
109 %token TYPEDEF "typedef"
110 %put TYPEDEF summary "Arbitrary Type Declaration: typedef <typedeclaration> <name>;"
112 %put CLASS summary "Class Declaration: class <name>[:parents] { ... };"
113 %token TYPENAME "typename"
114 %put TYPENAME summary "typename is used to handle a qualified name as a typename;"
115 %token NAMESPACE "namespace"
116 %put NAMESPACE summary "Namespace Declaration: namespace <name> { ... };"
118 %put USING summary "using <namespace>;"
121 %put NEW summary "new <classname>();"
122 %token DELETE "delete"
123 %put DELETE summary "delete <object>;"
125 ;; Despite this, this parser can find templates by ignoring the TEMPLATE
126 ;; keyword, and finding the class/method being templateized.
127 %token TEMPLATE "template"
128 %put TEMPLATE summary "template <class TYPE ...> TYPE_OR_FUNCTION"
131 %put THROW summary "<type> <methoddef> (<method args>) throw (<exception>) ..."
132 %token REENTRANT "reentrant"
133 %put REENTRANT summary "<type> <methoddef> (<method args>) reentrant ..."
136 %put { TRY CATCH } summary "try { <body> } catch { <catch code> }"
138 ;; Leave these alone for now.
139 %token OPERATOR "operator"
140 %token PUBLIC "public"
141 %token PRIVATE "private"
142 %token PROTECTED "protected"
143 %token FRIEND "friend"
144 %put FRIEND summary "friend class <CLASSNAME>"
146 ;; These aren't used for parsing, but is a useful place to describe the keywords.
149 %put {IF ELSE} summary "if (<condition>) { code } [ else { code } ]"
153 %put DO summary " do { code } while (<condition>);"
154 %put WHILE summary "do { code } while (<condition>); or while (<condition>) { code };"
157 %put FOR summary "for(<init>; <condition>; <increment>) { code }"
159 %token SWITCH "switch"
161 %token DEFAULT "default"
162 %put {SWITCH CASE DEFAULT} summary
163 "switch (<variable>) { case <constvalue>: code; ... default: code; }"
165 %token RETURN "return"
166 %put RETURN summary "return <value>;"
169 %put BREAK summary "Non-local exit within a loop or switch (for, do/while, switch): break;"
170 %token CONTINUE "continue"
171 %put CONTINUE summary "Non-local continue within a loop (for, do/while): continue;"
173 %token SIZEOF "sizeof"
174 %put SIZEOF summary "Compile time macro: sizeof(<type or variable>) // size in bytes"
178 %put VOID summary "Built in typeless type: void"
180 %put CHAR summary "Integral Character Type: (0 to 256)"
181 %token WCHAR "wchar_t"
182 %put WCHAR summary "Wide Character Type"
184 %put SHORT summary "Integral Primitive Type: (-32768 to 32767)"
186 %put INT summary "Integral Primitive Type: (-2147483648 to 2147483647)"
188 %put LONG summary "Integral primitive type (-9223372036854775808 to 9223372036854775807)"
190 %put FLOAT summary "Primitive floating-point type (single-precision 32-bit IEEE 754)"
191 %token DOUBLE "double"
192 %put DOUBLE summary "Primitive floating-point type (double-precision 64-bit IEEE 754)"
194 %put BOOL summary "Primitive boolean type"
197 %token UNDERUNDERP "__P"
198 %put UNDERP summary "Common macro to eliminate prototype compatibility on some compilers"
199 %put UNDERUNDERP summary "Common macro to eliminate prototype compatibility on some compilers"
206 ;; TODO: Klaus Berndl: Is the define here necessary or even wrong?
207 ;; Is this part not already covered by macro??
217 | codeblock-var-or-fun
218 | type ;; type is less likely to be used here.
231 : EXTERN C semantic-list
232 ;; Extern C commands which contain a list need to have the
233 ;; entries of the list extracted, and spliced into the main
234 ;; list of entries. This must be done via the function
235 ;; that expands singular nonterminals, such as int x,y;
236 (TAG "C" 'extern :members (EXPANDFULL $3 extern-c-contents) )
237 | EXTERN CPP semantic-list
238 (TAG "C" 'extern :members (EXPANDFULL $3 extern-c-contents) )
240 ;; A plain extern "C" call should add something to the token,
241 ;; but just strip it from the buffer here for now.
249 (VARIABLE-TAG $1 nil nil :constant-flag t )
256 ;; This is used in struct parts.
259 (VARIABLE-TAG $1 nil nil :constant-flag t)
264 ;; In C++, structures can have the same things as classes.
265 ;; So delete this somday in the figure.
267 ;;structparts : semantic-list
268 ;; (EXPANDFULL $1 structsubparts)
271 ;;structsubparts : LBRACE
277 ;; ;; sometimes there are defines in structs.
282 (EXPANDFULL $1 classsubparts)
290 ;; @todo - support 'friend' construct.
296 | class-protection opt-symbol COLON
297 ;; For QT, they may put a `slot' keyword between the protection
298 ;; and the COLON. @todo - Have the QT stuff use macros.
299 (TAG (car $1) 'label)
302 (TAG (car $2) 'friend)
303 | FRIEND CLASS symbol
312 : COLON class-parents opt-template-specifier
319 : opt-class-protection opt-class-declmods namespace-symbol
320 (TYPE-TAG (car $3) "class" nil nil :protection (car $1))
321 | opt-class-declmods opt-class-protection namespace-symbol
322 (TYPE-TAG (car $3) "class" nil nil :protection (car $2))
326 : one-class-parent COMA class-parents
333 : class-declmods opt-class-declmods
351 | ;;EMPTY - Same as private
357 (EXPANDFULL $1 namespacesubparts)
368 | class-protection COLON
369 (TAG (car $1) 'label)
370 ;; In C++, this label in a classsubpart represents
371 ;; PUBLIC or PRIVATE bits. Ignore them for now.
379 (EXPANDFULL $1 enumsubparts)
384 (VARIABLE-TAG $1 "int" (car $2) :constant-flag t )
400 : struct-or-class opt-class opt-name opt-template-specifier
401 opt-class-parents semantic-list
402 (TYPE-TAG (car $3) (car $1)
403 (let ((semantic-c-classname (cons (car ,$3) (car ,$1))))
404 (EXPANDFULL $6 classsubparts))
406 :template-specifier $4
408 | struct-or-class opt-class opt-name opt-template-specifier
410 (TYPE-TAG (car $3) (car $1) nil $5
411 :template-specifier $4
414 | UNION opt-class opt-name unionparts
415 (TYPE-TAG (car $3) $1 $4 nil
417 | ENUM opt-class opt-name enumparts
418 (TYPE-TAG (car $3) $1 $4 nil
420 ;; Klaus Berndl: a typedef can be a typeformbase with all this
422 | TYPEDEF declmods typeformbase cv-declmods typedef-symbol-list
423 ;;;; We put the type this typedef renames into PARENT
424 ;;;; but will move it in the expand function.
425 (TYPE-TAG $5 $1 nil (list $3) )
429 : typedefname COMA typedef-symbol-list
435 ;; TODO: Klaus Berndl: symbol -> namespace-symbol?! Answer: Probably
436 ;; symbol is correct here!
438 : opt-stars symbol opt-bits opt-array
448 : typesimple SEMICOLON
450 ;; named namespaces like "namespace XXX {"
451 | NAMESPACE symbol namespaceparts
452 (TYPE-TAG $2 $1 $3 nil )
453 ;; unnamed namespaces like "namespace {"
454 | NAMESPACE namespaceparts
455 (TYPE-TAG "unnamed" $1 $2 nil )
456 ;; David Engster: namespace alias like "namespace foo = bar;"
457 | NAMESPACE symbol EQUAL typeformbase SEMICOLON
458 (TYPE-TAG $2 $1 (list (TYPE-TAG (car $4) $1 nil nil)) nil :kind 'alias )
461 ;; Klaus Berndl: We must parse "using namespace XXX" too
463 ;; Using is vaguely like an include statement in the named portions
464 ;; of the code. We should probably specify a new token type for this.
467 : USING usingname SEMICOLON
468 (TAG (car $2) 'using :type ,$2 )
471 ;; Jan Moringen: Differentiate between 'using' and 'using namespace'
472 ;; Adapted to creating type tags by EML.
475 (TYPE-TAG (car $1) "class" nil nil :prototype t)
476 | NAMESPACE typeformbase
477 (TYPE-TAG (car $2) "namespace" nil nil :prototype t)
481 : TEMPLATE template-specifier opt-friend template-definition
482 ( ,(semantic-c-reconstitute-template $4 ,$2) )
490 opt-template-specifier
498 : LESS template-specifier-types GREATER
502 template-specifier-types
503 : template-var template-specifier-type-list
508 template-specifier-type-list
509 : COMA template-specifier-types
516 ;; : template-type opt-stars opt-template-equal
517 ;; ( ,(cons (concat (car $1) (make-string (car ,$2) ?*))
519 ;; ;; Klaus Berndl: for template-types the template-var can also be
520 ;; ;; literals or constants. Example: map<ClassX, ClassY, 10>
521 ;; ;; map_size10_var; This parses also template<class T, 0> which is
522 ;; ;; nonsense but who cares....
531 ;; Klaus Berndl: The following handles all template-vars of
532 ;; template-definitions
533 template-type opt-template-equal
534 ( ,(cons (car $1) (cdr $1)) )
535 ;; Klaus Berndl: for template-types the template-var can also be
536 ;; literals or constants.
537 ;; Example: map<ClassX, ClassY, 10> map_size10_var; This parses also
538 ;; template<class T, 0> which is nonsense but who cares....
543 ;; Klaus Berndl: In template-types arguments can be any symbols with
544 ;; optional address-operator (&) and optional dereferencing operator
545 ;; (*). Example map<ClassX, ClassY, *size_var_ptr> sized_map_var.
546 | opt-stars opt-ref namespace-symbol
548 ;; Some code can compile down into a number, but starts out as an
549 ;; expression, such as "sizeof(a)", or (sizeof(a)/sizeof(b))
552 | SIZEOF semantic-list
557 : EQUAL symbol LESS template-specifier-types GREATER
567 (TYPE-TAG $2 "class" nil nil )
569 (TYPE-TAG $2 "struct" nil nil )
570 ;; TODO: Klaus Berndl: For the moment is is ok, that we parse the C++
571 ;; keyword typename as a class....
573 (TYPE-TAG $2 "class" nil nil)
574 ;; Klaus Berndl: template-types can be all flavors of variable-args
575 ;; but here the argument is ignored, only the type stuff is needed.
576 | declmods typeformbase cv-declmods opt-stars
577 opt-ref variablearg-opt-name
578 (TYPE-TAG (car $2) nil nil nil
579 :constant-flag (if (member "const" (append $1 $3)) t nil)
580 :typemodifiers (delete "const" (append $1 $3))
594 : STAR opt-starmod opt-stars
601 : STARMOD opt-starmod
602 ( ,(cons (,car ,$1) $2) )
613 ( ,(cons ,(car ,$1) $2 ) )
624 ;; Klaus Berndl: IMHO signed and unsigned are not decl-modes but
625 ;; these are only valid for some buildin-types like short, int
626 ;; etc... whereas "real" declmods are valid for all types, buildin
627 ;; and user-defined! SIGNED UNSIGNED
631 ;; Klaus Berndl: There can be a few cases where TYPENAME is not
632 ;; allowed in C++-syntax but better than not recognizing the allowed
636 ;; This is a hack in case we are in a class.
653 : CVDECLMOD cv-declmods
654 ( ,(cons ,(car ,$1) $2 ) )
666 ;; C++: A type can be modified into a reference by "&"
678 (TYPE-TAG $2 $1 nil nil )
680 (TYPE-TAG $2 $1 nil nil )
682 (TYPE-TAG $2 $1 nil nil )
685 | symbol template-specifier
686 (TYPE-TAG $1 "class" nil nil :template-specifier $2)
687 ;;| namespace-symbol opt-stars opt-template-specifier
688 ;;| namespace-symbol opt-template-specifier
689 | namespace-symbol-for-typeformbase opt-template-specifier
690 (TYPE-TAG (car $1) "class" nil nil
691 :template-specifier $2)
701 ;; Klaus Berndl: builtintype-types was builtintype
705 ;; Klaus Berndl: Added WCHAR
708 ( (concat $1 " " $2) )
712 ( (concat $1 " " $2) )
717 ( (concat $1 " " $2) )
718 ;; TODO: Klaus Berndl: Is there a long long, i think so?!
720 ( (concat $1 " " $2) )
725 : signedmod builtintype-types
726 ( (concat (car $1) " " (car $2)) )
729 ;; Klaus Berndl: unsigned is synonym for unsigned int and signed for
730 ;; signed int. To make this confusing stuff clear we add here the
733 ( (concat (car $1) " int") )
736 ;; Klaus Berndl: This parses also nonsense like "const volatile int
737 ;; const volatile const const volatile a ..." but IMHO nobody writes
738 ;; such code. Normaly we shoud define a rule like typeformbase-mode
739 ;; which exactly defines the different allowed cases and combinations
740 ;; of declmods (minus the CVDECLMOD) typeformbase and cv-declmods so
741 ;; we could recognize more invalid code but IMHO this is not worth the
744 : declmods typeformbase declmods
745 opt-ref var-or-func-decl
746 ( ,(semantic-c-reconstitute-token ,$5 $1 $2 ) )
750 : codeblock-var-or-fun
752 ;; it is possible for a function to not have a type, and
753 ;; it is then assumed to be an int. How annoying.
754 ;; In C++, this could be a constructor or a destructor.
755 ;; Even more annoying. Only ever do this for regular
756 ;; top-level items. Ignore this problem in code blocks
757 ;; so that we don't have to deal with regular code
758 ;; being erroneously converted into types.
759 | declmods var-or-func-decl
760 ( ,(semantic-c-reconstitute-token ,$2 $1 nil ) )
771 : opt-stars opt-class opt-destructor functionname
772 opt-template-specifier
775 opt-post-fcn-modifiers
780 ;; Extra stuff goes in here.
781 ;; Continue with the stuff we found in
783 $2 $3 $7 $9 $8 ,$1 ,$11 $5 ,$10)
784 | opt-stars opt-class opt-destructor functionname
785 opt-template-specifier
787 ;; arg-list - - ini this case, a try implies a fcn.
788 opt-post-fcn-modifiers
793 ;; Extra stuff goes in here.
794 ;; Continue with the stuff we found in
796 $2 $3 nil $8 $7 ,$1 ,$10 $5 ,$9)
800 : varnamelist SEMICOLON
812 ;; Klaus Berndl: symbol -> namespace-symbol
814 : COLON namespace-symbol semantic-list opt-initializers
815 | COMA namespace-symbol semantic-list opt-initializers
819 opt-post-fcn-modifiers
820 : post-fcn-modifiers opt-post-fcn-modifiers
832 : THROW semantic-list
833 ( EXPAND $2 throw-exception-list )
837 ;; Is this true? I don't actually know.
839 : namespace-symbol COMA throw-exception-list
840 ( ,(cons (car $1) $3) )
841 | namespace-symbol RPAREN
845 | LPAREN throw-exception-list
859 : BRACK_BLCK opt-array
860 ;; Eventually we want to replace the 1 below with a size
862 ( (cons 1 (car ,$2) ) )
879 ;; Klaus Berndl: symbol -> namespace-symbol?! I think so. Can be that
880 ;; then also some invalid C++-syntax is parsed but this is better than
881 ;; not parsing valid syntax.
883 : opt-stars opt-restrict namespace-symbol opt-bits opt-array
887 ;; I should store more in this def, but leave it simple for now.
888 ;; Klaus Berndl: const and volatile can be written after the type!
890 : declmods typeformbase cv-declmods opt-ref variablearg-opt-name
891 ( VARIABLE-TAG (list $5) $2 nil
892 :constant-flag (if (member "const" (append $1 $3)) t nil)
893 :typemodifiers (delete "const" (append $1 $3))
901 ;; Klaus Berndl: This allows variableargs without a arg-name being
902 ;; parsed correct even if there several pointers (*)
904 ( "" ,$1 nil nil nil )
907 varname-opt-initializer
914 : opt-ref varname varname-opt-initializer COMA varnamelist
916 | opt-ref varname varname-opt-initializer
920 ;; Klaus Berndl: Is necessary to parse stuff like
921 ;; class list_of_facts : public list<fact>, public entity
923 ;; list <shared_ptr<item> >::const_iterator l;
924 ;; Parses also invalid(?) and senseless(?) c++-syntax like
925 ;; symbol<template-spec>::symbol1<template-spec1>::test_iterator
926 ;; but better parsing too much than to less
928 : symbol opt-template-specifier COLON COLON namespace-symbol
929 ( (concat $1 "::" (car $5)) )
930 | symbol opt-template-specifier
934 ;; Don't pull an optional template specifier at the end of the
935 ;; namespace symbol so that it can be picked up by the type.
936 namespace-symbol-for-typeformbase
937 : symbol opt-template-specifier COLON COLON namespace-symbol-for-typeformbase
938 ( (concat $1 "::" (car $5)) )
943 ;; : symbol COLON COLON namespace-symbol
944 ;; ( (concat $1 "::" (car $4)) )
950 : symbol COLON COLON namespace-opt-class
951 ( (concat $1 "::" (car $4)) )
952 ;; Klaus Berndl: We must recognize template-specifiers here so we can
953 ;; parse correctly the method-implementations of template-classes
954 ;; outside the template-class-declaration Example:
955 ;; TemplateClass1<T>::method_1(...)
956 | symbol opt-template-specifier COLON COLON
960 ;; Klaus Berndl: The opt-class of a func-decl must be able to
961 ;; recognize opt-classes with namespaces, e.g.
962 ;; Test1::Test2::classname::
964 : namespace-opt-class
978 : PAREN_BLCK knr-arguments
981 (EXPANDFULL $1 arg-sub-list)
987 : varname COMA knr-varnamelist
994 knr-one-variable-decl
995 : declmods typeformbase cv-declmods knr-varnamelist
996 ( VARIABLE-TAG (nreverse $4) $2 nil
997 :constant-flag (if (member "const" (append $3)) t nil)
998 :typemodifiers (delete "const" $3)
1003 : knr-one-variable-decl SEMICOLON knr-arguments
1004 ( ,(append (semantic-expand-c-tag ,$1) ,$3) )
1005 | knr-one-variable-decl SEMICOLON
1006 ( ,(semantic-expand-c-tag ,$1) )
1012 | PERIOD PERIOD PERIOD RPAREN
1013 (VARIABLE-TAG "..." "vararg" nil)
1025 | GREATER GREATER EQUAL
1053 | MINUS GREATER STAR
1070 | AMPERSAND AMPERSAND
1082 ;; HAT EQUAL seems to have a really unpleasant result and
1083 ;; breaks everything after it. Leave it at the end, though it
1084 ;; doesn't seem to work.
1091 : OPERATOR operatorsym
1094 ( EXPAND $1 function-pointer )
1100 : LPAREN STAR symbol RPAREN
1109 ;; Here is an anoying feature of C++ pure virtual methods
1110 | EQUAL ZERO SEMICOLON
1111 ( :pure-virtual-flag )
1117 : TRY opt-initializers BRACE_BLCK fun-try-several-catches
1121 fun-try-several-catches
1122 : CATCH PAREN_BLCK BRACE_BLCK fun-try-several-catches
1124 | CATCH BRACE_BLCK fun-try-several-catches
1132 ( EXPAND $1 type-cast-list )
1136 : open-paren typeformbase close-paren
1139 opt-stuff-after-symbol
1145 multi-stage-dereference
1146 : namespace-symbol opt-stuff-after-symbol PERIOD multi-stage-dereference ;; method call
1147 | namespace-symbol opt-stuff-after-symbol MINUS GREATER multi-stage-dereference ;;method call
1148 | namespace-symbol opt-stuff-after-symbol
1153 ( (concat $1 (car $2)) )
1170 | AMPERSAND AMPERSAND
1177 ;; Use expression for parsing only. Don't actually return anything
1178 ;; for now. Hopefully we can fix this later.
1180 : unaryexpression expr-binop unaryexpression
1181 ( (identity start) (identity end) )
1183 ( (identity start) (identity end) )
1188 | multi-stage-dereference
1189 | NEW multi-stage-dereference
1190 | NEW builtintype-types semantic-list
1191 ;; Klaus Berndl: symbol -> namespace-symbol!
1193 ;; Klaus Berndl: C/C++ allows sequences of strings which are
1194 ;; concatenated by the precompiler to one string
1196 | type-cast expression ;; A cast to some other type
1197 ;; Casting the results of one expression to something else.
1198 | semantic-list expression
1200 | expr-start expression