import "ecdefs"
+#define YYSIZE_T size_t
#define YYLTYPE Location
#include "grammar.h"
%token XOR_ASSIGN OR_ASSIGN TYPE_NAME
%token TYPEDEF EXTERN STATIC AUTO REGISTER
-%token CHAR SHORT INT UINT INT64 LONG SIGNED UNSIGNED FLOAT DOUBLE CONST VOLATILE VOID VALIST
+%token CHAR SHORT INT UINT INT64 INT128 LONG SIGNED UNSIGNED FLOAT DOUBLE CONST VOLATILE VOID VALIST
%token STRUCT UNION ENUM ELLIPSIS
%token CASE DEFAULT IF SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN
%token ALIGNOF ATTRIB_DEP __ATTRIB
%token BOOL _BOOL _COMPLEX _IMAGINARY RESTRICT THREAD
%token WIDE_STRING_LITERAL
+%token BUILTIN_OFFSETOF
%destructor { FreeIdentifier($$); } identifier
%destructor { FreePointer($$); } pointer
/* | identifier identifier
{
#ifdef PRECOMPILER
- DeclClass(0, $1.string);
+ DeclClass($1._class, $1.string);
fileInput.Seek(@1.start.pos, start);
resetScannerPos(&@1.start);
yyclearin;
| INT { $$ = MkSpecifier(INT); }
| UINT { $$ = MkSpecifier(UINT); }
| INT64 { $$ = MkSpecifier(INT64); }
+ | INT128 { $$ = MkSpecifier(INT128); }
| VALIST { $$ = MkSpecifier(VALIST); }
| LONG { $$ = MkSpecifier(LONG); }
| FLOAT { $$ = MkSpecifier(FLOAT); }
| INT { $$ = MkSpecifier(INT); }
| UINT { $$ = MkSpecifier(UINT); }
| INT64 { $$ = MkSpecifier(INT64); }
+ | INT128 { $$ = MkSpecifier(INT128); }
| VALIST { $$ = MkSpecifier(VALIST); }
| LONG { $$ = MkSpecifier(LONG); }
| FLOAT { $$ = MkSpecifier(FLOAT); }
struct_or_union_specifier_compound:
- struct_or_union identifier '{' struct_declaration_list '}' { $$ = MkStructOrUnion($1, $2, $4); if(declMode) DeclClass(0, $2.string); }
+ struct_or_union identifier '{' struct_declaration_list '}' { $$ = MkStructOrUnion($1, $2, $4); if(declMode) DeclClass($2._class, $2.string); }
| struct_or_union '{' struct_declaration_list '}' { $$ = MkStructOrUnion($1, null, $3); }
- | struct_or_union identifier '{' '}' { $$ = MkStructOrUnion($1, $2, null); if(declMode) DeclClass(0, $2.string); }
+ | struct_or_union identifier '{' '}' { $$ = MkStructOrUnion($1, $2, null); if(declMode) DeclClass($2._class, $2.string); }
| struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); }
| struct_or_union strict_type '{' struct_declaration_list '}'
- { $$ = MkStructOrUnion($1, MkIdentifier($2.name), $4); if(declMode) DeclClass(0, $2.name); FreeSpecifier($2); }
+ { $$ = MkStructOrUnion($1, MkIdentifier($2.name), $4); if(declMode) DeclClass($2.nsSpec, $2.name); FreeSpecifier($2); }
- | struct_or_union ext_decl identifier '{' struct_declaration_list '}' { $$ = MkStructOrUnion($1, $3, $5); $$.extDeclStruct = $2; if(declMode) DeclClass(0, $3.string); }
+ | struct_or_union ext_decl identifier '{' struct_declaration_list '}' { $$ = MkStructOrUnion($1, $3, $5); $$.extDeclStruct = $2; if(declMode) DeclClass($3._class, $3.string); }
| struct_or_union ext_decl '{' struct_declaration_list '}' { $$ = MkStructOrUnion($1, null, $4); $$.extDeclStruct = $2; }
- | struct_or_union ext_decl identifier '{' '}' { $$ = MkStructOrUnion($1, $3, null); $$.extDeclStruct = $2; if(declMode) DeclClass(0, $3.string); }
+ | struct_or_union ext_decl identifier '{' '}' { $$ = MkStructOrUnion($1, $3, null); $$.extDeclStruct = $2; if(declMode) DeclClass($3._class, $3.string); }
| struct_or_union ext_decl '{' '}' { $$ = MkStructOrUnion($1, null, null); $$.extDeclStruct = $2; }
| struct_or_union ext_decl strict_type '{' struct_declaration_list '}'
- { $$ = MkStructOrUnion($1, MkIdentifier($3.name), $5); $$.extDeclStruct = $2; if(declMode) DeclClass(0, $3.name); FreeSpecifier($3); }
+ { $$ = MkStructOrUnion($1, MkIdentifier($3.name), $5); $$.extDeclStruct = $2; if(declMode) DeclClass($3.nsSpec, $3.name); FreeSpecifier($3); }
;
struct_or_union_specifier_nocompound:
- struct_or_union identifier { $$ = MkStructOrUnion($1, $2, null); if(declMode) DeclClass(0, $2.string); }
+ struct_or_union identifier { $$ = MkStructOrUnion($1, $2, null); if(declMode) DeclClass($2._class, $2.string); }
| struct_or_union strict_type
- { $$ = MkStructOrUnion($1, MkIdentifier($2.name), null); if(declMode) DeclClass(0, $2.name); FreeSpecifier($2); }
+ { $$ = MkStructOrUnion($1, MkIdentifier($2.name), null); if(declMode) DeclClass($2.nsSpec, $2.name); FreeSpecifier($2); }
| struct_or_union ext_decl identifier
- { $$ = MkStructOrUnion($1, $3, null); $$.extDeclStruct = $2;if(declMode) DeclClass(0, $3.string); }
+ { $$ = MkStructOrUnion($1, $3, null); $$.extDeclStruct = $2;if(declMode) DeclClass($3._class, $3.string); }
| struct_or_union ext_decl strict_type
- { $$ = MkStructOrUnion($1, MkIdentifier($3.name), null); $$.extDeclStruct = $2; if(declMode) DeclClass(0, $3.name); FreeSpecifier($3); }
+ { $$ = MkStructOrUnion($1, MkIdentifier($3.name), null); $$.extDeclStruct = $2; if(declMode) DeclClass($3.nsSpec, $3.name); FreeSpecifier($3); }
;
struct_or_union:
;
enum_specifier_nocompound:
- ENUM identifier { $$ = MkEnum($2, null); if(declMode) DeclClass(0, $2.string); }
- | ENUM strict_type { $$ = MkEnum(MkIdentifier($2.name), null); if(declMode) DeclClass(0, $2.name); FreeSpecifier($2); }
+ ENUM identifier { $$ = MkEnum($2, null); if(declMode) DeclClass($2._class, $2.string); }
+ | ENUM strict_type { $$ = MkEnum(MkIdentifier($2.name), null); if(declMode) DeclClass($2.nsSpec, $2.name); FreeSpecifier($2); }
;
enum_specifier_compound:
ENUM '{' enumerator_list '}'
{ $$ = MkEnum(null, $3); }
- | ENUM identifier '{' enumerator_list '}' { $$ = MkEnum($2, $4); if(declMode) DeclClass(0, $2.string); }
- | ENUM identifier '{' enumerator_list ';' struct_declaration_list '}' { $$ = MkEnum($2, $4); $$.definitions = $6; if(declMode) DeclClass(0, $2.string); }
- | ENUM strict_type '{' enumerator_list ';' struct_declaration_list '}' { $$ = MkEnum(MkIdentifier($2.name), $4); $$.definitions = $6; if(declMode) DeclClass(0, $2.name); FreeSpecifier($2); }
- | ENUM strict_type '{' enumerator_list '}' { $$ = MkEnum(MkIdentifier($2.name), $4); if(declMode) DeclClass(0, $2.name); FreeSpecifier($2); }
+ | ENUM identifier '{' enumerator_list '}' { $$ = MkEnum($2, $4); if(declMode) DeclClass($2._class, $2.string); }
+ | ENUM identifier '{' enumerator_list ';' struct_declaration_list '}' { $$ = MkEnum($2, $4); $$.definitions = $6; if(declMode) DeclClass($2._class, $2.string); }
+ | ENUM strict_type '{' enumerator_list ';' struct_declaration_list '}' { $$ = MkEnum(MkIdentifier($2.name), $4); $$.definitions = $6; if(declMode) DeclClass($2.nsSpec, $2.name); FreeSpecifier($2); }
+ | ENUM strict_type '{' enumerator_list '}' { $$ = MkEnum(MkIdentifier($2.name), $4); if(declMode) DeclClass($2.nsSpec, $2.name); FreeSpecifier($2); }
;
enumerator_list: