<commit_before>package ie.ucd.clops.dsl.structs;


import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Simple AST-like datastructure for storing the information gathered
 * from parsing a DSL file.
 * 
 * Once all the informations are gathered the {@link #pack()} method
 * must be called to seal the object.
 * 
 * @author Fintan
 *
 */
public class DSLInformation {
  /** true if the object is sealed (immutable). */ 
  private boolean isPacked;
  
  private String parserName;
  private String packageName;
  private String formatString;
  
  private boolean transitiveFlyrules;

  private final List<OptionDescription> optionDescriptions;
  
  /** keep track of options and groups. */
  private final Map<String, OptionDescription> optionIdDescriptionMap;
  
  private final List<OptionGroupDescription> optionGroupDescriptions;
  private final List<FlyRuleDescription> flyRuleDescriptions;
  private final List<OverrideRuleDescription> overrideRuleDescriptions;
  private final List<ValidityRuleDescription> validityRuleDescriptions;

  
  /** the structure containing correspondence between classes long and short names. */
  private NameDict dict = new NameDict();

  private String description;

  private String formatDesc;
  
  public DSLInformation() {
    optionDescriptions = new LinkedList<OptionDescription>();
    optionIdDescriptionMap = new HashMap<String, OptionDescription>();
    optionGroupDescriptions = new LinkedList<OptionGroupDescription>();
    flyRuleDescriptions = new LinkedList<FlyRuleDescription>();<commit_msg>fixed an initialization bug<commit_after>package ie.ucd.clops.dsl.structs;


import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Simple AST-like datastructure for storing the information gathered
 * from parsing a DSL file.
 * 
 * Once all the informations are gathered the {@link #pack()} method
 * must be called to seal the object.
 * 
 * @author Fintan
 *
 */
public class DSLInformation {
  /** true if the object is sealed (immutable). */ 
  private boolean isPacked;
  
  private String parserName;
  private String packageName;
  private String formatString;
  
  private boolean transitiveFlyrules;

  private final List<OptionDescription> optionDescriptions;
  
  /** keep track of options and groups. */
  private final Map<String, OptionDescription> optionIdDescriptionMap;
  
  private final List<OptionGroupDescription> optionGroupDescriptions;
  private final List<FlyRuleDescription> flyRuleDescriptions;
  private final List<OverrideRuleDescription> overrideRuleDescriptions;
  private final List<ValidityRuleDescription> validityRuleDescriptions;

  
  /** the structure containing correspondence between classes long and short names. */
  private NameDict dict = new NameDict();

  private String description = "";

  private String formatDesc = "";
  
  public DSLInformation() {
    optionDescriptions = new LinkedList<OptionDescription>();
    optionIdDescriptionMap = new HashMap<String, OptionDescription>();
    optionGroupDescriptions = new LinkedList<OptionGroupDescription>();
    flyRuleDescriptions = new LinkedList<FlyRuleDescription>();
{'fraction_non_alphanumeric': 0.0789156626506024, 'fraction_numerical': 0.0, 'mean_word_length': 4.8674911660777385, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '6536487', 'n_tokens_mistral': 872, 'n_tokens_neox': 841, 'n_words': 278}