Changes in src/Parser/ParseNode.h [6d539f83:25bca42]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r6d539f83 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 Apr 30 09:19:17201813 // Update Count : 8 3112 // 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 … … 87 87 InitializerNode( ExpressionNode *, bool aggrp = false, ExpressionNode * des = nullptr ); 88 88 InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = nullptr ); 89 InitializerNode( bool isDelete ); 89 90 ~InitializerNode(); 90 91 virtual InitializerNode * clone() const { assert( false ); return nullptr; } … … 97 98 InitializerNode * set_maybeConstructed( bool value ) { maybeConstructed = value; return this; } 98 99 bool get_maybeConstructed() const { return maybeConstructed; } 100 101 bool get_isDelete() const { return isDelete; } 99 102 100 103 InitializerNode * next_init() const { return kids; } … … 110 113 InitializerNode * kids; 111 114 bool maybeConstructed; 115 bool isDelete; 112 116 }; // InitializerNode 113 117 … … 167 171 }; 168 172 169 Expression * build_constantInteger( std::string & str );170 Expression * build_constantFloat( std::string & str );171 Expression * build_constantChar( std::string & str );172 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 ); 173 177 Expression * build_field_name_FLOATING_FRACTIONconstant( const std::string & str ); 174 178 Expression * build_field_name_FLOATING_DECIMALconstant( const std::string & str ); … … 226 230 static DeclarationNode * newBuiltinType( BuiltinType ); 227 231 static DeclarationNode * newForall( DeclarationNode * ); 228 static DeclarationNode * newFromTypedef( std::string * );229 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 ); 230 234 static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 231 static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );232 static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );233 static DeclarationNode * newName( std::string * );234 static DeclarationNode * newFromTypeGen( std::string *, ExpressionNode * params );235 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 * ); 236 240 static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts ); 237 241 static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params ); 238 static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams );242 static DeclarationNode * newTypeDecl( const std::string * name, DeclarationNode * typeParams ); 239 243 static DeclarationNode * newPointer( DeclarationNode * qualifiers, OperKinds kind ); 240 244 static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic ); … … 243 247 static DeclarationNode * newTuple( DeclarationNode * members ); 244 248 static DeclarationNode * newTypeof( ExpressionNode * expr ); 245 static DeclarationNode * newAttr( std::string *, ExpressionNode * expr ); // @ attributes246 static DeclarationNode * newAttr( std::string *, DeclarationNode * type ); // @ attributes247 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 248 252 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 249 253 static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression * message ); … … 399 403 }; 400 404 405 Expression * build_if_control( IfCtl * ctl, std::list< Statement * > & init ); 401 406 Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ); 402 407 Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt ); 403 408 Statement * build_case( ExpressionNode * ctl ); 404 409 Statement * build_default(); 405 Statement * build_while( ExpressionNode * ctl, StatementNode * stmt, bool kind = false ); 410 Statement * build_while( IfCtl * ctl, StatementNode * stmt ); 411 Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt ); 406 412 Statement * build_for( ForCtl * forctl, StatementNode * stmt ); 407 413 Statement * build_branch( BranchStmt::Type kind );
Note:
See TracChangeset
for help on using the changeset viewer.