130 likes | 296 Views
Output. 05 / 15 / 2013. Agenda. Modularized Coding Approach Generated Examples. Modularized Coding Approach. Coded subset of overall goals Sumit’s role transformations Generation of tree with atomic strategies and roles Fitness functions Traversal performance Code generation.
E N D
Output 05/15/2013
Agenda • Modularized Coding Approach • Generated Examples
Modularized Coding Approach • Coded subset of overall goals • Sumit’s role transformations • Generation of tree with atomic strategies and roles • Fitness functions • Traversal performance • Code generation
Modularized Coding Approach • Broken into simplified modules to ensure proper functionality • For example: • Code generation was not working well based on codebase from last week’s presentation • May have been an issue with the tree setup, data structure implementation, or other • Solution: scale back complexity and ensure that proper data is being passed • Build up a simple string of operations and post-process
Modularized Coding Approach • Intent is to merge modules into unified codebase after proving correctness of functionality • Merge current code generation module into previous setup • What I learned: • Post-processing may be easier than building code output • Gives concept of location • Easier to separate wrapper functions out of main • Please note: • Terminals are not currently participating in code assignment
Examples • (WRAPPER int* buffer int low-index) Create Wrapper int* buffer int low-index
(WRAPPER int* buffer int low-index) void main() { function_1(int* buffer, int low-index, int high-index); return; } void function_1(int* buffer, int low-index, int high-index) { call_sort(buffer); }
Examples • (START_INDEX (WRAPPER int high-index int* buffer)) void main() { startIndex_xform(int* buffer); function_1(int* buffer, int low-index, int high-index); return; } 1: void function_1(int* buffer, int low-index, int high-index) { call_sort(buffer); }
Examples • (START_INDEX (WRAPPER int high-index int* buffer)) void main() { startIndex_xform(int* buffer); function_1(int* buffer, int low-index, int high-index); return; } void function_1(int* buffer, int low-index, int high-index) { call_sort(buffer); }
Code Examples void main() { endIndex_xform(int* buffer); return; } void main() { return; } void main() { buffer_xform(int* buffer); endIndex_xform(int* buffer); function_1(int* buffer, int low-index, int high-index); return; } void function_1(int* buffer, int low-index, int high-index) { call_sort(buffer); }
Code Examples void main() { startIndex_xform(int* buffer); endIndex_xform(int* buffer); endIndex_xform(int* buffer); function_1(int* buffer, int low-index, int high-index); return; } void function_1(int* buffer, int low-index, int high-index) { call_sort(buffer); endIndex_xform(int* buffer); function_2(int* buffer, int low-index, int high-index); buffer_xform(int* buffer); startIndex_xform(int* buffer); startIndex_xform(int* buffer); startIndex_xform(int* buffer); } void function_2(int* buffer, int low-index, int high-index) { call_sort(buffer); function_3(int* buffer, int low-index, int high-index); startIndex_xform(int* buffer); startIndex_xform(int* buffer); startIndex_xform(int* buffer); endIndex_xform(int* buffer); } void function_3(int* buffer, int low-index, int high-index) { call_sort(buffer); endIndex_xform(int* buffer); startIndex_xform(int* buffer); }
Code Examples • (WRAPPER (FN_PTR int high-index int high-index) (WRAPPER int low-index int* buffer)) void main() { function_1(int* buffer, int low-index, int high-index); return; } void function_1(int* buffer, int low-index, int high-index) { call_sort(buffer); void (*csort_0)(int*) = call_sort; (*csort0)(buffer); function_2(int* buffer, int low-index, int high-index); } void function_2(int* buffer, int low-index, int high-index) { call_sort(buffer); }
Next Steps • Merge into previous codebase • Terminals do not really affect output currently (hardcoding to ensure proper output) • Implement pre-condition matching between source and target modules