Checks if this expression has free variables. @return true if there are variables which are used but not declared in this expression, false otherwise
()
| 439 | * {@code false} otherwise |
| 440 | */ |
| 441 | public boolean hasFreeVars() { |
| 442 | final BitSet declared = new BitSet(); |
| 443 | return !accept(new ASTVisitor() { |
| 444 | @Override |
| 445 | public boolean declared(final Var var) { |
| 446 | declared.set(var.id); |
| 447 | return true; |
| 448 | } |
| 449 | |
| 450 | @Override |
| 451 | public boolean used(final VarRef ref) { |
| 452 | return declared.get(ref.var.id); |
| 453 | } |
| 454 | }); |
| 455 | } |
| 456 | |
| 457 | /** |
| 458 | * Tries to merge two expressions that are part of an EBV test. |