/// <summary> /// Initalize using custom settings. /// </summary> /// <param name="settings">Parsing settings to use.</param> public virtual void Init(LexSettings settings) { _reader = new Scanner(); _errors = new List <string>(); _tokenList = new List <string>(); _settings = settings; }
/// <summary> /// Initialize using the settings supplied. /// </summary> /// <param name="settings">Parse settings to use.</param> public override void Init(LexSettings settings) { base.Init(settings); _separatorMap = new Dictionary <char, char>(); _separatorMap[','] = ','; if (settings is LexListSettings) { var listsettings = (LexListSettings)settings; _separatorMap.Clear(); _separatorMap[listsettings.Delimeter] = listsettings.Delimeter; } }
/// <summary> /// Create with supplied settings. /// </summary> /// <param name="settings">Parsing settings to use.</param> public LexArgs(LexSettings settings) { Init(settings); }
/// <summary> /// Parse supplied text using supplied settings. /// </summary> /// <param name="line">List to parse.</param> /// <param name="settings">Parsing settings to use.</param> /// <returns>List with parse results.</returns> public static List <string> Parse(string line, LexSettings settings) { LexArgs lex = new LexArgs(settings); return(lex.ParseText(line)); }