public static String visitDereferenceExpression(DereferenceExpression node){ if(node.getBase() instanceof Identifier) { return ((Identifier)node.getBase()).getName()/*.getValue()*/+"."+node.getFieldName()/*.getValue()*/; }else return visitDereferenceExpression((DereferenceExpression)node.getBase())+"."+node.getFieldName()/*.getValue()*/; }
@Override protected String visitDereferenceExpression(DereferenceExpression node, Boolean unmangleNames) { String baseString = process(node.getBase(), unmangleNames); return baseString + "." + formatIdentifier(node.getFieldName()); }
@Override protected String visitDereferenceExpression(DereferenceExpression node, Boolean unmangleNames) { String baseString = process(node.getBase(), unmangleNames); return baseString + "." + formatIdentifier(node.getFieldName()); }
if (rowField.getName().equals(Optional.of(node.getFieldName()))) { rowFieldType = rowField.getType(); break;
@Override public Expression rewriteDereferenceExpression(DereferenceExpression node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { if (analysis.getFieldIndex(node).isPresent()) { return rewriteExpressionWithResolvedName(node); } // Rewrite all row field reference to function call. QualifiedName mangledName = QualifiedName.of(mangleFieldReference(node.getFieldName())); FunctionCall functionCall = new FunctionCall(mangledName, ImmutableList.of(node.getBase())); // hackish - add type for created node to analysis object so further rewriting does not fail IdentityHashMap<Expression, Type> functionType = new IdentityHashMap<>(); functionType.put(functionCall, analysis.getType(node)); analysis.addTypes(functionType); Expression rewrittenExpression = rewriteFunctionCall(functionCall, context, treeRewriter); // cast expression if coercion is registered Type type = analysis.getType(node); Type coercion = analysis.getCoercion(node); if (coercion != null) { rewrittenExpression = new Cast( rewrittenExpression, coercion.getTypeSignature().toString(), false, isTypeOnlyCoercion(type.getTypeSignature(), coercion.getTypeSignature())); } return rewrittenExpression; } }, expression);
@Override public Expression rewriteDereferenceExpression(DereferenceExpression node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { if (analysis.getColumnReferences().contains(node)) { return rewriteExpression(node, context, treeRewriter); } // Rewrite all row field reference to function call. QualifiedName mangledName = QualifiedName.of(mangleFieldReference(node.getFieldName())); FunctionCall functionCall = new FunctionCall(mangledName, ImmutableList.of(node.getBase())); Expression rewrittenExpression = rewriteFunctionCall(functionCall, context, treeRewriter); // cast expression if coercion is registered Type coercion = analysis.getCoercion(node); if (coercion != null) { rewrittenExpression = new Cast(rewrittenExpression, coercion.getTypeSignature().toString()); } return rewrittenExpression; } }, parsedExpression);