process the specified type then process its children
511634
def process(self, data, type, history):
        
        if type in history:
            return
        if type.enum():
            return
        history.append(type)
        resolved = type.resolve()
        value = None
        if type.multi_occurrence():
            value = []
        else:
            if len(resolved) > 0:
                if resolved.mixed():
                    value = Factory.property(resolved.name)
                    md = value.__metadata__
                    md.sxtype = resolved
                else:
                    value = Factory.object(resolved.name)
                    md = value.__metadata__
                    md.sxtype = resolved
                    md.ordering = self.ordering(resolved)
        setattr(data, type.name, value)
        if value is not None:
            data = value
        if not isinstance(data, list):
            self.add_attributes(data, resolved)
            for child, ancestry in resolved.children():
                if self.skip_child(child, ancestry):
                    continue
                self.process(data, child, history[:])
547943
def process(self):
        
        children = len(self.living_children)
        LOGGER.debug('%i active child%s',
                     children, '' if children == 1 else 'ren')
730785
def process(sexp, level = :expr)
      return fragment('', scope) if sexp.nil?

      if handler = handlers[sexp.type]
        return handler.new(sexp, level, self).compile_to_fragments
      else
        error "Unsupported sexp: #{sexp.type}"
      end
    end
148881
function processChildrenOnce( &$textElements, &$children, $tpl, $rootNamespace, $name )
    {
        foreach ( array_keys( $children ) as $childKey )
        {
            $child =& $children[$childKey];
            $tpl->processNode( $child, $textElements, $rootNamespace, $name );
        }
        return true;
    }
948875
def process_children(self, node, parent, pmod):
        
        for ch in node.i_children:
            if ch.keyword in ["rpc", "notification"]: continue
            if ch.keyword in ["choice", "case"]:
                self.process_children(ch, parent, pmod)
                continue
            if ch.i_module.i_modulename == pmod:
                nmod = pmod
                nodename = ch.arg
            else:
                nmod = ch.i_module.i_modulename
                nodename = "%s:%s" % (nmod, ch.arg)
            ndata = [ch.keyword]
            if ch.keyword == "container":
                ndata.append({})
                self.process_children(ch, ndata[1], nmod)
            elif ch.keyword == "list":
                ndata.append({})
                self.process_children(ch, ndata[1], nmod)
                ndata.append([(k.i_module.i_modulename, k.arg)
                              for k in ch.i_key])
            elif ch.keyword in ["leaf", "leaf-list"]:
                ndata.append(self.base_type(ch.search_one("type")))
            modname = ch.i_module.i_modulename
            parent[nodename] = ndata
17622
function process(content, encoding, attrs, node) {
    if (typeof content === 'undefined') {
      console.error(
        colors.red('process() : Undefined "content" parameters.')
      );
      return '';
    }
    if (!encoding || encoding === 'original') {
      return content;
    }
    var items = encoding.split(/\s*,\s*/);
    if (items.length > 1) {
      items.forEach(function (item) {
        content = process(content, item, attrs, node);
      });
      return content;
    }
    var processor = getProcessor(encoding);
    if (!processor) {
      console.error(
        colors.red('The "%s" processor does not exist.'), encoding
      );
      return content;
    }
    return processor(content, attrs, instance, node);
  }
47366
def typeSort(self):
        '''
        
        '''
        self.children.sort()
        for c in self.children:
            c.typeSort()
940179
public void addType(final Type... _type)
        throws EFapsException
    {
        final List<Type> allType = new ArrayList<>();
        if (this.types.isEmpty()) {
            final Type type = Type.get(this.typeUUID);
            if (type.isAbstract()) {
                final List<Type> childTypes = type.getChildTypes()
                                .stream()
                                .filter(t -> !t.isAbstract())
                                .collect(Collectors.toList());
                allType.addAll(childTypes);
            } else {
                allType.add(type);
            }
        }
        for (final UUID type : this.types) {
            allType.add(Type.get(type));
        }
        for (final Type type : _type) {
            if (type.isAbstract()) {
                final List<Type> childTypes = type.getChildTypes()
                                .stream()
                                .filter(t -> !t.isAbstract())
                                .collect(Collectors.toList());
                allType.addAll(childTypes);
            } else {
                allType.add(type);
            }
        }

        //make for every type a list of types up to the parent
        final List<List<Type>> typeLists = new ArrayList<>();
        for (final Type type : allType) {
            final List<Type> typesTmp = new ArrayList<>();
            typeLists.add(typesTmp);
            Type tmpType = type;
            while (tmpType != null) {
                typesTmp.add(tmpType);
                tmpType = tmpType.getParentType();
            }
        }

        final Set<Type> common = new LinkedHashSet<>();
        if (!typeLists.isEmpty()) {
            final Iterator<List<Type>> iterator = typeLists.iterator();
            common.addAll(iterator.next());
            while (iterator.hasNext()) {
                common.retainAll(iterator.next());
            }
        }
        if (common.isEmpty()) {
            throw new EFapsException(QueryBuilder.class, "noCommon", allType);
        } else {
            // first common type
            this.typeUUID = common.iterator().next().getUUID();
            for (final Type type : allType) {
                this.types.add(type.getUUID());
            }
        }
        // special case handling
        if (this.types.size() == 1 && this.types.iterator().next().equals(this.typeUUID)) {
            this.types.clear();
        }
    }
997379
function(type) {
			var result = this.spirit.element.firstElementChild;
			if (type) {
				result = this.children(type)[0] || null;
			}
			return result;
		}
210966
function process( $tpl, &$text, $nspace, $current_nspace )
    {
        foreach( array_keys( $this->Children ) as $key )
        {
            $this->Children[$key]->process( $tpl, $text, $nspace, $current_nspace );
        }
    }
