/** * Writes a symbol table to a symbol file. * * @param table the table * @param file the file where the table should be written * @throws UncheckedIOException I/O error */ public static void write(@NonNull SymbolTable table, @NonNull File file) { List<String> lines = new ArrayList<>(); for (Symbol s : table.allSymbols()) { lines.add( s.getJavaType() + " " + s.getResourceType() + " " + s.getName() + " " + s.getValue()); } try ( FileOutputStream fos = new FileOutputStream(file); PrintWriter pw = new PrintWriter(fos)) { lines.forEach(pw::println); } catch (IOException e) { throw new UncheckedIOException(e); } }
+ idModifiers + " " + s.getJavaType() + " " + s.getName()