checkState(argument.getKind().equals(ASSIGNMENT)); JCAssign assignment = (JCAssign) argument; checkState(getSymbol(assignment.getVariable()).getSimpleName().contentEquals("type")); String typeName = getSymbol(assignment.getExpression()).getSimpleName().toString(); switch (typeName) {
if (!Objects.equals(ASTHelpers.getSymbol(assign.getVariable()), info.sym())) { return Description.NO_MATCH;
LambdaTranslationContext(JCLambda tree) { super(tree); Frame frame = frameStack.head; switch (frame.tree.getTag()) { case VARDEF: assignedTo = self = ((JCVariableDecl) frame.tree).sym; break; case ASSIGN: self = null; assignedTo = TreeInfo.symbol(((JCAssign) frame.tree).getVariable()); break; default: assignedTo = self = null; break; } // This symbol will be filled-in in complete this.translatedSym = makePrivateSyntheticMethod(0, null, null, owner.enclClass()); translatedSymbols = new EnumMap<>(LambdaSymbolKind.class); translatedSymbols.put(PARAM, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(LOCAL_VAR, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(CAPTURED_VAR, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(CAPTURED_THIS, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(CAPTURED_OUTER_THIS, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(TYPE_VAR, new LinkedHashMap<Symbol, Symbol>()); freeVarProcessedLocalClasses = new HashSet<>(); }
JCTree.JCExpression variable = assign.getVariable();
checkState(argument.getKind().equals(ASSIGNMENT)); JCAssign assignment = (JCAssign) argument; checkState(getSymbol(assignment.getVariable()).getSimpleName().contentEquals("type")); String typeName = getSymbol(assignment.getExpression()).getSimpleName().toString(); switch (typeName) {
if (!Objects.equals(ASTHelpers.getSymbol(assign.getVariable()), info.sym())) { return Description.NO_MATCH;
LambdaTranslationContext(JCLambda tree) { super(tree); Frame frame = frameStack.head; switch (frame.tree.getTag()) { case VARDEF: assignedTo = self = ((JCVariableDecl) frame.tree).sym; break; case ASSIGN: self = null; assignedTo = TreeInfo.symbol(((JCAssign) frame.tree).getVariable()); break; default: assignedTo = self = null; break; } // This symbol will be filled-in in complete this.translatedSym = makePrivateSyntheticMethod(0, null, null, owner.enclClass()); if (dumpLambdaToMethodStats) { log.note(tree, "lambda.stat", needsAltMetafactory(), translatedSym); } translatedSymbols = new EnumMap<>(LambdaSymbolKind.class); translatedSymbols.put(PARAM, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(LOCAL_VAR, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(CAPTURED_VAR, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(CAPTURED_THIS, new LinkedHashMap<Symbol, Symbol>()); translatedSymbols.put(TYPE_VAR, new LinkedHashMap<Symbol, Symbol>()); }
@Override public void visitAnnotation(JCAnnotation node) { Annotation a = new Annotation(); a.rawAnnotationTypeReference(toTree(node.getAnnotationType(), FlagKey.TYPE_REFERENCE)); for (JCExpression elem : node.getArguments()) { AnnotationElement e = new AnnotationElement(); if (elem instanceof JCAssign) { JCExpression rawName = ((JCAssign) elem).getVariable(); if (rawName instanceof JCIdent) e.astName(setPos(rawName, new Identifier().astValue(((JCIdent)rawName).getName().toString()))); elem = ((JCAssign) elem).getExpression(); } e.rawValue(toTree(elem)); a.astElements().addToEnd(e); } set(node, a); } }
@Override public void visitAnnotation(JCAnnotation node) { Annotation a = new Annotation(); a.rawAnnotationTypeReference(toTree(node.getAnnotationType(), FlagKey.TYPE_REFERENCE)); for (JCExpression elem : node.getArguments()) { AnnotationElement e = new AnnotationElement(); if (elem instanceof JCAssign) { JCExpression rawName = ((JCAssign) elem).getVariable(); if (rawName instanceof JCIdent) e.astName(setPos(rawName, new Identifier().astValue(((JCIdent)rawName).getName().toString()))); elem = ((JCAssign) elem).getExpression(); } e.rawValue(toTree(elem)); a.astElements().addToEnd(e); } set(node, a); } }
@Override public void visitAnnotation(JCAnnotation node) { Annotation a = new Annotation(); a.rawAnnotationTypeReference(toTree(node.getAnnotationType(), FlagKey.TYPE_REFERENCE)); for (JCExpression elem : node.getArguments()) { AnnotationElement e = new AnnotationElement(); if (elem instanceof JCAssign) { JCExpression rawName = ((JCAssign) elem).getVariable(); if (rawName instanceof JCIdent) e.astName(setPos(rawName, new Identifier().astValue(((JCIdent)rawName).getName().toString()))); elem = ((JCAssign) elem).getExpression(); } e.rawValue(toTree(elem)); a.astElements().addToEnd(e); } set(node, a); } }
@Override public Choice<State<JCAssign>> visitAssignment(final AssignmentTree node, State<?> state) { return chooseSubtrees( state, s -> unifyExpression(node.getVariable(), s), s -> unifyExpression(node.getExpression(), s), maker()::Assign) .condition(s -> !(s.result().getVariable() instanceof PlaceholderParamIdent)); }
@Override public void visitAssign(JCAssign node) { BinaryExpression expr = new BinaryExpression(); expr.rawRight(toTree(node.getExpression())); expr.rawLeft(toTree(node.getVariable())); expr.astOperator(BinaryOperator.ASSIGN); set(node, expr); }
@Override public void visitAssign(JCAssign node) { BinaryExpression expr = new BinaryExpression(); expr.rawRight(toTree(node.getExpression())); expr.rawLeft(toTree(node.getVariable())); expr.astOperator(BinaryOperator.ASSIGN); set(node, expr); }
@Override public void visitAssign(JCAssign node) { BinaryExpression expr = new BinaryExpression(); expr.rawRight(toTree(node.getExpression())); expr.rawLeft(toTree(node.getVariable())); expr.astOperator(BinaryOperator.ASSIGN); set(node, expr); }
@Override public Choice<State<JCAssign>> visitAssignment(final AssignmentTree node, State<?> state) { return chooseSubtrees( state, s -> unifyExpression(node.getVariable(), s), s -> unifyExpression(node.getExpression(), s), maker()::Assign) .condition(s -> !(s.result().getVariable() instanceof PlaceholderParamIdent)); }