private void writeBinding(List<Binding> binding) { if (this.binding != null) binding.add(this.binding); if (parentEnvironment != null) parentEnvironment.writeBinding(binding); }
public List<Binding> getBindings() { LinkedList<Binding> bindings = new LinkedList<>(); writeBinding(bindings); return bindings; }