%token ___proto___ "__proto__"
%token _prototype_ "prototype"
%token _public_ "public"
+%token ___restrict_ "__restrict"
+%token _restrict_ "restrict"
%token _set_ "set"
%token _short_ "short"
%token _static_ "static"
%type <typedIdentifier_> TypeSignifier
%type <typedIdentifier_> TypeSignifierNone
%type <typedIdentifier_> TypeSignifierOpt
+%type <modifier_> ParameterTail
%type <modifier_> TypeQualifierLeft
%type <modifier_> TypeQualifierLeftOpt
%type <typedIdentifier_> TypeQualifierRight
| "char" { $$ = CYNew CYIdentifier("char"); }
| "int" { $$ = CYNew CYIdentifier("int"); }
| "long" { $$ = CYNew CYIdentifier("long"); }
+ | "__restrict" { $$ = CYNew CYIdentifier("__restrict"); }
+ | "restrict" { $$ = CYNew CYIdentifier("restrict"); }
| "short" { $$ = CYNew CYIdentifier("short"); }
| "static" { $$ = CYNew CYIdentifier("static"); }
| "volatile" { $$ = CYNew CYIdentifier("volatile"); }
| TypeSignifierNone[pass] { $$ = $pass; }
;
+Restrict
+ : "__restrict"
+ | "restrict"
+ ;
+
+RestrictOpt
+ : Restrict
+ |
+ ;
+
+ParameterModifier
+ : "throw" "(" ")"
+ ;
+
+ParameterModifierOpt
+ : ParameterModifier
+ |
+ ;
+
+ParameterTail
+ : TypedParameterListOpt[parameters] ")" ParameterModifierOpt { $$ = CYNew CYTypeFunctionWith($parameters); }
+ ;
+
SuffixedType
- : SuffixedTypeOpt[typed] "[" NumericLiteral[size] "]" { $$ = $typed; $$->modifier_ = CYNew CYTypeArrayOf($size, $$->modifier_); }
+ : SuffixedTypeOpt[typed] "[" RestrictOpt NumericLiteral[size] "]" { $$ = $typed; $$->modifier_ = CYNew CYTypeArrayOf($size, $$->modifier_); }
| "(" "^" TypeQualifierRightOpt[typed] ")" "(" TypedParameterListOpt[parameters] ")" { $$ = $typed; $$->modifier_ = CYNew CYTypeBlockWith($parameters, $$->modifier_); }
- | TypeSignifier[typed] "(" TypedParameterListOpt[parameters] ")" { $$ = $typed; $$->modifier_ = CYNew CYTypeFunctionWith($parameters, $$->modifier_); }
- | "("[parenthesis] TypedParameterListOpt[parameters] ")" { $$ = CYNew CYTypedIdentifier(@parenthesis); $$->modifier_ = CYNew CYTypeFunctionWith($parameters, $$->modifier_); }
+ | TypeSignifier[typed] "(" ParameterTail[modifier] { $$ = $typed; CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; }
+ | "("[parenthesis] ParameterTail[modifier] { $$ = CYNew CYTypedIdentifier(@parenthesis); CYSetLast($modifier) = $$->modifier_; $$->modifier_ = $modifier; }
;
SuffixedTypeOpt
| PrefixedType[pass] { $$ = $pass; }
| "const" TypeQualifierRightOpt[typed] { $$ = $typed; $$->modifier_ = CYNew CYTypeConstant($$->modifier_); }
| "volatile" TypeQualifierRightOpt[typed] { $$ = $typed; $$->modifier_ = CYNew CYTypeVolatile($$->modifier_); }
+ | Restrict TypeQualifierRightOpt[typed] { $$ = $typed; }
;
TypeQualifierRightOpt
"__proto__" L /*III*/ F(tk::___proto___, hi::Special);
"prototype" L /*III*/ F(tk::_prototype_, hi::Special);
"public" L /*FSS*/ F(tk::_public_, hi::Meta);
+"__restrict" L /*III*/ F(tk::___restrict_, hi::Meta);
+"restrict" L /*III*/ F(tk::_restrict_, hi::Meta);
"return" L /*KKK*/ F(tk::_return_, hi::Control);
"set" L /*III*/ F(tk::_set_, hi::Meta);
"short" L /*FII*/ F(tk::_short_, hi::Type);