<commit_before>package org.spoofax.jsglr2.parsetable;

import org.spoofax.jsglr2.actions.IAction;
import org.spoofax.jsglr2.actions.IGoto;

public final class StateFactory implements IStateFactory {

    ProductionToGotoRepresentation productionToGotoType;

    public StateFactory() {
        this(ProductionToGotoRepresentation.CapsuleImmutableBinaryRelation);
    }

    public StateFactory(ProductionToGotoRepresentation productionToGotoType) {
        this.productionToGotoType = productionToGotoType;
    }

    public IState from(int stateNumber, IGoto[] gotos, IAction[] actions) {
        IProductionToGoto productionToGoto;

        switch(productionToGotoType) {
            case CapsuleImmutableBinaryRelation:
                productionToGoto = new ProductionToGotoCapsuleBinaryRelationImmutable(gotos);
                break;
            case ForLoop:
                productionToGoto = new ProductionToGotoForLoop(gotos);
                break;
            case JavaHashMap:
                productionToGoto = new ProductionToGotoJavaHashMap(gotos);
                break;
                break;
            default:<commit_msg>Default to Java HashMap for production -> goto state mapping<commit_after>package org.spoofax.jsglr2.parsetable;

import org.spoofax.jsglr2.actions.IAction;
import org.spoofax.jsglr2.actions.IGoto;

public final class StateFactory implements IStateFactory {

    ProductionToGotoRepresentation productionToGotoType;

    public StateFactory() {
        this(ProductionToGotoRepresentation.JavaHashMap);
    }

    public StateFactory(ProductionToGotoRepresentation productionToGotoType) {
        this.productionToGotoType = productionToGotoType;
    }

    public IState from(int stateNumber, IGoto[] gotos, IAction[] actions) {
        IProductionToGoto productionToGoto;

        switch(productionToGotoType) {
            case CapsuleImmutableBinaryRelation:
                productionToGoto = new ProductionToGotoCapsuleBinaryRelationImmutable(gotos);
                break;
            case ForLoop:
                productionToGoto = new ProductionToGotoForLoop(gotos);
                break;
            case JavaHashMap:
                productionToGoto = new ProductionToGotoJavaHashMap(gotos);
                break;
            default:
{'fraction_non_alphanumeric': 0.05892623308598865, 'fraction_numerical': 0.0026189436927106066, 'mean_word_length': 2.8716216216216215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7062749', 'n_tokens_mistral': 647, 'n_tokens_neox': 612, 'n_words': 112}