Perform dataflow checks on an attributed parse tree.
962623
protected void flow(Env<AttrContext> env, Queue<Env<AttrContext>> results) {
        if (compileStates.isDone(env, CompileState.FLOW)) {
            results.add(env);
            return;
        }

        try {
            if (shouldStop(CompileState.FLOW))
                return;

            if (relax) {
                results.add(env);
                return;
            }

            if (verboseCompilePolicy)
                printNote("[flow " + env.enclClass.sym + "]");
            JavaFileObject prev = log.useSource(
                                                env.enclClass.sym.sourcefile != null ?
                                                env.enclClass.sym.sourcefile :
                                                env.toplevel.sourcefile);
            try {
                make.at(Position.FIRSTPOS);
                TreeMaker localMake = make.forToplevel(env.toplevel);
                flow.analyzeTree(env, localMake);
                compileStates.put(env, CompileState.FLOW);

                if (shouldStop(CompileState.FLOW))
                    return;

                results.add(env);
            }
            finally {
                log.useSource(prev);
            }
        }
        finally {
            if (!taskListener.isEmpty()) {
                TaskEvent e = new TaskEvent(TaskEvent.Kind.ANALYZE, env.toplevel, env.enclClass.sym);
                taskListener.finished(e);
            }
        }
    }
509172
def __parse(self, tokenlist):
        """"""
        #empty stack
        #iterate over symbollist
        tokenlist = [x for x in tokenlist]
        if not isinstance(tokenlist, list):
            raise TypeError("Expected list, got %s" % tokenlist.__class__.__name__)
        LOG.debug("get_trees: checking list: " + str(tokenlist))
        stack = [(0, Extended_S)]
        while True:
            state = stack[-1][0]
            if len(tokenlist):#FIXME: tokenlist with one element is reported as false
                token = tokenlist[0]
            else:
                token = EndSymbol()
            newdic = self.__parsertable.insert(state, token)
            action = newdic["action"]
            if action == "Fail":
                return False
            elif action == "Accept":
                return True
            if action == "Reduce":
                reductionrule = newdic["rule"]
                #TODO extract len(right side) of the rule and insert left side
                for rsymbol in reversed(reductionrule.rightside):
                    state, symbol = stack.pop() # TODO: check
                state = stack[-1][0]
                state = self.__parsertable.goto(state,reductionrule.leftside[0])
                stack.append((state, reductionrule.leftside[0]))
            elif action == "Shift":
                stack.append((newdic['dest'], tokenlist.pop(0)))
            else:
                raise ValueError("Unknown action")
        return False
690227
def _parse_trigger(self, trigger_clause):
        """"""

        cond = trigger_clause[0]

        named_event = None
        explicit_stream = None
        explicit_trigger = None

        # Identifier parse tree is Group(Identifier)
        if cond.getName() == 'identifier':
            named_event = cond[0]
        elif cond.getName() == 'stream_trigger':
            trigger_type = cond[0]
            stream = cond[1]
            oper = cond[2]
            ref = cond[3]

            trigger = InputTrigger(trigger_type, oper, ref)
            explicit_stream = stream
            explicit_trigger = trigger
        elif cond.getName() == 'stream_always':
            stream = cond[0]
            trigger = TrueTrigger()
            explicit_stream = stream
            explicit_trigger = trigger
        else:
            raise ArgumentError("OnBlock created from an invalid ParseResults object", parse_results=trigger_clause)

        return TriggerDefinition(named_event, explicit_stream, explicit_trigger)
330687
function checkAutoParagraphing( parent, node ) {

			// Check for parent that can contain block.
			if ( ( parent == root || parent.name == 'body' ) && fixingBlock &&
					( !parent.name || CKEDITOR.dtd[ parent.name ][ fixingBlock ] ) ) {
				var name, realName;

				if ( node.attributes && ( realName = node.attributes[ 'data-cke-real-element-type' ] ) )
					name = realName;
				else
					name = node.name;

				// Text node, inline elements are subjected, except for <script>/<style>.
				return name && name in CKEDITOR.dtd.$inline &&
					!( name in CKEDITOR.dtd.head ) &&
					!node.isOrphan ||
					node.type == CKEDITOR.NODE_TEXT;
			}
		}
