ConsumptionState consume(JCStatement impl) { return new AutoValue_UPlaceholderStatement_ConsumptionState( consumedStatements() + 1, placeholderImplInReverseOrder().prepend(impl)); } }
private Choice<State<PlaceholderParamIdent>> unifyParam( final UVariableDecl placeholderParam, UExpression placeholderArg, ExpressionTree toUnify, final State<?> state) { return placeholderArg .unify(toUnify, state.unifier()) .transform( (Unifier unifier) -> State.create( state.seenParameters().prepend(placeholderParam), unifier, new PlaceholderParamIdent(placeholderParam, unifier.getContext()))); }
statements.subList(consumedStatements, statements.size()), context) .transform(list -> list.prepend(match));
public Choice<State<List<JCTree>>> unify( @Nullable Iterable<? extends Tree> nodes, State<?> state) { if (nodes == null) { return Choice.of(state.<List<JCTree>>withResult(null)); } Choice<State<List<JCTree>>> choice = Choice.of(state.withResult(List.<JCTree>nil())); for (final Tree node : nodes) { choice = choice.thenChoose( (State<List<JCTree>> s) -> unify(node, s) .transform( treeState -> treeState.withResult(s.result().prepend(treeState.result())))); } return choice.transform(s -> s.withResult(s.result().reverse())); }
/** Prepend an element to buffer. */ public ListBuffer<A> prepend(A x) { elems = elems.prepend(x); count++; return this; }
/** Prepend an element to buffer. */ public ListBuffer<A> prepend(A x) { elems = elems.prepend(x); if (last == null) last = elems; count++; return this; }
/** Add a new resource bundle to the list that is searched for localized messages. * Resource bundles will be searched in reverse order in which they are added. * @param bundle the bundle of localized messages. */ public void add(ResourceBundle bundle) { bundles = bundles.prepend(bundle); }
private List<Attribute.TypeCompound> getTypePlaceholders() { List<Attribute.TypeCompound> res = List.<Attribute.TypeCompound>nil(); for (Attribute.TypeCompound a : type_attributes) { if (a instanceof Placeholder) { res = res.prepend(a); } } return res.reverse(); }
ConsumptionState consume(JCStatement impl) { return new AutoValue_UPlaceholderStatement_ConsumptionState( consumedStatements() + 1, placeholderImplInReverseOrder().prepend(impl)); } }
public java.util.List<Symbol> getEnclosedElements() { List<Symbol> list = List.nil(); for (Scope.Entry e = members().elems; e != null; e = e.sibling) { if (e.sym != null && (e.sym.flags() & SYNTHETIC) == 0 && e.sym.owner == this) list = list.prepend(e.sym); } return list; }
/** Return all exceptions in thrown list that are not in handled list. * @param thrown The list of thrown exceptions. * @param handled The list of handled exceptions. */ List<Type> unhandled(List<Type> thrown, List<Type> handled) { List<Type> unhandled = List.nil(); for (List<Type> l = thrown; l.nonEmpty(); l = l.tail) if (!isHandled(l.head, handled)) unhandled = unhandled.prepend(l.head); return unhandled; }
public static List<Name> enclosingCandidates(Name name) { List<Name> names = List.nil(); int index; while ((index = name.lastIndexOf((byte)'$')) > 0) { name = name.subName(0, index); names = names.prepend(name); } return names; } }
/** Return all exceptions in thrown list that are not in handled list. * @param thrown The list of thrown exceptions. * @param handled The list of handled exceptions. */ List<Type> unHandled(List<Type> thrown, List<Type> handled) { List<Type> unhandled = List.nil(); for (List<Type> l = thrown; l.nonEmpty(); l = l.tail) if (!isHandled(l.head, handled)) unhandled = unhandled.prepend(l.head); return unhandled; }
private List<ClassSymbol> getTopLevelClassesFromClasses(List<? extends ClassSymbol> syms) { List<ClassSymbol> classes = List.nil(); for (ClassSymbol sym : syms) { if (!isPkgInfo(sym)) { classes = classes.prepend(sym); } } return classes.reverse(); }
void writeMethods(Scope.Entry e) { List<MethodSymbol> methods = List.nil(); for (Scope.Entry i = e; i != null; i = i.sibling) { if (i.sym.kind == MTH && (i.sym.flags() & HYPOTHETICAL) == 0) methods = methods.prepend((MethodSymbol)i.sym); } while (methods.nonEmpty()) { writeMethod(methods.head); methods = methods.tail; } }
List<Type> subst(List<Type> ts) { if (from.tail == null) return ts; boolean wild = false; if (ts.nonEmpty() && from.nonEmpty()) { Type head1 = subst(ts.head); List<Type> tail1 = subst(ts.tail); if (head1 != ts.head || tail1 != ts.tail) return tail1.prepend(head1); } return ts; }
void writeMethods(Scope.Entry e) { List<MethodSymbol> methods = List.nil(); for (Scope.Entry i = e; i != null; i = i.sibling) { if (i.sym.kind == MTH && (i.sym.flags() & HYPOTHETICAL) == 0) methods = methods.prepend((MethodSymbol)i.sym); } while (methods.nonEmpty()) { writeMethod(methods.head); methods = methods.tail; } }
@Override public java.util.List<Symbol> getEnclosedElements() { List<Symbol> list = List.nil(); if (kind == TYP && type.hasTag(TYPEVAR)) { return list; } for (Scope.Entry e = members().elems; e != null; e = e.sibling) { if (e.sym != null && (e.sym.flags() & SYNTHETIC) == 0 && e.sym.owner == this) list = list.prepend(e.sym); } return list; }