Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r413ad05 rab57786  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 26 16:45:44 2016
    13 // Update Count     : 1964
     12// Last Modified On : Mon Aug 22 14:15:15 2016
     13// Update Count     : 1943
    1414//
    1515
     
    5454#include "TypeData.h"
    5555#include "LinkageSpec.h"
     56
     57union DeclQualifiers {
     58        unsigned int value;                                                                     // assume 32-bits
     59        struct {
     60                bool Extern : 1;
     61                bool Static : 1;
     62                bool Auto : 1;
     63                bool Register : 1;
     64                bool Inline : 1;
     65                bool Fortran : 1;
     66                bool Noreturn : 1;
     67                bool Threadlocal : 1;
     68                bool Extension : 1;
     69                bool Lvalue : 1;
     70                bool Const : 1;
     71                bool Volatile : 1;
     72                bool Restrict : 1;
     73                bool Atomic : 1;
     74        } qual;
     75}; // DeclQualifiers
     76DeclQualifiers declQualifiers = { 0 };
     77
     78union DeclType {
     79        unsigned int value;                                                                     // assume 32-bits
     80        struct {
     81                bool Char : 1;
     82                bool Bool : 1;
     83                bool Short : 1;
     84                bool Int : 1;
     85                bool Float : 1;
     86                bool Double : 1;
     87                bool Long : 1;
     88                bool Signed : 1;
     89                bool Unsigned : 1;
     90                bool Void : 1;
     91                bool Complex : 1;
     92                bool Imaginary : 1;
     93                bool Valist : 1;
     94        } type;
     95}; // DeclType
     96DeclType declTypes = { 0 };
    5697
    5798extern DeclarationNode * parseTree;
     
    608649assignment_operator:
    609650        '='                                                                                     { $$ = OperKinds::Assign; }
    610         | ATassign                                                                      { $$ = OperKinds::AtAssn; }
    611651        | MULTassign                                                            { $$ = OperKinds::MulAssn; }
    612652        | DIVassign                                                                     { $$ = OperKinds::DivAssn; }
     
    12881328        type_qualifier_name
    12891329        | attribute
    1290                 //{ $$ = DeclarationNode::newQualifier( DeclarationNode::Attribute ); }
     1330        //{ $$ = DeclarationNode::newQualifier( DeclarationNode::Attribute ); }
    12911331        ;
    12921332
     
    13421382                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Register ); }
    13431383        | INLINE                                                                                        // C99
    1344                 //{ $$ = DeclarationNode::newStorageClass( DeclarationNode::Inline ); }
    1345                 { $$ = new DeclarationNode; $$->isInline = true; }
     1384                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Inline ); }
    13461385        | FORTRAN                                                                                       // C99
    13471386                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Fortran ); }
    13481387        | NORETURN                                                                                      // C11
    1349                 //{ $$ = DeclarationNode::newStorageClass( DeclarationNode::Noreturn ); }
    1350                 { $$ = new DeclarationNode; $$->isNoreturn = true; }
     1388                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Noreturn ); }
    13511389        | THREADLOCAL                                                                           // C11
    13521390                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Threadlocal ); }
     
    21152153asm_name_opt:                                                                                   // GCC
    21162154        // empty
    2117         | ASM '(' string_literal_list ')' attribute_list_opt { delete $3; }     // FIX ME: unimplemented
     2155        | ASM '(' string_literal ')' attribute_list_opt
    21182156        ;
    21192157
     
    21442182        // empty
    21452183        | any_word
    2146         | any_word '(' comma_expression_opt ')' { delete $3; } // FIX ME: unimplemented
     2184        | any_word '(' comma_expression_opt ')'
    21472185        ;
    21482186
    21492187any_word:                                                                                               // GCC
    2150         identifier_or_type_name { delete $1; }                          // FIX ME: unimplemented
    2151         | storage_class { delete $1; }                                          // FIX ME: unimplemented
    2152         | basic_type_name { delete $1; }                                        // FIX ME: unimplemented
    2153         | type_qualifier { delete $1; }                                         // FIX ME: unimplemented
     2188        identifier_or_type_name { delete $1; }
     2189        | storage_class { delete $1; }
     2190        | basic_type_name { delete $1; }
     2191        | type_qualifier { delete $1; }
    21542192        ;
    21552193
Note: See TracChangeset for help on using the changeset viewer.