890996
function processNode(attrNode, context) {
    const isMainResource = context.attrPath.length === 0;

    // identify/handle options-contexts: resource/sub-resource, nested-attribute, attribute:
    if (attrNode.dataSources || attrNode.resource || isMainResource) {
        context.errorContext = getErrorContext(isMainResource ? 'resource' : 'sub-resource', context);
        context.subAttrPath = [];
        context.dataSourceAttributes = {};

        if (isMainResource) {
            parseNode(
                attrNode,
                {
                    dataSources: null,
                    subFilters: parseSubFilters,
                    resource: checkResourceName,
                    primaryKey: parsePrimaryKey,
                    depends: parseDepends,
                    deprecated: parseBoolean,
                    permission: null,
                    attributes: null,
                    defaultLimit: parseInteger,
                    maxLimit: parseInteger,
                    defaultOrder: requestParser.order
                },
                context
            );
        } else {
            parseNode(
                attrNode,
                {
                    dataSources: null,
                    subFilters: parseSubFilters,
                    resource: checkResourceName,
                    primaryKey: parsePrimaryKey,
                    parentKey: parseRelationKey,
                    childKey: parseRelationKey,
                    many: parseBoolean,
                    depends: parseDepends,
                    hidden: parseBoolean,
                    deprecated: parseBoolean,
                    permission: null,
                    joinVia: checkIdentifier,
                    attributes: null,
                    defaultLimit: parseInteger,
                    maxLimit: parseInteger,
                    defaultOrder: requestParser.order
                },
                context
            );
        }

        handleResourceContext(attrNode, context);
    } else if (attrNode.attributes) {
        context.errorContext = getErrorContext('nested-attribute', context);

        parseNode(
            attrNode,
            {
                depends: parseDepends,
                hidden: parseBoolean,
                deprecated: parseBoolean,
                permission: null,
                attributes: null
            },
            context
        );

        // no context-specific special-cases for nested-attributes
    } else {
        context.errorContext = getErrorContext('attribute', context);

        // prepare standard-mapping - except for fixed values and inherited attributes:
        if (!attrNode.map && !('value' in attrNode) && attrNode.inherit !== 'inherit') {
            attrNode.map = null; // "null" means "set standard-mapping in parseMap()"
        }

        parseNode(
            attrNode,
            {
                type: parseType,
                multiValued: parseBoolean,
                storedType: parseStoredType,
                delimiter: null,
                map: parseMap,
                filter: parseFilter,
                order: parseOrder,
                value: parseStaticValue,
                depends: parseDepends,
                hidden: parseBoolean,
                deprecated: parseBoolean,
                permission: null,
                inherit: parseInherit
            },
            context
        );

        handleAttributeContext(attrNode, context);
    }

    // recursion:
    if (attrNode.attributes) {
        Object.keys(attrNode.attributes).forEach(subAttrName => {
            const subAttrNode = attrNode.attributes[subAttrName];

            const subContext = Object.assign({}, context);
            subContext.attrPath = context.attrPath.concat([subAttrName]);
            subContext.subAttrPath = context.subAttrPath.concat([subAttrName]);

            processNode(subAttrNode, subContext);
        });
    }

    if (attrNode.dataSources) {
        if (attrNode.primaryKey) resolvePrimaryKey(attrNode, context);
        prepareDataSources(attrNode, context);
    }
}
1357072
def _CheckParserCanProcessFileEntry(self, parser, file_entry):
    
    for filter_object in parser.FILTERS:
      if filter_object.Match(file_entry):
        return True

    return False
