/** * Returns the first child of the node returned by {@link #getTypeNode()}. * The image of that node can usually be interpreted as the image of the * type. */ // TODO unreliable, not typesafe and not useful, should be deprecated public Node getTypeNameNode() { ASTType type = getTypeNode(); return type == null ? null : getTypeNode().jjtGetChild(0); }
/** * Returns true if the declared variable has an array type. */ public boolean hasArrayType() { return arrayDepth > 0 || !isTypeInferred() && getTypeNode().isArrayType(); }
public int getArrayDepth() { ASTVariableDeclaratorId astVariableDeclaratorId = (ASTVariableDeclaratorId) node; ASTType typeNode = astVariableDeclaratorId.getTypeNode(); if (typeNode != null) { return ((Dimensionable) typeNode.jjtGetParent()).getArrayDepth(); } else { return 0; } }
public boolean isArray() { ASTVariableDeclaratorId astVariableDeclaratorId = (ASTVariableDeclaratorId) node; ASTType typeNode = astVariableDeclaratorId.getTypeNode(); if (typeNode != null) { return ((Dimensionable) typeNode.jjtGetParent()).isArray(); } else { return false; } }
@Override public Object visit(ASTVariableDeclaratorId node, Object data) { if (node == null || node.isTypeInferred()) { return super.visit(node, data); } // Type common to all declarations in the same statement JavaTypeDefinition baseType = node.getTypeNode().getTypeDefinition(); if (baseType != null) { // add the dimensions specific to the declarator id node.setTypeDefinition(baseType.withDimensions(node.getArrayDepth())); } return super.visit(node, data); }
: scope.getDeclarations(VariableNameDeclaration.class).entrySet()) { if (entry.getKey().getImage().equals(image)) { ASTType typeNode = entry.getKey().getDeclaratorId().getTypeNode();
@Override public Object visit(ASTVariableDeclaratorId node, Object data) { ASTType typeNode = node.getTypeNode(); if (typeNode == null || !TypeHelper.isA(typeNode, InputStream.class)) { return data;
/** * Returns the first child of the node returned by {@link #getTypeNode()}. * The image of that node can usually be interpreted as the image of the * type. */ // TODO unreliable, not typesafe and not useful, should be deprecated public Node getTypeNameNode() { ASTType type = getTypeNode(); return type == null ? null : getTypeNode().jjtGetChild(0); }
/** * Returns true if the declared variable has an array type. */ public boolean hasArrayType() { return arrayDepth > 0 || !isTypeInferred() && getTypeNode().isArrayType(); }
public boolean isArray() { ASTVariableDeclaratorId astVariableDeclaratorId = (ASTVariableDeclaratorId) node; ASTType typeNode = astVariableDeclaratorId.getTypeNode(); if (typeNode != null) { return ((Dimensionable) typeNode.jjtGetParent()).isArray(); } else { return false; } }
public int getArrayDepth() { ASTVariableDeclaratorId astVariableDeclaratorId = (ASTVariableDeclaratorId) node; ASTType typeNode = astVariableDeclaratorId.getTypeNode(); if (typeNode != null) { return ((Dimensionable) typeNode.jjtGetParent()).getArrayDepth(); } else { return 0; } }
@Override public Object visit(ASTVariableDeclaratorId node, Object data) { if (node == null || node.isTypeInferred()) { return super.visit(node, data); } // Type common to all declarations in the same statement JavaTypeDefinition baseType = node.getTypeNode().getTypeDefinition(); if (baseType != null) { // add the dimensions specific to the declarator id node.setTypeDefinition(baseType.withDimensions(node.getArrayDepth())); } return super.visit(node, data); }
: scope.getDeclarations(VariableNameDeclaration.class).entrySet()) { if (entry.getKey().getImage().equals(image)) { ASTType typeNode = entry.getKey().getDeclaratorId().getTypeNode();
@Override public Object visit(ASTVariableDeclaratorId node, Object data) { ASTType typeNode = node.getTypeNode(); if (typeNode == null || !TypeHelper.isA(typeNode, InputStream.class)) { return data;