Changeset 25bca42 for src/Parser
- Timestamp:
- Jun 6, 2018, 5:23:49 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 407bde5
- Parents:
- f083335
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rf083335 r25bca42 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 22 08:39:29201813 // Update Count : 107 412 // Last Modified On : Wed Jun 6 15:57:50 2018 13 // Update Count : 1076 14 14 // 15 15 … … 174 174 } 175 175 176 DeclarationNode * DeclarationNode::newFunction( string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ) {176 DeclarationNode * DeclarationNode::newFunction( const string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ) { 177 177 DeclarationNode * newnode = new DeclarationNode; 178 178 newnode->name = name; … … 245 245 } // DeclarationNode::newForall 246 246 247 DeclarationNode * DeclarationNode::newFromTypedef( string * name ) {247 DeclarationNode * DeclarationNode::newFromTypedef( const string * name ) { 248 248 DeclarationNode * newnode = new DeclarationNode; 249 249 newnode->type = new TypeData( TypeData::SymbolicInst ); … … 268 268 } // DeclarationNode::newAggregate 269 269 270 DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants, bool body ) {270 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body ) { 271 271 assert( name ); 272 272 DeclarationNode * newnode = new DeclarationNode; … … 278 278 } // DeclarationNode::newEnum 279 279 280 DeclarationNode * DeclarationNode::newEnumConstant( string * name, ExpressionNode * constant ) {280 DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) { 281 281 DeclarationNode * newnode = new DeclarationNode; 282 282 newnode->name = name; … … 285 285 } // DeclarationNode::newEnumConstant 286 286 287 DeclarationNode * DeclarationNode::newName( string * name ) {287 DeclarationNode * DeclarationNode::newName( const string * name ) { 288 288 DeclarationNode * newnode = new DeclarationNode; 289 289 newnode->name = name; … … 291 291 } // DeclarationNode::newName 292 292 293 DeclarationNode * DeclarationNode::newFromTypeGen( string * name, ExpressionNode * params ) {293 DeclarationNode * DeclarationNode::newFromTypeGen( const string * name, ExpressionNode * params ) { 294 294 DeclarationNode * newnode = new DeclarationNode; 295 295 newnode->type = new TypeData( TypeData::SymbolicInst ); … … 300 300 } // DeclarationNode::newFromTypeGen 301 301 302 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, string * name ) {302 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, const string * name ) { 303 303 DeclarationNode * newnode = new DeclarationNode; 304 304 newnode->type = nullptr; … … 331 331 } // DeclarationNode::newTraitUse 332 332 333 DeclarationNode * DeclarationNode::newTypeDecl( string * name, DeclarationNode * typeParams ) {333 DeclarationNode * DeclarationNode::newTypeDecl( const string * name, DeclarationNode * typeParams ) { 334 334 DeclarationNode * newnode = new DeclarationNode; 335 335 newnode->name = name; … … 406 406 } // DeclarationNode::newBuiltinType 407 407 408 DeclarationNode * DeclarationNode::newAttr( string * name, ExpressionNode * expr ) {408 DeclarationNode * DeclarationNode::newAttr( const string * name, ExpressionNode * expr ) { 409 409 DeclarationNode * newnode = new DeclarationNode; 410 410 newnode->type = nullptr; … … 415 415 } 416 416 417 DeclarationNode * DeclarationNode::newAttr( string * name, DeclarationNode * type ) {417 DeclarationNode * DeclarationNode::newAttr( const string * name, DeclarationNode * type ) { 418 418 DeclarationNode * newnode = new DeclarationNode; 419 419 newnode->type = nullptr; … … 424 424 } 425 425 426 DeclarationNode * DeclarationNode::newAttribute( string * name, ExpressionNode * expr ) {426 DeclarationNode * DeclarationNode::newAttribute( const string * name, ExpressionNode * expr ) { 427 427 DeclarationNode * newnode = new DeclarationNode; 428 428 newnode->type = nullptr; -
src/Parser/ParseNode.h
rf083335 r25bca42 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 4 22:21:04201813 // Update Count : 8 3212 // Last Modified On : Wed Jun 6 16:17:18 2018 13 // Update Count : 843 14 14 // 15 15 … … 77 77 78 78 ParseNode * next = nullptr; 79 std::string * name = nullptr;79 const std::string * name = nullptr; 80 80 CodeLocation location = yylloc; 81 81 }; // ParseNode … … 171 171 }; 172 172 173 Expression * build_constantInteger( std::string & str );174 Expression * build_constantFloat( std::string & str );175 Expression * build_constantChar( std::string & str );176 Expression * build_constantStr( std::string & str );173 Expression * build_constantInteger( std::string & str ); // these 4 routines modify the string 174 Expression * build_constantFloat( std::string & str ); 175 Expression * build_constantChar( std::string & str ); 176 Expression * build_constantStr( std::string & str ); 177 177 Expression * build_field_name_FLOATING_FRACTIONconstant( const std::string & str ); 178 178 Expression * build_field_name_FLOATING_DECIMALconstant( const std::string & str ); … … 230 230 static DeclarationNode * newBuiltinType( BuiltinType ); 231 231 static DeclarationNode * newForall( DeclarationNode * ); 232 static DeclarationNode * newFromTypedef( std::string * );233 static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body );232 static DeclarationNode * newFromTypedef( const std::string * ); 233 static DeclarationNode * newFunction( const std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ); 234 234 static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 235 static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );236 static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );237 static DeclarationNode * newName( std::string * );238 static DeclarationNode * newFromTypeGen( std::string *, ExpressionNode * params );239 static DeclarationNode * newTypeParam( TypeClass, std::string * );235 static DeclarationNode * newEnum( const std::string * name, DeclarationNode * constants, bool body ); 236 static DeclarationNode * newEnumConstant( const std::string * name, ExpressionNode * constant ); 237 static DeclarationNode * newName( const std::string * ); 238 static DeclarationNode * newFromTypeGen( const std::string *, ExpressionNode * params ); 239 static DeclarationNode * newTypeParam( TypeClass, const std::string * ); 240 240 static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts ); 241 241 static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params ); 242 static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams );242 static DeclarationNode * newTypeDecl( const std::string * name, DeclarationNode * typeParams ); 243 243 static DeclarationNode * newPointer( DeclarationNode * qualifiers, OperKinds kind ); 244 244 static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic ); … … 247 247 static DeclarationNode * newTuple( DeclarationNode * members ); 248 248 static DeclarationNode * newTypeof( ExpressionNode * expr ); 249 static DeclarationNode * newAttr( std::string *, ExpressionNode * expr ); // @ attributes250 static DeclarationNode * newAttr( std::string *, DeclarationNode * type ); // @ attributes251 static DeclarationNode * newAttribute( std::string *, ExpressionNode * expr = nullptr ); // gcc attributes249 static DeclarationNode * newAttr( const std::string *, ExpressionNode * expr ); // @ attributes 250 static DeclarationNode * newAttr( const std::string *, DeclarationNode * type ); // @ attributes 251 static DeclarationNode * newAttribute( const std::string *, ExpressionNode * expr = nullptr ); // gcc attributes 252 252 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 253 253 static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression * message );
Note: See TracChangeset
for help on using the changeset viewer.