// Legacy entry point for testing private static void LegacyMain(string[] args) { DirectoryInfo debugDirectoryInfo = Directory.GetParent(Directory.GetCurrentDirectory()); string workingDirectory = debugDirectoryInfo.Parent.Parent.Parent.Parent.FullName; string filename = "AssertTrue.sol"; string solcPath = workingDirectory + "\\Tool\\solc.exe"; string filePath = workingDirectory + "\\Test\\regression\\" + filename; SolidityCompiler compiler = new SolidityCompiler(); CompilerOutput compilerOutput = compiler.Compile(solcPath, filePath); AST ast = new AST(compilerOutput); Console.WriteLine(ast.GetSourceUnits()); Console.ReadLine(); }
public bool Execute(string filename) { string filePath = testDirectory + "\\" + filename; // read the program text string programText = File.ReadAllText(filePath); // get the text of AST traversal SolidityCompiler compiler = new SolidityCompiler(); CompilerOutput compilerOutput = compiler.Compile(solcPath, filePath); AST ast = new AST(compilerOutput); ASTNode sourceUnits = ast.GetSourceUnits(); return(TextCompare(programText, sourceUnits.ToString())); }