Changes in src/Parser/DeclarationNode.cc [6cef439:af60383]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r6cef439 raf60383 177 177 } 178 178 179 DeclarationNode * DeclarationNode::newFromTypeData( TypeData * type ) {180 DeclarationNode * newnode = new DeclarationNode;181 newnode->type = type;182 return newnode;183 } // DeclarationNode::newFromTypeData184 185 179 DeclarationNode * DeclarationNode::newStorageClass( ast::Storage::Classes sc ) { 186 180 DeclarationNode * newnode = new DeclarationNode; … … 194 188 return newnode; 195 189 } // DeclarationNode::newFuncSpecifier 190 191 DeclarationNode * DeclarationNode::newTypeQualifier( ast::CV::Qualifiers tq ) { 192 DeclarationNode * newnode = new DeclarationNode; 193 newnode->type = new TypeData(); 194 newnode->type->qualifiers = tq; 195 return newnode; 196 } // DeclarationNode::newQualifier 197 198 DeclarationNode * DeclarationNode::newBasicType( BasicType bt ) { 199 DeclarationNode * newnode = new DeclarationNode; 200 newnode->type = new TypeData( TypeData::Basic ); 201 newnode->type->basictype = bt; 202 return newnode; 203 } // DeclarationNode::newBasicType 204 205 DeclarationNode * DeclarationNode::newComplexType( ComplexType ct ) { 206 DeclarationNode * newnode = new DeclarationNode; 207 newnode->type = new TypeData( TypeData::Basic ); 208 newnode->type->complextype = ct; 209 return newnode; 210 } // DeclarationNode::newComplexType 211 212 DeclarationNode * DeclarationNode::newSignedNess( Signedness sn ) { 213 DeclarationNode * newnode = new DeclarationNode; 214 newnode->type = new TypeData( TypeData::Basic ); 215 newnode->type->signedness = sn; 216 return newnode; 217 } // DeclarationNode::newSignedNess 218 219 DeclarationNode * DeclarationNode::newLength( Length lnth ) { 220 DeclarationNode * newnode = new DeclarationNode; 221 newnode->type = new TypeData( TypeData::Basic ); 222 newnode->type->length = lnth; 223 return newnode; 224 } // DeclarationNode::newLength 225 226 DeclarationNode * DeclarationNode::newForall( DeclarationNode * forall ) { 227 DeclarationNode * newnode = new DeclarationNode; 228 newnode->type = new TypeData( TypeData::Unknown ); 229 newnode->type->forall = forall; 230 return newnode; 231 } // DeclarationNode::newForall 232 233 DeclarationNode * DeclarationNode::newFromGlobalScope() { 234 DeclarationNode * newnode = new DeclarationNode; 235 newnode->type = new TypeData( TypeData::GlobalScope ); 236 return newnode; 237 } 238 239 DeclarationNode * DeclarationNode::newQualifiedType( DeclarationNode * parent, DeclarationNode * child) { 240 DeclarationNode * newnode = new DeclarationNode; 241 newnode->type = new TypeData( TypeData::Qualified ); 242 newnode->type->qualified.parent = parent->type; 243 newnode->type->qualified.child = child->type; 244 parent->type = nullptr; 245 child->type = nullptr; 246 delete parent; 247 delete child; 248 return newnode; 249 } 196 250 197 251 DeclarationNode * DeclarationNode::newAggregate( ast::AggregateDecl::Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { … … 258 312 } 259 313 314 DeclarationNode * DeclarationNode::newFromTypedef( const string * name ) { 315 DeclarationNode * newnode = new DeclarationNode; 316 newnode->type = new TypeData( TypeData::SymbolicInst ); 317 newnode->type->symbolic.name = name; 318 newnode->type->symbolic.isTypedef = true; 319 newnode->type->symbolic.params = nullptr; 320 return newnode; 321 } // DeclarationNode::newFromTypedef 322 323 DeclarationNode * DeclarationNode::newFromTypeGen( const string * name, ExpressionNode * params ) { 324 DeclarationNode * newnode = new DeclarationNode; 325 newnode->type = new TypeData( TypeData::SymbolicInst ); 326 newnode->type->symbolic.name = name; 327 newnode->type->symbolic.isTypedef = false; 328 newnode->type->symbolic.actuals = params; 329 return newnode; 330 } // DeclarationNode::newFromTypeGen 331 260 332 DeclarationNode * DeclarationNode::newTypeParam( ast::TypeDecl::Kind tc, const string * name ) { 261 333 DeclarationNode * newnode = newName( name ); … … 351 423 return newnode; 352 424 } 425 426 DeclarationNode * DeclarationNode::newVtableType( DeclarationNode * decl ) { 427 DeclarationNode * newnode = new DeclarationNode; 428 newnode->type = new TypeData( TypeData::Vtable ); 429 newnode->setBase( decl->type ); 430 return newnode; 431 } 432 433 DeclarationNode * DeclarationNode::newBuiltinType( BuiltinType bt ) { 434 DeclarationNode * newnode = new DeclarationNode; 435 newnode->type = new TypeData( TypeData::Builtin ); 436 newnode->type->builtintype = bt; 437 return newnode; 438 } // DeclarationNode::newBuiltinType 353 439 354 440 DeclarationNode * DeclarationNode::newFunction( const string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ) {
Note:
See TracChangeset
for help on using the changeset viewer.