예제 #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;
         }
     }
 }
예제 #2
0
파일: Parser.cs 프로젝트: McSwaggens/Bolt
 public static void Parse(string text, Settings settings)
 {
     Token[] tokens = Lexer.GenerateTokens(text);
     Parse(tokens, settings);
 }
예제 #3
0
 public static void Execute(string command)
 {
     Token[] tokens = Lexer.GenerateTokens(command + "\n");
     Parser.Parse(tokens, Bolt.instance.settings);
 }