private Symbol resolveUnion(Schema writer, Schema reader, Map<LitS, Symbol> seen) throws IOException { boolean needsAdj = ! unionEquiv(writer, reader, new HashMap<>()); List<Schema> alts2 = (!needsAdj ? reader.getTypes() : null); List<Schema> alts = writer.getTypes(); final int size = alts.size(); Symbol[] symbols = new Symbol[size]; String[] labels = new String[size]; /** * We construct a symbol without filling the arrays. Please see * {@link Symbol#production} for the reason. */ int i = 0; for (Schema w : alts) { symbols[i] = generate(w, (needsAdj ? reader : alts2.get(i)), seen); labels[i] = w.getFullName(); i++; } if (! needsAdj) return Symbol.seq(Symbol.alt(symbols, labels), Symbol.UNION); return Symbol.seq(Symbol.alt(symbols, labels), Symbol.WRITER_UNION_ACTION); }
private Symbol resolveUnion(Schema writer, Schema reader, Map<LitS, Symbol> seen) throws IOException { List<Schema> alts = writer.getTypes(); final int size = alts.size(); Symbol[] symbols = new Symbol[size]; String[] labels = new String[size]; /** * We construct a symbol without filling the arrays. Please see * {@link Symbol#production} for the reason. */ int i = 0; for (Schema w : alts) { symbols[i] = generate(w, reader, seen); labels[i] = w.getFullName(); i++; } return Symbol.seq(Symbol.alt(symbols, labels), Symbol.writerUnionAction()); }
i++; return Symbol.seq(Symbol.alt(symbols, labels), Symbol.UNION);
i++; return Symbol.seq(Symbol.alt(symbols, labels), Symbol.UNION);
private Symbol resolveUnion(Schema writer, Schema reader, Map<LitS, Symbol> seen) throws IOException { List<Schema> alts = writer.getTypes(); final int size = alts.size(); Symbol[] symbols = new Symbol[size]; String[] labels = new String[size]; /** * We construct a symbol without filling the arrays. Please see * {@link Symbol#production} for the reason. */ int i = 0; for (Schema w : alts) { symbols[i] = generate(w, reader, seen); labels[i] = w.getName(); i++; } return Symbol.seq(Symbol.alt(symbols, labels), new Symbol.WriterUnionAction()); }
private Symbol resolveUnion(Schema writer, Schema reader, Map<LitS, Symbol> seen) throws IOException { List<Schema> alts = writer.getTypes(); final int size = alts.size(); Symbol[] symbols = new Symbol[size]; String[] labels = new String[size]; /** * We construct a symbol without filling the arrays. Please see * {@link Symbol#production} for the reason. */ int i = 0; for (Schema w : alts) { symbols[i] = generate(w, reader, seen); labels[i] = w.getName(); i++; } return Symbol.seq(Symbol.alt(symbols, labels), new Symbol.WriterUnionAction()); }
private Symbol resolveUnion(Schema writer, Schema reader, Map<LitS, Symbol> seen) throws IOException { List<Schema> alts = writer.getTypes(); final int size = alts.size(); Symbol[] symbols = new Symbol[size]; String[] labels = new String[size]; /** * We construct a symbol without filling the arrays. Please see * {@link Symbol#production} for the reason. */ int i = 0; for (Schema w : alts) { symbols[i] = generate(w, reader, seen); labels[i] = w.getFullName(); i++; } return Symbol.seq(Symbol.alt(symbols, labels), Symbol.writerUnionAction()); }
private Symbol resolveUnion(Schema writer, Schema reader, Map<LitS, Symbol> seen) throws IOException { List<Schema> alts = writer.getTypes(); final int size = alts.size(); Symbol[] symbols = new Symbol[size]; String[] labels = new String[size]; /** * We construct a symbol without filling the arrays. Please see * {@link Symbol#production} for the reason. */ int i = 0; for (Schema w : alts) { symbols[i] = generate(w, reader, seen); labels[i] = w.getFullName(); i++; } return Symbol.seq(Symbol.alt(symbols, labels), Symbol.writerUnionAction()); }
i++; return Symbol.seq(Symbol.alt(symbols, labels), Symbol.UNION);
i++; return Symbol.seq(Symbol.alt(symbols, labels), Symbol.UNION);
i++; return Symbol.seq(Symbol.alt(symbols, labels), Symbol.UNION);
i++; return Symbol.seq(Symbol.alt(symbols, labels), Symbol.UNION);