Exemplo n.º 1
0
 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;
         }
     }
 }
Exemplo n.º 2
0
 public static void Parse(string text, Settings settings)
 {
     Token[] tokens = Lexer.GenerateTokens(text);
     Parse(tokens, settings);
 }
Exemplo n.º 3
0
 public static void Execute(string command)
 {
     Token[] tokens = Lexer.GenerateTokens(command + "\n");
     Parser.Parse(tokens, Bolt.instance.settings);
 }