public void GetDefaultSettings() { string executingPath = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName); string defaultSetting = Path.Join(executingPath, "default.lig"); if (File.Exists(defaultSetting)) { string text = File.ReadAllText(defaultSetting); Parser parser = new Parser(); parser.Load(text, 0); ProgramAST p = parser.Parse(); p.Statements.Statements.RemoveAll(ast => !(ast is ConfAST)); Interpreter interpreter = Interpreter.GetInstance(defaultSetting); interpreter.Interpret(p); } ApplySetting(); }
private object Visit(ProgramAST programAST) { currentScope = new ScopeSymbolTable(programAST.Name, 0); modules[CurrentFileName] = currentScope; return(Visit(programAST.Statements)); }
public void Interpret(ProgramAST programAST) { logger.Info($"Interpreter started at {CurrentFileName}"); Visit(programAST); }