public void LoopReversal( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_loop_rev = GetGFunction("fib loop reversed.c"); Assert.IsTrue(fib == fib_loop_rev); }
public void RedundantVar( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_redundant_var = GetGFunction("fib redundant var.c"); Assert.IsTrue(fib == fib_redundant_var); }
public void Datatype( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_datatype = GetGFunction("fib datatype.c"); Assert.IsTrue(fib_datatype == fib); }
public void SingularDecl( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_singular_decl = GetGFunction("fib singular decl.c"); Assert.IsTrue(fib == fib_singular_decl); }
public void RedundantExpressions( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_redundant_expr = GetGFunction("fib redundant expressions.c"); Assert.IsTrue(fib == fib_redundant_expr); }
public void VarRenamed( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_refactored = GetGFunction("fib var renamed.c"); Assert.IsTrue(fib == fib_refactored); }
public void Macros( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_macro = GetGFunction("fib macro.c"); Assert.IsTrue(fib == fib_macro); }
public void ExactSame( ) { GFunction fact = GetGFunction("fib.c"); GFunction fib_same = GetGFunction("fib same.c"); Assert.IsTrue(fact == fib_same); }
public void ConditionReversed( ) { GFunction max = GetGFunction("max.c"); GFunction max_cond_rev = GetGFunction("max condition rev.c"); Assert.IsTrue(max == max_cond_rev); }
public void Refactored( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_refactored = GetGFunction("fib refactored.c"); Assert.IsTrue(fib == fib_refactored); }
// Constructor public FunctionBlock(GFunction function) { // Initialize Component InitializeComponent(); // Initialize Hole List _HoleList = new List <BaseHole> { NextConnectHole }; // Initialize Objects _GFunction = function; _GObjectList = new List <GBase> { GScope }; StackContentText.Text = function.FunctionName; // Initialize Events NextConnectHole.BlockAttached += RealNextConnectHole_BlockChanged; NextConnectHole.BlockDetached += RealNextConnectHole_BlockChanged; // Initialize Block InitializeBlock(); }
public void CommentsAndIndentation( ) { GFunction fib = GetGFunction("fib.c"); GFunction fib_comments_indent = GetGFunction("fib comments and indentation.c"); Assert.IsTrue(fib == fib_comments_indent); }
public static GFunction getGFunction(string fileName) { var optimizer = new Optimizer(fileName); var gimple = optimizer.GIMPLE; GFunction gFunction = new GFunction(gimple); return(gFunction); }
public static GFunction GetGFunction(string fileName) { var optimizer = new Optimizer(fileName) { Rebuild = true }; optimizer.Run( ); var gimple = optimizer.GIMPLE; var gFunction = new GFunction(gimple, fileName); return(gFunction); }
internal GOpCall Merge(GOpCall gc) { /* * For the merge to be possible, calls to the same * Function should target the same GFunction. */ foreach (var kvp in gc.cfm) { Function f = kvp.Key; GFunction gf2 = kvp.Value; GFunction gf1; if (!cfm.TryGetValue(f, out gf1)) { continue; } if (gf1 != gf2) { return(null); } } /* * Compute the merged dispatcher. */ Dispatcher d3 = Dispatcher.Merge(dispatcher, gc.dispatcher); if (d3 == null) { return(null); } /* * Merge the maps. */ SortedDictionary <Function, GFunction> cfm3 = new SortedDictionary <Function, GFunction>(); foreach (var kvp in cfm) { cfm3[kvp.Key] = kvp.Value; } foreach (var kvp in gc.cfm) { cfm3[kvp.Key] = kvp.Value; } return(new GOpCall(fname, d3, cfm3)); }
private void materialRaisedButton3_Click(object sender, EventArgs e) { if (file_1 == null || file_2 == null) { MessageBox.Show("Please Upload File", "Error"); return; } GFunction gFunc1 = getGFunction(file_1); GFunction gFunc2 = getGFunction(file_2); decimal result = gFunc1.Compare(gFunc2); label1.Text = result.ToString(); File.Delete(Path.Combine(project_dir, file_1)); File.Delete(Path.Combine(project_dir, file_2)); }
public void GitHub_Issue_144_1() { // GetGFunction1 is defined outside the test function GFunction gFunc1 = GetGFunction1; Assert.True(gFunc1.Method.GetParameters()[0].HasDefaultValue); var flags = BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance; var invokeMethod1 = (MethodInfo)gFunc1.GetType().FindMembers(MemberTypes.Method, flags, Type.FilterName, "Invoke")[0]; Assert.True(invokeMethod1.GetParameters()[0].HasDefaultValue); var interpreter = new Interpreter(); interpreter.SetFunction("GFunction", gFunc1); interpreter.SetVariable("arg", "arg"); Assert.True((bool)interpreter.Eval("GFunction(arg)")); Assert.False((bool)interpreter.Eval("GFunction()")); }
// 함수 선언 public FunctionBlock DefineFunction(string funcName) { var function = new GFunction(funcName); return(FunctionList[funcName] = new FunctionBlock(function)); }
public void Append(GFunction func) { functionList.Add(func); }