package org.nwapw.abacus.parsing; import org.nwapw.abacus.tree.TreeNode; import java.util.List; public class TreeBuilder { private Tokenizer tokenizer; private Parser parser; public TreeBuilder(Tokenizer tokenizer, Parser parser){ this.tokenizer = tokenizer; this.parser = parser; } public TreeNode fromString(String input){ List tokens = tokenizer.tokenizeString(input); if(tokens == null) return null; return parser.constructTree(tokens); } }