private static boolean isInsideDisabledConfigBlock(FunctionNode fn) { ConfigConditionBlockNode configBlock = (ConfigConditionBlockNode)fn.getAncestorOfType(ConfigConditionBlockNode.class); if (configBlock != null && configBlock.getChildCount() == 0) return true; return false; }
/** * Create a enabled or disabled configuration config block. * * @param enabled True if the configuration condition evaluates to true. */ public ConfigConditionBlockNode(boolean enabled) { super(); this.enabled = enabled; this.setContainerType(ContainerType.CONFIG_BLOCK); }
/** * Matches a group of directives gated with configuration variable. * * CONFIG::debug { * trace("debugging code"); * } * * If the configuration variable evaluates to false, the following block will * not be added to the resulting AST. */ public final void groupDirectiveWithConfigVariable( ContainerNode c, int endToken ) throws RecognitionException, TokenStreamException { boolean b; ConfigConditionBlockNode block; final Token lt = LT(1); b=configCondition(); block = new ConfigConditionBlockNode(b); block.startBefore(lt); c.addItem(block); groupDirective(block, endToken); }
/** * Matches a group of directives gated with configuration variable. * * CONFIG::debug { * trace("debugging code"); * } * * If the configuration variable evaluates to false, the following block will * not be added to the resulting AST. */ public final void groupDirectiveWithConfigVariable( ContainerNode c, int endToken ) throws RecognitionException, TokenStreamException { boolean b; ConfigConditionBlockNode block; final Token lt = LT(1); b=configCondition(); block = new ConfigConditionBlockNode(b); block.startBefore(lt); c.addItem(block); groupDirective(block, endToken); }
private static boolean isInsideDisabledConfigBlock(FunctionNode fn) { ConfigConditionBlockNode configBlock = (ConfigConditionBlockNode)fn.getAncestorOfType(ConfigConditionBlockNode.class); if (configBlock != null && configBlock.getChildCount() == 0) return true; return false; }
/** * Create a enabled or disabled configuration config block. * * @param enabled True if the configuration condition evaluates to true. */ public ConfigConditionBlockNode(boolean enabled) { super(); this.enabled = enabled; this.setContainerType(ContainerType.CONFIG_BLOCK); }
if (condcomp.getChildCount() > 0) // will be 0 if conditional compile variable is false visitor.visitBlock((IBlockNode) node); return;