private static void runFile(string path) // REPL without the loop { Object.Environment env = Object.Environment.NewEnvironment(); Object.Environment macroEnv = Object.Environment.NewEnvironment(); string source = readFile(path); lexer.Lexer l = lexer.Lexer.New(source); parser.Parser p = parser.Parser.New(l); ast.Program program = p.ParseProgram(); if (parser.Parser.Errors().Count != 0) { repl.printParserErrors(parser.Parser.Errors()); System.Environment.Exit(77); } evaluator.macro_expansion.DefineMacros(program, macroEnv); ast.Node expanded = evaluator.macro_expansion.ExpandMacros(program, macroEnv); Object.Object evaluated = evaluator.evaluator.Eval(expanded, env); if (evaluated != null) { System.Console.Write(evaluated.Inspect()); System.Console.WriteLine(); } }
/// <summary> /// Constructor /// Invoke constructor of base cass /// </summary> /// <param name="location">xml file location in URL form</param> public RawDataDblp(string location) : base(location) { p = new parser.Parser(base.location); p.Load(); }