<commit_before>package polyglot.ext.coffer;

import polyglot.ext.coffer.parse.Lexer_c;
import polyglot.ext.coffer.parse.Grm;
import polyglot.ext.coffer.ast.*;
import polyglot.ext.coffer.types.*;
import polyglot.ext.coffer.visit.*;

import polyglot.ast.*;
import polyglot.types.*;
import polyglot.util.*;
import polyglot.visit.*;
import polyglot.frontend.*;
import polyglot.frontend.goals.*;
import polyglot.frontend.goals.Goal;
import polyglot.frontend.goals.Serialized;
import polyglot.main.*;
import polyglot.lex.Lexer;

import java.util.*;
import java.io.*;

/**
 * Extension information for coffer extension.
 */
public class ExtensionInfo extends polyglot.ext.param.ExtensionInfo {
    static {
        // force Topics to load
        Topics t = new Topics();
    }

    public String defaultFileExtension() {
        return "cof";
    }

    public String compilerName() {
        return "cofferc";
    }

    public Parser parser(Reader reader, FileSource source, ErrorQueue eq) {
        Lexer lexer = new Lexer_c(reader, source, eq);
        Grm grm = new Grm(lexer, ts, nf, eq);
        return new CupParser(grm, source, eq);
    }

    protected NodeFactory createNodeFactory() {
        return new CofferNodeFactory_c();
    }
    protected TypeSystem createTypeSystem() {
        return new CofferTypeSystem_c();
    }

   protected List compileGoalList(Job job) {
        List oldGoals = super.compileGoalList(job);
        ArrayList newGoals = new ArrayList(oldGoals.size() + 1);
        
        for (Iterator i = oldGoals.iterator(); i.hasNext(); ) {
            Goal g = (Goal) i.next();
            if (g instanceof Serialized) {
                newGoals.add(new VisitorGoal(job, new KeyChecker(job, ts, nf)));
            }
            newGoals.add(g);
        }
        
        return newGoals;
    }
}<commit_msg>Updated Coffer to use new scheduler interface.<commit_after>package polyglot.ext.coffer;

import polyglot.ext.coffer.parse.Lexer_c;
import polyglot.ext.coffer.parse.Grm;
import polyglot.ext.coffer.ast.*;
import polyglot.ext.coffer.types.*;
import polyglot.ext.coffer.visit.*;

import polyglot.ast.*;
import polyglot.types.*;
import polyglot.util.*;
import polyglot.visit.*;
import polyglot.frontend.*;
import polyglot.frontend.goals.*;
import polyglot.frontend.goals.Goal;
import polyglot.frontend.goals.Serialized;
import polyglot.ext.jl.JLScheduler;
import polyglot.main.*;
import polyglot.lex.Lexer;

import java.util.*;
import java.io.*;

/**
 * Extension information for coffer extension.
 */
public class ExtensionInfo extends polyglot.ext.param.ExtensionInfo {
    static {
        // force Topics to load
        Topics t = new Topics();
    }

    public String defaultFileExtension() {
        return "cof";
    }

    public String compilerName() {
        return "cofferc";
    }

    public Parser parser(Reader reader, FileSource source, ErrorQueue eq) {
        Lexer lexer = new Lexer_c(reader, source, eq);
        Grm grm = new Grm(lexer, ts, nf, eq);
        return new CupParser(grm, source, eq);
    }

    protected NodeFactory createNodeFactory() {
        return new CofferNodeFactory_c();
    }
    protected TypeSystem createTypeSystem() {
        return new CofferTypeSystem_c();
    }

    public Scheduler createScheduler() {
        return new CofferScheduler(this);
    }

    static class CofferScheduler extends JLScheduler {
        CofferScheduler(ExtensionInfo extInfo) {
            super(extInfo);
        }

        public Goal KeyCheck(final Job job) { 
            TypeSystem ts = job.extensionInfo().typeSystem();
            NodeFactory nf = job.extensionInfo().nodeFactory();

            Goal g = internGoal(new VisitorGoal(job, new KeyChecker(job, ts, nf)) {
                public Collection prerequisiteGoals(Scheduler scheduler) {
                    List l = new ArrayList();
                    l.addAll(super.prerequisiteGoals(scheduler));
                    l.add(scheduler.TypeChecked(job));
                    l.add(scheduler.ConstantsChecked(job));
                    l.add(scheduler.ReachabilityChecked(job));
                    l.add(scheduler.ExceptionsChecked(job));
                    l.add(scheduler.ExitPathsChecked(job));
                    l.add(scheduler.InitializationsChecked(job));
                    l.add(scheduler.ConstructorCallsChecked(job));
                    l.add(scheduler.ForwardReferencesChecked(job));
                    return l;
                }
            });
            return g;
        }

        public Goal Serialized(final Job job) { 
            Goal g = internGoal(new Serialized(job) {
                public Collection prerequisiteGoals(Scheduler scheduler) {
                    List l = new ArrayList();
                    l.addAll(super.prerequisiteGoals(scheduler));
                    l.add(KeyCheck(job));
                    return l;
                }
            });
            return g;
        }
    }

    static {
        // Make sure the class Topics is loaded.
        new Topics(); 
    }
}
{'fraction_non_alphanumeric': 0.10589865399841647, 'fraction_numerical': 0.0001979414093428345, 'mean_word_length': 2.29185667752443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6739312', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1469, 'n_words': 335}