Converting LRL to Java using a Binary Search Tree