mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
accessors and converters for Stmt subclasses
This commit is contained in:
parent
ca33a15626
commit
c380a2a61a
3 changed files with 38 additions and 5 deletions
11
src/Stmt.h
11
src/Stmt.h
|
@ -165,6 +165,7 @@ public:
|
|||
~SwitchStmt() override;
|
||||
|
||||
const case_list* Cases() const { return cases; }
|
||||
bool HasDefault() const { return default_case_idx != -1; }
|
||||
|
||||
void StmtDescribe(ODesc* d) const override;
|
||||
|
||||
|
@ -275,20 +276,20 @@ public:
|
|||
TraversalCode Traverse(TraversalCallback* cb) const override;
|
||||
|
||||
// Optimization-related:
|
||||
StmtPtr CondPredStmt() const
|
||||
{ return loop_cond_pred_stmt; }
|
||||
StmtPtr Duplicate() override;
|
||||
void Inline(Inliner* inl) override;
|
||||
|
||||
bool IsReduced(Reducer* c) const override;
|
||||
StmtPtr DoReduce(Reducer* c) override;
|
||||
|
||||
const ExprPtr& Condition() const { return loop_condition; }
|
||||
StmtPtr CondPredStmt() const { return loop_cond_pred_stmt; }
|
||||
const StmtPtr& Body() const { return body; }
|
||||
const StmtPtr& ConditionAsStmt() const { return stmt_loop_condition; }
|
||||
|
||||
// Note, no need for a NoFlowAfter method because the loop might
|
||||
// execute zero times, so it's always the default of "false".
|
||||
|
||||
const StmtPtr ConditionAsStmt() const
|
||||
{ return stmt_loop_condition; }
|
||||
|
||||
protected:
|
||||
ValPtr Exec(Frame* f, StmtFlowType& flow) const override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue