private static SymbolList convertList(LinkedList<String> tokens) { List<Symbol> contents = new ArrayList<>(); tokens.removeFirst(); while (!tokens.getFirst().equals(")")) { contents.add(convert(tokens)); } tokens.removeFirst(); return SymbolPool.getList(contents); }
private static SymbolAtom convertAtom(LinkedList<String> tokens) { return SymbolPool.getAtom(tokens.removeFirst()); }