74816
private void checkTree(int t) {
    int head = -1;
    int u = t;
    int tindex = index(t);
    int tsize = chunkSize(t);
    int index = treeBinIndex(tsize);

    if (tindex != index) 
      throw new AssertionError("Tree node " + u + " has incorrect index [" + index(u) + "!=" + tindex + "]");
    if (tsize < MIN_LARGE_SIZE)
      throw new AssertionError("Tree node " + u + " is too small to be in a tree [" + tsize + "<" + MIN_LARGE_SIZE + "]");
    if (tsize < minSizeForTreeIndex(index))
      throw new AssertionError("Tree node " + u + " is too small to be in this tree [" + tsize + "<" + minSizeForTreeIndex(index) + "]");
    if (index != NTREEBINS-1 && tsize >= minSizeForTreeIndex(index + 1))
      throw new AssertionError("Tree node " + u + " is too large to be in this tree [" + tsize + ">=" + minSizeForTreeIndex(index + 1) + "]");

    do { /* traverse through chain of same-sized nodes */
      checkAnyChunk(u);
      if (index(u) != tindex)
        throw new AssertionError("Tree node " + u + " has incorrect index [" + index(u) + "!=" + tindex + "]");
      if (chunkSize(u) != tsize)
        throw new AssertionError("Tree node " + u + " has an mismatching size [" + chunkSize(u) + "!=" + tsize + "]");
      if (isInUse(u))
        throw new AssertionError("Tree node " + u + " is in use");
      if (nextPreviousInUse(u))
        throw new AssertionError("Tree node " + u + " is marked as in use in the next chunk");
      if (backward(forward(u)) != u)
        throw new AssertionError("Tree node " + u + " has incorrect chain links");
      if (forward(backward(u)) != u)
        throw new AssertionError("Tree node " + u + " has incorrect chain links");
      if (parent(u) == -1 && u != treeBins[index]) {
        if (child(u, 0) != -1)
          throw new AssertionError("Tree node " + u + " is chained from the tree but has a child " + child(u, 0));
        if (child(u, 1) != -1)
          throw new AssertionError("Tree node " + u + " is chained from the tree but has a child" + child(u, 1));
      } else {
        if (head != -1)
          throw new AssertionError("Tree node " + u + " is the second node in this chain with a parent [first was " + head + "]");
        head = u;
        
        if (treeBins[index] == u) {
          if (parent(u) != -1)
            throw new AssertionError("Tree node " + u + " is the head of the tree but has a parent " + parent(u));
        } else {
          if (parent(u) == u)
            throw new AssertionError("Tree node " + u + " is its own parent");
          if (child(parent(u), 0) != u && child(parent(u), 1) != u)
            throw new AssertionError("Tree node " + u + " is not a child of its parent");
        }
        
        if (child(u, 0) != -1) {
          if (parent(child(u, 0)) != u)
            throw new AssertionError("Tree node " + u + " is not the parent of its left child");
          if (child(u, 0) == u)
            throw new AssertionError("Tree node " + u + " is its own left child");
          checkTree(child(u, 0));
        }
        if (child(u, 1) != -1) {
          if (parent(child(u, 1)) != u)
            throw new AssertionError("Tree node " + u + " is not the parent of its right child");
          if (child(u, 1) == u)
            throw new AssertionError("Tree node " + u + " is its own right child");
          checkTree(child(u, 1));
        }
        if (child(u, 0) != -1 && child(u, 1) != -1 && chunkSize(child(u, 0)) >= chunkSize(child(u, 1))) {
          throw new AssertionError("Tree node " + u + " has it's left child bigger than it's right child");
        }
      }
      u = forward(u);
    } while (u != t);
    
    if (head == -1)
      throw new AssertionError("This tree level has no nodes with a parent");
  }
