Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Stmt.hpp

    rf6e6a55 r400b8be  
    1010// Created On       : Wed May  8 13:00:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Apr 20 14:34:00 2022
    13 // Update Count     : 36
     12// Last Modified On : Mon Mar 28  9:50:00 2022
     13// Update Count     : 35
    1414//
    1515
     
    378378class WaitForStmt final : public Stmt {
    379379  public:
    380         std::vector<ptr<WaitForClause>> clauses;
    381         ptr<Expr> timeout_time;
    382         ptr<Stmt> timeout_stmt;
    383         ptr<Expr> timeout_cond;
    384         ptr<Stmt> else_stmt;
    385         ptr<Expr> else_cond;
     380        struct Target {
     381                ptr<Expr> func;
     382                std::vector<ptr<Expr>> args;
     383        };
     384
     385        struct Clause {
     386                Target target;
     387                ptr<Stmt> stmt;
     388                ptr<Expr> cond;
     389        };
     390
     391        struct Timeout {
     392                ptr<Expr> time;
     393                ptr<Stmt> stmt;
     394                ptr<Expr> cond;
     395        };
     396
     397        struct OrElse {
     398                ptr<Stmt> stmt;
     399                ptr<Expr> cond;
     400        };
     401
     402        std::vector<Clause> clauses;
     403        Timeout timeout;
     404        OrElse orElse;
    386405
    387406        WaitForStmt( const CodeLocation & loc, const std::vector<Label> && labels = {} )
     
    392411        WaitForStmt * clone() const override { return new WaitForStmt{ *this }; }
    393412        MUTATE_FRIEND
    394 };
    395 
    396 class WaitForClause final : public StmtClause {
    397   public:
    398     ptr<Expr> target_func;
    399     std::vector<ptr<Expr>> target_args;
    400     ptr<Stmt> stmt;
    401     ptr<Expr> cond;
    402 
    403     WaitForClause( const CodeLocation & loc )
    404                 : StmtClause( loc ) {}
    405 
    406         const WaitForClause * accept( Visitor & v ) const override { return v.visit( this ); }
    407   private:
    408     WaitForClause * clone() const override { return new WaitForClause{ *this }; }
    409     MUTATE_FRIEND
    410413};
    411414
Note: See TracChangeset for help on using the changeset viewer.