* find all the functions directly called in this statement */
| 758 | * find all the functions directly called in this statement |
| 759 | */ |
| 760 | const FunctionInvocation* |
| 761 | Statement::get_direct_invocation(void) const |
| 762 | { |
| 763 | if (eType == eAssign) { |
| 764 | const Expression* e = ((const StatementAssign*)this)->get_expr(); |
| 765 | if (e->term_type == eFunction) { |
| 766 | return ((const ExpressionFuncall*)e)->get_invoke(); |
| 767 | } |
| 768 | } |
| 769 | else if (eType == eInvoke) { |
| 770 | return ((const StatementExpr*)this)->get_invoke(); |
| 771 | } |
| 772 | else if (eType == eIfElse) { |
| 773 | const StatementIf* si = (const StatementIf*)this; |
| 774 | const Expression* e = si->get_test(); |
| 775 | if (e->term_type == eFunction) { |
| 776 | return ((const ExpressionFuncall*)e)->get_invoke(); |
| 777 | } |
| 778 | } |
| 779 | return NULL; |
| 780 | } |
| 781 | |
| 782 | /* |
| 783 | * find all the function calls in this statement |
no test coverage detected