<commit_before>package polyglot.ext.jl.ast;

import polyglot.ast.*;
import polyglot.ast.Assert;
import polyglot.types.Flags;
import polyglot.types.Package;
import polyglot.types.Type;
import polyglot.types.Qualifier;
import polyglot.util.*;
import java.util.*;

/**
 * A <code>NodeFactory</code> constructs AST nodes.  All node construction
 * should go through this factory or by done with the <code>copy()</code>
 * method of <code>Node</code>.
 */
public class NodeFactory_c extends AbstractNodeFactory_c
{
    private final ExtFactory extFactory;
    private final DelFactory delFactory;
    public NodeFactory_c() {
        // use an empty implementation of AbstractExtFactory_c and
        // AbstractDelFactory_c, so we don't need to do null checks
        this(new AbstractExtFactory_c() {}, 
             new AbstractDelFactory_c() {}); 
    }
    public NodeFactory_c(ExtFactory extFactory) {
        this(extFactory, 
             new AbstractDelFactory_c() {}); 
    }
    public NodeFactory_c(ExtFactory extFactory,
                           DelFactory delFactory ) {
        this.extFactory = extFactory; 
        this.delFactory = delFactory; 
    }
    
    protected ExtFactory extFactory() {
        return this.extFactory;
    }
    
    /**
     * Utility method to find an instance of an Extension Factory
     */
    protected final ExtFactory findExtFactInstance(Class c) {
        ExtFactory e = extFactory();
        while (e != null) {
            if (c.isInstance(e)) {
                // the factory e is an instance of the class c
                return e;
            }
            e = e.nextExtFactory();
        }<commit_msg>Allow subclasses to access the delFactory<commit_after>package polyglot.ext.jl.ast;

import polyglot.ast.*;
import polyglot.ast.Assert;
import polyglot.types.Flags;
import polyglot.types.Package;
import polyglot.types.Type;
import polyglot.types.Qualifier;
import polyglot.util.*;
import java.util.*;

/**
 * A <code>NodeFactory</code> constructs AST nodes.  All node construction
 * should go through this factory or by done with the <code>copy()</code>
 * method of <code>Node</code>.
 */
public class NodeFactory_c extends AbstractNodeFactory_c
{
    private final ExtFactory extFactory;
    private final DelFactory delFactory;
    public NodeFactory_c() {
        // use an empty implementation of AbstractExtFactory_c and
        // AbstractDelFactory_c, so we don't need to do null checks
        this(new AbstractExtFactory_c() {}, 
             new AbstractDelFactory_c() {}); 
    }
    public NodeFactory_c(ExtFactory extFactory) {
        this(extFactory, 
             new AbstractDelFactory_c() {}); 
    }
    public NodeFactory_c(ExtFactory extFactory,
                           DelFactory delFactory ) {
        this.extFactory = extFactory; 
        this.delFactory = delFactory; 
    }
    
    protected ExtFactory extFactory() {
        return this.extFactory;
    }

    protected DelFactory delFactory() {
        return this.delFactory;
    }

    /**
     * Utility method to find an instance of an Extension Factory
     */
    protected final ExtFactory findExtFactInstance(Class c) {
        ExtFactory e = extFactory();
        while (e != null) {
            if (c.isInstance(e)) {
                // the factory e is an instance of the class c
                return e;
            }
            e = e.nextExtFactory();
        }
{'fraction_non_alphanumeric': 0.08891488739397485, 'fraction_numerical': 0.0, 'mean_word_length': 2.4234234234234235, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '110993', 'n_tokens_mistral': 954, 'n_tokens_neox': 922, 'n_words': 274}