public final void endVisit(final SingleVariableDeclaration node) { final ConstraintVariable2 ancestor= (ConstraintVariable2) node.getType().getProperty(PROPERTY_CONSTRAINT_VARIABLE); if (ancestor != null) { node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, ancestor); final Expression expression= node.getInitializer(); if (expression != null) { final ConstraintVariable2 descendant= (ConstraintVariable2) expression.getProperty(PROPERTY_CONSTRAINT_VARIABLE); if (descendant != null) fModel.createSubtypeConstraint(descendant, ancestor); } } }
@Override public final void endVisit(final SingleVariableDeclaration node) { final ConstraintVariable2 ancestor= (ConstraintVariable2) node.getType().getProperty(PROPERTY_CONSTRAINT_VARIABLE); if (ancestor != null) { node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, ancestor); final Expression expression= node.getInitializer(); if (expression != null) { final ConstraintVariable2 descendant= (ConstraintVariable2) expression.getProperty(PROPERTY_CONSTRAINT_VARIABLE); if (descendant != null) fModel.createSubtypeConstraint(descendant, ancestor); } } }
@Override public final void endVisit(final SingleVariableDeclaration node) { final ConstraintVariable2 ancestor= (ConstraintVariable2) node.getType().getProperty(PROPERTY_CONSTRAINT_VARIABLE); if (ancestor != null) { node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, ancestor); final Expression expression= node.getInitializer(); if (expression != null) { final ConstraintVariable2 descendant= (ConstraintVariable2) expression.getProperty(PROPERTY_CONSTRAINT_VARIABLE); if (descendant != null) fModel.createSubtypeConstraint(descendant, ancestor); } } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
public VariableDeclaration(CompilationUnit cu, String filePath, SingleVariableDeclaration fragment) { this.locationInfo = new LocationInfo(cu, filePath, fragment); this.variableName = fragment.getName().getIdentifier(); this.initializer = fragment.getInitializer() != null ? new AbstractExpression(cu, filePath, fragment.getInitializer()) : null; this.type = UMLType.extractTypeObject(UMLType.getTypeName(extractType(fragment), fragment.getExtraDimensions())); this.variableDeclarationType = extractVariableDeclarationType(fragment); int startOffset = fragment.getStartPosition(); ASTNode scopeNode = getScopeNode(fragment); int endOffset = scopeNode.getStartPosition() + scopeNode.getLength(); this.scope = new VariableScope(cu, filePath, startOffset, endOffset); }
public void endVisit(SingleVariableDeclaration node) { if (skipNode(node)) return; IVariableBinding binding= node.resolveBinding(); LocalFlowInfo nameInfo= null; Expression initializer= node.getInitializer(); if (binding != null && !binding.isField() && initializer != null) { nameInfo= new LocalFlowInfo(binding, FlowInfo.WRITE, fFlowContext); } GenericSequentialFlowInfo info= processSequential(node, node.getType(), initializer); info.merge(nameInfo, fFlowContext); }
@Override public void endVisit(SingleVariableDeclaration node) { if (skipNode(node)) return; IVariableBinding binding= node.resolveBinding(); LocalFlowInfo nameInfo= null; Expression initializer= node.getInitializer(); if (binding != null && !binding.isField() && initializer != null) { nameInfo= new LocalFlowInfo(binding, FlowInfo.WRITE, fFlowContext); } GenericSequentialFlowInfo info= processSequential(node, node.getType(), initializer); info.merge(nameInfo, fFlowContext); }
@Override public void endVisit(SingleVariableDeclaration node) { if (skipNode(node)) { return; } IVariableBinding binding = node.resolveBinding(); LocalFlowInfo nameInfo = null; Expression initializer = node.getInitializer(); if (binding != null && !binding.isField() && initializer != null) { nameInfo = new LocalFlowInfo(binding, FlowInfo.WRITE, fFlowContext); } GenericSequentialFlowInfo info = processSequential(node, node.getType(), initializer); info.merge(nameInfo, fFlowContext); }
@Override public void endVisit(SingleVariableDeclaration node) { if (skipNode(node)) return; IVariableBinding binding= node.resolveBinding(); LocalFlowInfo nameInfo= null; Expression initializer= node.getInitializer(); if (binding != null && !binding.isField() && initializer != null) { nameInfo= new LocalFlowInfo(binding, FlowInfo.WRITE, fFlowContext); } GenericSequentialFlowInfo info= processSequential(node, node.getType(), initializer); info.merge(nameInfo, fFlowContext); }
public boolean visit(SingleVariableDeclaration node) { IValue name = values.string(node.getName().getFullyQualifiedName()); IValueList extendedModifiers = parseExtendedModifiers(node.modifiers()); IValue type = visitChild(node.getType()); IValue initializer = node.getInitializer() == null ? null : visitChild(node.getInitializer()); ownValue = constructDeclarationNode("parameter", type, name, values.integer(node.getExtraDimensions()), initializer); if (node.getAST().apiLevel() >= AST.JLS3 && node.isVarargs()) ownValue = constructDeclarationNode("vararg", type, name); setKeywordParameters("modifiers", extendedModifiers); return false; }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); acceptChild(visitor, getName()); acceptChild(visitor, getInitializer()); } visitor.endVisit(this); }
@Override int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.varargsAnnotations == null ? 0 : this.varargsAnnotations.listSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.extraDimensions == null ? 0 : this.extraDimensions.listSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.varargsAnnotations == null ? 0 : this.varargsAnnotations.listSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.extraDimensions == null ? 0 : this.extraDimensions.listSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.varargsAnnotations == null ? 0 : this.varargsAnnotations.listSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.extraDimensions == null ? 0 : this.extraDimensions.listSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.varargsAnnotations == null ? 0 : this.varargsAnnotations.listSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.extraDimensions == null ? 0 : this.extraDimensions.listSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
int treeSize() { return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) + (this.varargsAnnotations == null ? 0 : this.varargsAnnotations.listSize()) + (this.variableName == null ? 0 : getName().treeSize()) + (this.extraDimensions == null ? 0 : this.extraDimensions.listSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); } }
@Override void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL && isVarargs()) { acceptChildren(visitor, this.varargsAnnotations); } acceptChild(visitor, getName()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL){ acceptChildren(visitor, this.extraDimensions); } acceptChild(visitor, getInitializer()); } visitor.endVisit(this); }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); if (this.ast.apiLevel >= AST.JLS8 && isVarargs()) { acceptChildren(visitor, this.varargsAnnotations); } acceptChild(visitor, getName()); if (this.ast.apiLevel >= AST.JLS8){ acceptChildren(visitor, this.extraDimensions); } acceptChild(visitor, getInitializer()); } visitor.endVisit(this); }
void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); if (visitChildren) { // visit children in normal left to right reading order if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { acceptChildren(visitor, this.modifiers); } acceptChild(visitor, getType()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL && isVarargs()) { acceptChildren(visitor, this.varargsAnnotations); } acceptChild(visitor, getName()); if (this.ast.apiLevel >= AST.JLS8_INTERNAL){ acceptChildren(visitor, this.extraDimensions); } acceptChild(visitor, getInitializer()); } visitor.endVisit(this); }
ASTNode clone0(AST target) { SingleVariableDeclaration result = new SingleVariableDeclaration(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { result.setModifiers(getModifiers()); } else { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); result.setVarargs(isVarargs()); } result.setType((Type) getType().clone(target)); result.setExtraDimensions(getExtraDimensions()); result.setName((SimpleName) getName().clone(target)); result.setInitializer( (Expression) ASTNode.copySubtree(target, getInitializer())); return result; }