74355
public static void check(YamlNode node) {
        if (node instanceof YamlMapping) {
            for (YamlNameNodePair nodePair : ((YamlMapping) node).childrenPairs()) {
                YamlNode child = nodePair.childNode();
                if (child == null) {
                    String path = YamlUtil.constructPath(node, nodePair.nodeName());
                    reportNullEntryOnConcretePath(path);
                }

                check(nodePair.childNode());

            }
        } else if (node instanceof YamlSequence) {
            for (YamlNode child : ((YamlSequence) node).children()) {
                if (child == null) {
                    throw new InvalidConfigurationException("There is a null configuration entry under sequence " + node.path()
                            + ". Please check if the provided YAML configuration is well-indented and no blocks started without "
                            + "sub-nodes.");
                }

                check(child);
            }
        } else {
            if (((YamlScalar) node).nodeValue() == null) {
                reportNullEntryOnConcretePath(node.path());
            }
        }
    }
424876
def check(self):
        
        if not isinstance(self.parsed_yaml, dict):
            msg = 'In {0}:\n'.format(self.sourcefile)
            msg += 'Assistants and snippets must be Yaml mappings, not "{0}"!'.\
                format(self.parsed_yaml)
            raise exceptions.YamlTypeError(msg)
        self._check_fullname(self.sourcefile)
        self._check_description(self.sourcefile)
        self._check_section_names(self.sourcefile)
        self._check_project_type(self.sourcefile)
        self._check_args(self.sourcefile)
        self._check_files(self.sourcefile)
        self._check_dependencies(self.sourcefile)
        self._check_run(self.sourcefile)
808871
def _CheckData(yaml_data):
  """"""
  legal_keys = set(('blacklist', 'whitelist'))
  unknown_keys = set(yaml_data) - legal_keys
  if unknown_keys:
    raise UnknownConfigKeyError(
        'Unknown keys in configuration: %s' % unknown_keys)

  for key, data in six.iteritems(yaml_data):
    _AssertDataIsList(key, data)
284216
def check(self, _):
        """"""

        try:
            import yaml
        except:
            return True
        try:
            yaml.safe_load(self.recipes)
        except Exception as e:
            raise RADLParseException("Invalid YAML code: %s." % e, line=self.line)
        return True
385068
def run_parse(self):
        """"""
        # Data set already has source file names from load_inputs
        parsedset = {}
        parsedset['data_set'] = []
        for log in self.input_files:
            parsemodule = self.parse_modules[self.args.parser]
            try:
                if self.args.tzone:
                    parsemodule.tzone = self.args.tzone
            except NameError: pass
            parsedset['data_set'].append(parsemodule.parse_file(log))
        self.data_set = parsedset
        del(parsedset)
655366
def walk(self, callback):
    """"""
    callback(self)
    for child in self._child_parsers:
      child.walk(callback)
29359
def iterparse(source, events=('end',), remove_comments=True, **kw):
    """"""
    return ElementTree.iterparse(source, events, SourceLineParser(), **kw)
706687
def _check_for_errors(etree: ET.ElementTree):
    """"""
    if etree.getroot().tag == 'error':
        raise APIError(etree.getroot().text)
1319002
def check(self, datas, *filers):
        '''
            
        '''
        # special case : no filter : want to read all the feed
        if self.match == "" and self.does_not_match == '':
            yield datas
        # let's filtering :
        else:
            condition1 = False
            condition2 = False
            # arg contain the property from which we want to check the 'data'
            for prop in filers:
                # check if my datas contains my property
                if prop in datas:
                    # filter to find only this data
                    if self.match != '' and condition1 is False:
                        condition1 = self.filter_that(self.match,
                                                      datas[prop])
                    # filter to exclude this data,
                    # when found, continue to the next entry
                    if self.does_not_match != '' and condition2 is False:
                        condition2 = self.filter_that(self.does_not_match,
                                                      datas[prop])
                        if condition2:
                            continue
        if condition1 and condition2 is False:
            yield datas
1337988
def feed_parser(self, data):
        
        assert isinstance(data, bytes)
        self.parser.feed(data)