<commit_before>package net.ssehub.kernel_haven.typechef.wrapper;

import static net.ssehub.kernel_haven.config.Setting.Type.BOOLEAN;
import static net.ssehub.kernel_haven.config.Setting.Type.DIRECTORY;
import static net.ssehub.kernel_haven.config.Setting.Type.FILE;
import static net.ssehub.kernel_haven.config.Setting.Type.INTEGER;
import static net.ssehub.kernel_haven.config.Setting.Type.SETTING_LIST;
import static net.ssehub.kernel_haven.config.Setting.Type.STRING;

import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import net.ssehub.kernel_haven.SetUpException;
import net.ssehub.kernel_haven.config.Configuration;
import net.ssehub.kernel_haven.config.EnumSetting;
import net.ssehub.kernel_haven.config.Setting;

/**
 * Settings used to configure typechef.
 *
 * @author Adam
 */
public class TypeChefSettings {
    
    public static final Setting<Boolean> IGNORE_OTHER_MODELS
        = new Setting<>("code.extractor.ignore_other_models", BOOLEAN, true, "false", "TODO");
    
    /**
     * Different types of parsing results.
     */
    public static enum ParseType {
        FULL_AST,
        ONLY_C_AST,
        LEXER,
    }
    
    public static final Setting<ParseType> PARSE_TYPE
        = new EnumSetting<ParseType>("code.extractor.parse_type", ParseType.class, true, null,
            "Specifies the granularity of the translation result:\n"
            + " - " + ParseType.LEXER + ": Stops the translation after the lexer and returns a flat list of presence\n"
            + "   conditions only\n"
            + " - " + ParseType.ONLY_C_AST + ": Translates the content of the C-Code only. This includes also\n"
            + "   embedded marco class of a C-functions. However, this will skip all\n"
            + "   header-specific elements, which are not nested inside a C-code element.\n"
            + "   For instance, these may be structs or function declarations.\n"
            + " - " + ParseType.FULL_AST + ": These will generate a full AST. This will also include definitions\n"
            + "   of included headers, even if this code is not embedded of a C-code. This\n"
            + "   facilitates more detailed analyses like data flow analysis. However, this\n"
            + "   requires significantly more hard drive space if the result is cached.");
    
    public static final Setting<File> SYSTEM_ROOT
        = new Setting<>("code.extractor.system_root", DIRECTORY, true, "/", "TODO");
    
    public static final Setting<Boolean> SKIP_DEFAULT_INCLUDE_DIRS
        = new Setting<>("code.extractor.skip_default_include_dirs", BOOLEAN, true, "false", "TODO");
    
    public static final Setting<String> PROCES_RAM
        = new Setting<>("code.extractor.process_ram", STRING, true, "15g", "TODO");

    public static final Setting<List<String>> STATIC_INCLUDES
        = new Setting<>("code.extractor.static_include", SETTING_LIST, false, null, "TODO");
    <commit_msg>Documentation of code.extractor.parse_type setting<commit_after>package net.ssehub.kernel_haven.typechef.wrapper;

import static net.ssehub.kernel_haven.config.Setting.Type.BOOLEAN;
import static net.ssehub.kernel_haven.config.Setting.Type.DIRECTORY;
import static net.ssehub.kernel_haven.config.Setting.Type.FILE;
import static net.ssehub.kernel_haven.config.Setting.Type.INTEGER;
import static net.ssehub.kernel_haven.config.Setting.Type.SETTING_LIST;
import static net.ssehub.kernel_haven.config.Setting.Type.STRING;

import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import net.ssehub.kernel_haven.SetUpException;
import net.ssehub.kernel_haven.config.Configuration;
import net.ssehub.kernel_haven.config.EnumSetting;
import net.ssehub.kernel_haven.config.Setting;

/**
 * Settings used to configure typechef.
 *
 * @author Adam
 */
public class TypeChefSettings {
    
    public static final Setting<Boolean> IGNORE_OTHER_MODELS
        = new Setting<>("code.extractor.ignore_other_models", BOOLEAN, true, "false", "TODO");
    
    /**
     * Different types of parsing results.
     */
    public static enum ParseType {
        FULL_AST,
        ONLY_C_AST,
        LEXER,
    }
    
    public static final Setting<ParseType> PARSE_TYPE
        = new EnumSetting<ParseType>("code.extractor.parse_type", ParseType.class, true, null,
            "Specifies the granularity of the translation result:\n"
            + " - " + ParseType.LEXER + ": Stops the translation after the lexer and returns a flat list of presence\n"
            + "   conditions only\n"
            + " - " + ParseType.ONLY_C_AST + ": Translates the content of the C-Code only. This includes also\n"
            + "   embedded macro class of a C-functions. However, this will skip all\n"
            + "   header-specific elements, which are not nested inside a C-code element.\n"
            + "   For instance, these may be structs or function declarations.\n"
            + " - " + ParseType.FULL_AST + ": These will generate a full AST. This will also include definitions\n"
            + "   of included headers, even if this code is not embedded in C-code. This\n"
            + "   facilitates more detailed analyses like data flow analysis. However, this\n"
            + "   approach is significantly slower (~ 2x) and requires significantly more hard\n"
            + "   drive space (~ 40x) if the result is cached, with respect to " + ParseType.ONLY_C_AST + ".");
    
    public static final Setting<File> SYSTEM_ROOT
        = new Setting<>("code.extractor.system_root", DIRECTORY, true, "/", "TODO");
    
    public static final Setting<Boolean> SKIP_DEFAULT_INCLUDE_DIRS
        = new Setting<>("code.extractor.skip_default_include_dirs", BOOLEAN, true, "false", "TODO");
    
    public static final Setting<String> PROCES_RAM
        = new Setting<>("code.extractor.process_ram", STRING, true, "15g", "TODO");

    public static final Setting<List<String>> STATIC_INCLUDES
        = new Setting<>("code.extractor.static_include", SETTING_LIST, false, null, "TODO");
    
{'fraction_non_alphanumeric': 0.10344827586206896, 'fraction_numerical': 0.0011279407025459234, 'mean_word_length': 3.2224489795918365, 'pattern_counts': {'":': 6, '<': 29, '<?xml version=': 0, '>': 29, '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': '5107525', 'n_tokens_mistral': 1894, 'n_tokens_neox': 1837, 'n_words': 487}