/** * Disabled configuration condition block doesn't have children. */ @Override public int getChildCount() { if (enabled) return super.getChildCount(); else return 0; }
/** * Constructor. * * @param keyword The token representing the <code>try</code> keyword. */ public TryNode(IASToken keyword) { super(); startBefore(keyword); contentsBlockNode = new BlockNode(); contentsBlockNode.startAfter((Token)keyword); contentsBlockNode.endAfter(keyword); addChild(contentsBlockNode); }
@Override protected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems) { // Put header statements into the current block conditionsStatementsNode.analyze(set, scope, problems); contentsNode.analyze(set, scope, problems); }
Token closeT = null; BlockNode b = new BlockNode(); enterGroup(); b.startAfter(openT); if(b.getChildCount() > 0) c.addItem(b); closeT = LT(1); match(TOKEN_BLOCK_CLOSE); b.endBefore(closeT); leaveGroup();
b.setContainerType(IContainerNode.ContainerType.BRACES); skipFunctionBody(f, openT); b.endBefore(rbT); b.endAfter(prev); else b.setEnd(b.getStart()); if(handleParsingError(ex)) {
@Override public void emitLabelStatement(LabeledStatementNode node) { BlockNode innerBlock = node.getLabeledStatement(); if (innerBlock.getChildCount() == 1 && innerBlock.getChild(0).getNodeID() == ASTNodeID.ForEachLoopID) { getWalker().walk(node.getLabeledStatement()); return; // for each emitter will emit label in the right spot } super.emitLabelStatement(node); }
lbT = LT(1); match(TOKEN_BLOCK_OPEN); blockNode.startAfter(lbT); functionBlock(f, (ASToken)lbT); blockNode.startBefore(lt); blockNode.endBefore(lt);
/** * Constructor. * * @param labelIdentifierNode The node representing the label. */ public LabeledStatementNode(NonResolvingIdentifierNode labelIdentifierNode) { this.labelIdentifierNode = labelIdentifierNode; labeledStatement = new BlockNode(); }
@Override protected boolean buildInnerString(StringBuilder sb) { sb.append(enabled ? "(enabled) " : "(disabled) "); return super.buildInnerString(sb); }
/** * Get the scope associated with this node as an IASScope * * @return scope associated with this node */ public IASScope getScope() { IASNode parent = getParent(); while (parent != null) { if (parent instanceof IScopedNode) return ((IScopedNode)parent).getScope(); parent = parent.getParent(); } return null; } }
args.addItem(newBytes); BinaryOperatorNodeBase assignmentBytes = BinaryOperatorNodeBase.create(assignToken, new IdentifierNode("bytes"), byteArrayCall); ifContents.addItem(assignmentBytes);
Token closeT = null; BlockNode b = new BlockNode(); enterGroup(); b.startAfter(openT); if(b.getChildCount() > 0) c.addItem(b); closeT = LT(1); match(TOKEN_BLOCK_CLOSE); b.endBefore(closeT); leaveGroup();
b.setContainerType(IContainerNode.ContainerType.BRACES); skipFunctionBody(f, openT); b.endBefore(rbT); b.endAfter(prev); else b.setEnd(b.getStart()); if(handleParsingError(ex)) {
int childCount = contents.getChildCount(); boolean found = false; for (int i = 0; i < childCount; i++) IASNode child = contents.getChild(i); if (found) IASNode child = contents.getChild(i); if (child instanceof IDefinitionNode)
lbT = LT(1); match(TOKEN_BLOCK_OPEN); blockNode.startAfter(lbT); functionBlock(f, (ASToken)lbT); blockNode.startBefore(lt); blockNode.endBefore(lt);
/** * Constructor. * * @param labelIdentifierNode The node representing the label. */ public LabeledStatementNode(NonResolvingIdentifierNode labelIdentifierNode) { this.labelIdentifierNode = labelIdentifierNode; labeledStatement = new BlockNode(); }
@Override protected boolean buildInnerString(StringBuilder sb) { sb.append(enabled ? "(enabled) " : "(disabled) "); return super.buildInnerString(sb); }
/** * Get the scope associated with this node as an IASScope * * @return scope associated with this node */ public IASScope getScope() { IASNode parent = getParent(); while (parent != null) { if (parent instanceof IScopedNode) return ((IScopedNode)parent).getScope(); parent = parent.getParent(); } return null; } }
b.endBefore(closeT);