public void LoadSettings(string configLocation) { if (!File.Exists(configLocation)) { string construct = "#Default Bolt config\n"; foreach (Setting setting in settings) { construct += "set " + setting.name + " " + setting.value.ToString() + ";\n"; } File.Create(configLocation).Close(); Thread.Sleep(10); File.WriteAllText(configLocation, construct); } else { try { Token[] tokens = Lexer.GenerateTokens(File.ReadAllText(configLocation)); Parser.Parse(tokens, this); } catch (Exception e) { LOAD_FAILED = true; } } }
public static void Parse(string text, Settings settings) { Token[] tokens = Lexer.GenerateTokens(text); Parse(tokens, settings); }
public static void Execute(string command) { Token[] tokens = Lexer.GenerateTokens(command + "\n"); Parser.Parse(tokens, Bolt.instance.settings); }