Changes in src/Parser/ParseNode.h [9a705dc8:8d7bef2]
- File:
-
- 1 edited
-
src/Parser/ParseNode.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r9a705dc8 r8d7bef2 124 124 125 125 virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override { 126 os << expr .get()<< std::endl;126 os << expr << std::endl; 127 127 } 128 128 void printOneLine( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const {} 129 129 130 130 template<typename T> 131 bool isExpressionType() const { return nullptr != dynamic_cast<T>(expr .get()); }132 133 Expression * build() const { return const_cast<ExpressionNode *>(this)->expr.release(); }131 bool isExpressionType() const { return nullptr != dynamic_cast<T>(expr); } 132 133 Expression * build() const { return expr; } 134 134 private: 135 135 bool extension = false; 136 std::unique_ptr<Expression>expr;136 Expression* expr; 137 137 }; // ExpressionNode 138 138 … … 179 179 180 180 Expression * build_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 181 Expression * build_keyword_cast( KeywordCastExpr::Target target, ExpressionNode * expr_node );182 181 Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 183 182 Expression * build_fieldSel( ExpressionNode * expr_node, Expression * member ); … … 247 246 static DeclarationNode * newAttribute( std::string *, ExpressionNode * expr = nullptr ); // gcc attributes 248 247 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 249 static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression * message );250 248 251 249 DeclarationNode(); … … 315 313 Attr_t attr; 316 314 317 struct StaticAssert_t {318 ExpressionNode * condition;319 Expression * message;320 };321 StaticAssert_t assert;322 323 315 BuiltinType builtin; 324 316 … … 360 352 361 353 virtual StatementNode * clone() const final { assert( false ); return nullptr; } 362 Statement * build() const { return const_cast<StatementNode *>(this)->stmt.release(); }354 Statement * build() const { return stmt; } 363 355 364 356 virtual StatementNode * add_label( const std::string * name, DeclarationNode * attr = nullptr ) { … … 372 364 373 365 virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override { 374 os << stmt .get()<< std::endl;366 os << stmt << std::endl; 375 367 } 376 368 private: 377 std::unique_ptr<Statement>stmt;369 Statement* stmt; 378 370 }; // StatementNode 379 371 … … 400 392 401 393 Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ); 402 Statement * build_switch( bool isSwitch,ExpressionNode * ctl, StatementNode * stmt );394 Statement * build_switch( ExpressionNode * ctl, StatementNode * stmt ); 403 395 Statement * build_case( ExpressionNode * ctl ); 404 396 Statement * build_default();
Note:
See TracChangeset
for help on using the changeset viewer.