@Override protected void ensureTypeNode() { if (typeNode == null && isRest()) { typeNode = new IdentifierNode(IASLanguageConstants.Array); typeNode.span(-1, -1, -1, -1); return; } super.ensureTypeNode(); }
@Override VariableDefinition buildDefinition() { ConfigDefinition definition = new ConfigDefinition(nameNode.computeSimpleReference()); definition.setNode(this); fillInNamespaceAndModifiers(definition); setDefinition(definition); definition.setInitializer(this.getAssignedValueNode()); return (VariableDefinition)definition; }
@Override public boolean hasBody() { ScopedBlockNode sbn = getScopedNode(); return sbn.getChildCount() > 0 || sbn.getContainerType() != IContainerNode.ContainerType.SYNTHESIZED; }
@Override // TODO Why does this class have to override this method // when others don't? public void setRightOperandNode(ExpressionNodeBase right) { super.setRightOperandNode(right); if (right != null) setEnd(right.getAbsoluteEnd()); }
private static boolean isInsideDisabledConfigBlock(FunctionNode fn) { ConfigConditionBlockNode configBlock = (ConfigConditionBlockNode)fn.getAncestorOfType(ConfigConditionBlockNode.class); if (configBlock != null && configBlock.getChildCount() == 0) return true; return false; }
@Override public String getNamespace() { VariableNode varNode = (VariableNode)this.getAncestorOfType(VariableNode.class); if (varNode != null) return varNode.getNamespace(); return null; }
@Override public ModifiersContainerNode getModifiersContainer() { VariableNode varNode = getMainVariableNode(); if (varNode != null) return varNode.getModifiersContainer(); return null; }
@Override public boolean isConst() { VariableNode varNode = (VariableNode)this.getAncestorOfType(VariableNode.class); if (varNode != null) return varNode.isConst(); return false; }
@Override public String getOperatorText() { switch (getNodeID()) { case E4XFilterID: return ".()"; default: return super.getOperatorText(); } }
@Override public void setParent(NodeBase parent) { super.setParent(parent); if (parent != null) connectedToProjectScope(); }
@Override public boolean hasExplicitComment() { // Get the comment from the Containing var node - comments apply to all chained // variable in one decl VariableNode varNode = (VariableNode)this.getAncestorOfType(VariableNode.class); if (varNode != null) return varNode.hasExplicitComment(); return super.hasExplicitComment(); }
@Override public INamespaceDecorationNode getNamespaceNode() { VariableNode varNode = getMainVariableNode(); if (varNode != null) return varNode.getNamespaceNode(); return null; }
@Override public ModifiersSet getModifiers() { VariableNode varNode = getMainVariableNode(); if (varNode != null) return varNode.getModifiers(); return null; }
@Override VariableDefinition buildDefinition() { ConfigDefinition definition = new ConfigDefinition(nameNode.computeSimpleReference()); definition.setNode(this); fillInNamespaceAndModifiers(definition); setDefinition(definition); definition.setInitializer(this.getAssignedValueNode()); return (VariableDefinition)definition; }
@Override protected void ensureTypeNode() { if (typeNode == null && isRest()) { typeNode = new IdentifierNode(IASLanguageConstants.Array); typeNode.span(-1, -1, -1, -1); return; } super.ensureTypeNode(); }
@Override // TODO Why does this class have to override this method // when others don't? public void setRightOperandNode(ExpressionNodeBase right) { super.setRightOperandNode(right); if (right != null) setEnd(right.getAbsoluteEnd()); }