String value = line.substring(pos3 + 1); table.add(new Symbol(className, name, type, value));
/** * Merges a list of tables into a single table. The merge is order-sensitive: when multiple * symbols with the same class / name exist in multiple tables, the first one will be used. * * @param tables the tables to merge * @return the table with the result of the merge; this table will have the package / name of * the first table in {@code tables}, or the default one if there are no tables in * {@code tables} */ @NonNull public static SymbolTable merge(@NonNull List<SymbolTable> tables) { SymbolTable.Builder builder = SymbolTable.builder(); boolean first = true; for (SymbolTable t : tables) { if (first) { builder.tablePackage(t.getTablePackage()); builder.tableName(t.getTableName()); first = false; } for (Symbol s : t.allSymbols()) { if (!builder.contains(s)) { builder.add(s); } } } return builder.build(); }