Changes in src/Parser/DeclarationNode.cc [4040425:1db21619]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.cc (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r4040425 r1db21619 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:26:24 201613 // Update Count : 1 3412 // Last Modified On : Tue Jul 14 14:46:32 2015 13 // Update Count : 126 14 14 // 15 15 … … 34 34 const char *DeclarationNode::storageName[] = { "extern", "static", "auto", "register", "inline", "fortran", "_Noreturn", "_Thread_local", "" }; 35 35 const char *DeclarationNode::qualifierName[] = { "const", "restrict", "volatile", "lvalue", "_Atomic" }; 36 const char *DeclarationNode::basicTypeName[] = { "char", "int", "float", "double", "void", "_Bool", "_Complex", "_Imaginary" ,};36 const char *DeclarationNode::basicTypeName[] = { "char", "int", "float", "double", "void", "_Bool", "_Complex", "_Imaginary" }; 37 37 const char *DeclarationNode::modifierName[] = { "signed", "unsigned", "short", "long" }; 38 38 const char *DeclarationNode::aggregateName[] = { "struct", "union", "context" }; 39 39 const char *DeclarationNode::typeClassName[] = { "type", "dtype", "ftype" }; 40 const char *DeclarationNode::builtinTypeName[] = { "__builtin_va_list" };41 40 42 41 UniqueName DeclarationNode::anonymous( "__anonymous" ); … … 148 147 newnode->type = new TypeData( TypeData::Basic ); 149 148 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;157 149 return newnode; 158 150 } … … 223 215 DeclarationNode *newnode = new DeclarationNode; 224 216 newnode->name = assign_strptr( name ); 225 newnode->enumeratorValue = constant;217 // do something with the constant 226 218 return newnode; 227 219 } … … 251 243 } 252 244 253 DeclarationNode *DeclarationNode::new Trait( std::string *name, DeclarationNode *params, DeclarationNode *asserts ) {245 DeclarationNode *DeclarationNode::newContext( std::string *name, DeclarationNode *params, DeclarationNode *asserts ) { 254 246 DeclarationNode *newnode = new DeclarationNode; 255 247 newnode->type = new TypeData( TypeData::Aggregate ); 256 newnode->type->aggregate->kind = Trait;248 newnode->type->aggregate->kind = Context; 257 249 newnode->type->aggregate->params = params; 258 250 newnode->type->aggregate->fields = asserts; … … 261 253 } 262 254 263 DeclarationNode *DeclarationNode::new TraitUse( std::string *name, ExpressionNode *params ) {255 DeclarationNode *DeclarationNode::newContextUse( std::string *name, ExpressionNode *params ) { 264 256 DeclarationNode *newnode = new DeclarationNode; 265 257 newnode->type = new TypeData( TypeData::AggregateInst ); 266 258 newnode->type->aggInst->aggregate = new TypeData( TypeData::Aggregate ); 267 newnode->type->aggInst->aggregate->aggregate->kind = Trait;259 newnode->type->aggInst->aggregate->aggregate->kind = Context; 268 260 newnode->type->aggInst->aggregate->aggregate->name = assign_strptr( name ); 269 261 newnode->type->aggInst->params = params; … … 802 794 errors.append( e ); 803 795 } // try 804 cur = dynamic_cast< DeclarationNode *>( cur->get_link() );796 cur = dynamic_cast< DeclarationNode *>( cur->get_link() ); 805 797 } // while 806 798 if ( ! errors.isEmpty() ) { … … 889 881 ret = new UnionInstType( type->buildQualifiers(), type->aggregate->name ); 890 882 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 ); 893 885 break; 894 886 default:
Note:
See TracChangeset
for help on using the changeset viewer.