Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r4040425 r1db21619  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:26:24 2016
    13 // Update Count     : 134
     12// Last Modified On : Tue Jul 14 14:46:32 2015
     13// Update Count     : 126
    1414//
    1515
     
    3434const char *DeclarationNode::storageName[] = { "extern", "static", "auto", "register", "inline", "fortran", "_Noreturn", "_Thread_local", "" };
    3535const char *DeclarationNode::qualifierName[] = { "const", "restrict", "volatile", "lvalue", "_Atomic" };
    36 const char *DeclarationNode::basicTypeName[] = { "char", "int", "float", "double", "void", "_Bool", "_Complex", "_Imaginary", };
     36const char *DeclarationNode::basicTypeName[] = { "char", "int", "float", "double", "void", "_Bool", "_Complex", "_Imaginary" };
    3737const char *DeclarationNode::modifierName[]  = { "signed", "unsigned", "short", "long" };
    3838const char *DeclarationNode::aggregateName[] = { "struct", "union", "context" };
    3939const char *DeclarationNode::typeClassName[] = { "type", "dtype", "ftype" };
    40 const char *DeclarationNode::builtinTypeName[] = { "__builtin_va_list" };
    4140
    4241UniqueName DeclarationNode::anonymous( "__anonymous" );
     
    148147        newnode->type = new TypeData( TypeData::Basic );
    149148        newnode->type->basic->typeSpec.push_back( bt );
    150         return newnode;
    151 }
    152 
    153 DeclarationNode *DeclarationNode::newBuiltinType( BuiltinType bt ) {
    154         DeclarationNode *newnode = new DeclarationNode;
    155         newnode->type = new TypeData( TypeData::Builtin );
    156         newnode->type->builtin->type = bt;
    157149        return newnode;
    158150}
     
    223215        DeclarationNode *newnode = new DeclarationNode;
    224216        newnode->name = assign_strptr( name );
    225         newnode->enumeratorValue = constant;
     217        // do something with the constant
    226218        return newnode;
    227219}
     
    251243}
    252244
    253 DeclarationNode *DeclarationNode::newTrait( std::string *name, DeclarationNode *params, DeclarationNode *asserts ) {
     245DeclarationNode *DeclarationNode::newContext( std::string *name, DeclarationNode *params, DeclarationNode *asserts ) {
    254246        DeclarationNode *newnode = new DeclarationNode;
    255247        newnode->type = new TypeData( TypeData::Aggregate );
    256         newnode->type->aggregate->kind = Trait;
     248        newnode->type->aggregate->kind = Context;
    257249        newnode->type->aggregate->params = params;
    258250        newnode->type->aggregate->fields = asserts;
     
    261253}
    262254
    263 DeclarationNode *DeclarationNode::newTraitUse( std::string *name, ExpressionNode *params ) {
     255DeclarationNode *DeclarationNode::newContextUse( std::string *name, ExpressionNode *params ) {
    264256        DeclarationNode *newnode = new DeclarationNode;
    265257        newnode->type = new TypeData( TypeData::AggregateInst );
    266258        newnode->type->aggInst->aggregate = new TypeData( TypeData::Aggregate );
    267         newnode->type->aggInst->aggregate->aggregate->kind = Trait;
     259        newnode->type->aggInst->aggregate->aggregate->kind = Context;
    268260        newnode->type->aggInst->aggregate->aggregate->name = assign_strptr( name );
    269261        newnode->type->aggInst->params = params;
     
    802794                        errors.append( e );
    803795                } // try
    804                 cur = dynamic_cast<DeclarationNode *>( cur->get_link() );
     796                cur = dynamic_cast< DeclarationNode *>( cur->get_link() );
    805797        } // while
    806798        if ( ! errors.isEmpty() ) {
     
    889881                          ret = new UnionInstType( type->buildQualifiers(), type->aggregate->name );
    890882                          break;
    891                         case DeclarationNode::Trait:
    892                           ret = new TraitInstType( type->buildQualifiers(), type->aggregate->name );
     883                        case DeclarationNode::Context:
     884                          ret = new ContextInstType( type->buildQualifiers(), type->aggregate->name );
    893885                          break;
    894886                        default:
Note: See TracChangeset for help on using the changeset viewer.