889363
def collect_by_type(self, typ):
        '''
        '''
        nodes = []
        if isinstance(self, typ):
            nodes.append(self)
        for c in self:
            nodes.extend(c.collect_by_type(typ))
        return nodes
523272
function processOtherSpecifier() {
                    const leftBrace = sourceCode.getFirstToken(node, 1)
                    const rightBrace = sourceCode.getLastToken(
                        node,
                        hasSemi ? 3 : 2
                    )
                    setOffsetToToken(leftBrace, 0, importToken)
                    processNodeList(node.specifiers, leftBrace, rightBrace, 1)
                    tokens.push(
                        sourceCode.getLastToken(node, hasSemi ? 2 : 1), // from
                        sourceCode.getLastToken(node, hasSemi ? 1 : 0) // "foo"
                    )
                }
567117
@Override
  public void process(Node externsRoot, Node jsRoot) {
    Node externsAndJs = jsRoot.getParent();
    checkState(externsAndJs != null);
    checkState(externsRoot == null || externsAndJs.hasChild(externsRoot));

    inferAllScopes(externsAndJs);
  }
964844
void processSpecialNodeTypes(NodeWithType<?, Type> node, String name) {
        Type type = node.getType();
        if (node instanceof MethodDeclaration && ("newBufferAndOffset".equals(name) || "nextArrayOffset".equals(name))) {
            node.setType(PrimitiveType.intType());
        } else if (PrimitiveType.longType().equals(type)) {
            switch(name) {
            case "offset":
            case "offsetInNew":
            case "offsetInOld":
            case "lookAheadElementOffset":
                node.setType(PrimitiveType.intType());
            }
        } else if (isRefType(type, "LinkedQueueNode")) {
            node.setType(simpleParametricType("LinkedQueueAtomicNode", "E"));
        } else if (isRefArray(type, "E")) {
            node.setType(atomicRefArrayType((ArrayType) type));
        }
    }
346221
void processSpecialNodeTypes(NodeWithType<?, Type> node, String name) {
        Type type = node.getType();
        if ("buffer".equals(name) && isRefArray(type, "E")) {
            node.setType(atomicRefArrayType((ArrayType) type));
        } else if ("sBuffer".equals(name) && isLongArray(type)) {
            node.setType(atomicLongArrayType());
        } else if (PrimitiveType.longType().equals(type)) {
            switch(name) {
            case "mask":
            case "offset":
            case "seqOffset":
            case "lookAheadSeqOffset":
            case "lookAheadElementOffset":
                node.setType(PrimitiveType.intType());
            }
        }
    }
1053440
function _processNode(node, level) {
        var nodeData = null;
        
        // entity tag
        if (w.isReadOnly === false && node.attr('_entity') && (node.attr('_tag') || node.attr('_note'))) {
            var id = node.attr('name');
            var entity = w.entitiesManager.getEntity(id);
            var type = node.attr('_type');
            var tag = node.attr('_tag');
            if (tag == null) {
                tag = w.schemaManager.mapper.getParentTag(type);
            }
            
            nodeData = {
                text: tag,
                li_attr: {name: id}, // 'class': type}
                state: {opened: level < 3}
            };
            
            if (w.schemaManager.mapper.isEntityTypeNote(type)) {
                var content = w.schemaManager.mapper.getNoteContentForEntity(entity);
                switch($.type(content)) {
                    case 'array':
                        nodeData.children = [];
                        for (var i = 0; i < content.length; i++) {
                            nodeData.children.push({
                                text: content[i],
                                li_attr: {name: id}
                            });
                        }
                        break;
                    case 'string':
                        nodeData.children = [];
                        nodeData.children.push({
                            text: content,
                            li_attr: {name: id}
                        });
                        break;
                    case 'object':
                        if (content.nodeType !== undefined) {
                            var root = $(tag, content).first();
                            
                            var processChildren = function(children, parent, id) {
                                children.each(function(index, el) {
                                    if (parent.children == null) parent.children = [];
                                    var childData = {
                                        text: el.nodeName,
                                        li_attr: {name: id}
                                    };
                                    parent.children.push(childData);
                                    
                                    processChildren($(el).children(), childData, id);
                                });
                            }
                            
                            processChildren(root.children(), nodeData, id);
                        }
                }
            }
            
        // structure tag
        } else if (node.attr('_tag')) {
            var tag = node.attr('_tag');
            if (w.isReadOnly === false || (w.isReadOnly && (tag === w.root || tree.tagFilter.indexOf(tag.toLowerCase()) !== -1))) {
                var id = node.attr('id');
                var info = w.structs[id];
                
                if (info == undefined) {
                    // redo/undo re-added a struct check
                    info = w.deletedStructs[id];
                    if (info != undefined) {
                        w.structs[id] = info;
                        delete w.deletedStructs[id];
                    }
                }
                
                if (info) {
                    var text = info._tag;
                    if (w.isReadOnly) {
                        if (tag === w.root) {
                            text = w.root;// || w.currentDocId;
                        } else {
                            text = w.utilities.getTitleFromContent(node.text());
                        }
                    }
                    nodeData = {
                        text: text,
                        li_attr: {name: id},
                        state: {opened: level < 3}
                    };
                }
            }
        }
        if (nodeData !== null) {
            nodeData.level = level;
            // FIXME we really shouldn't have this hardcoded here
            // manually set the level for CWRC schema to have proper sorting in readOnly mode
            if (w.schemaManager.schemaId === 'cwrcEntry') {
                var subtype = node.attr('subtype');
                if (subtype !== undefined) {
                    nodeData.level = parseInt(subtype);
                }
            }
        }
        
        return nodeData;
    }
1349449
def render(self, type, rerender=False):
        """"""
        for child in self.children:
            child.render(type, rerender)