Changeset 03606ce for src/Parser/DeclarationNode.cc
- Timestamp:
- Mar 8, 2024, 12:25:49 AM (4 months ago)
- Branches:
- master
- Children:
- 266732e
- Parents:
- 06601401 (diff), 169496e1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r06601401 r03606ce 177 177 } 178 178 179 DeclarationNode * DeclarationNode::newFromTypeData( TypeData * type ) { 180 DeclarationNode * newnode = new DeclarationNode; 181 newnode->type = type; 182 return newnode; 183 } // DeclarationNode::newFromTypeData 184 179 185 DeclarationNode * DeclarationNode::newStorageClass( ast::Storage::Classes sc ) { 180 186 DeclarationNode * newnode = new DeclarationNode; … … 188 194 return newnode; 189 195 } // 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::newQualifier197 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::newBasicType204 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::newComplexType211 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::newSignedNess218 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::newLength225 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::newForall232 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 }250 196 251 197 DeclarationNode * DeclarationNode::newAggregate( ast::AggregateDecl::Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { … … 312 258 } 313 259 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::newFromTypedef322 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::newFromTypeGen331 332 260 DeclarationNode * DeclarationNode::newTypeParam( ast::TypeDecl::Kind tc, const string * name ) { 333 261 DeclarationNode * newnode = newName( name ); … … 423 351 return newnode; 424 352 } 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::newBuiltinType439 353 440 354 DeclarationNode * DeclarationNode::newFunction( const string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ) {
Note: See TracChangeset
for help on using the changeset viewer.