mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38: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
24
src/Stmt.cc
24
src/Stmt.cc
|
@ -84,6 +84,18 @@ const InitStmt* Stmt::AsInitStmt() const
|
|||
return (const InitStmt*) this;
|
||||
}
|
||||
|
||||
const IfStmt* Stmt::AsIfStmt() const
|
||||
{
|
||||
CHECK_TAG(tag, STMT_IF, "Stmt::AsIfStmt", stmt_name)
|
||||
return (const IfStmt*) this;
|
||||
}
|
||||
|
||||
const WhileStmt* Stmt::AsWhileStmt() const
|
||||
{
|
||||
CHECK_TAG(tag, STMT_WHILE, "Stmt::AsWhileStmt", stmt_name)
|
||||
return (const WhileStmt*) this;
|
||||
}
|
||||
|
||||
const WhenStmt* Stmt::AsWhenStmt() const
|
||||
{
|
||||
CHECK_TAG(tag, STMT_WHEN, "Stmt::AsWhenStmt", stmt_name)
|
||||
|
@ -102,6 +114,18 @@ const ExprStmt* Stmt::AsExprStmt() const
|
|||
return (const ExprStmt*) this;
|
||||
}
|
||||
|
||||
const PrintStmt* Stmt::AsPrintStmt() const
|
||||
{
|
||||
CHECK_TAG(tag, STMT_PRINT, "Stmt::AsPrintStmt", stmt_name)
|
||||
return (const PrintStmt*) this;
|
||||
}
|
||||
|
||||
const CatchReturnStmt* Stmt::AsCatchReturnStmt() const
|
||||
{
|
||||
CHECK_TAG(tag, STMT_CATCH_RETURN, "Stmt::AsCatchReturnStmt", stmt_name)
|
||||
return (const CatchReturnStmt*) this;
|
||||
}
|
||||
|
||||
const ReturnStmt* Stmt::AsReturnStmt() const
|
||||
{
|
||||
CHECK_TAG(tag, STMT_RETURN, "Stmt::AsReturnStmt", stmt_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue