Checks if the given variable is used by this expression. @param var variable to be checked @return true if the variable is used
(final Var var)
| 240 | * @return {@code true} if the variable is used |
| 241 | */ |
| 242 | public final boolean uses(final Var var) { |
| 243 | // return true iff the search was aborted, i.e. the variable is used |
| 244 | return !accept(new ASTVisitor() { |
| 245 | @Override |
| 246 | public boolean used(final VarRef ref) { |
| 247 | // abort when the variable is used |
| 248 | return ref.var != var; |
| 249 | } |
| 250 | }); |
| 251 | } |
| 252 | |
| 253 | /** |
| 254 | * Checks if inlining is possible. |
no test coverage detected