Skip to content

mdkaleem364/C_TO_IR

Repository files navigation



TODO

  1. remove pre and post incr in 'if'

  2. add space after else if there is no if.

  3. switch (omkar)

  4. elseif(++i) (omkar - where to put assign i i , under which block)

  5. ternary ops (omkar)

  6. while(scanf("%d",&x)){} => output? (omkar)

  7. int a=printf("%s\n", c); => output? (omkar)

  8. sentinal for fn calls - kaleem "not required" bol raha hai

  9. check assignments stmts in binary ops: for( ;k<3 && (i=j);)

    assign i j loop k i 1 assign i j

  10. pointers – same as arrays (omkar - pointer example)

  11. procedures other than main

  12. for loop cond section contains functions ? (same as above)

  13. a[i][i][i] = a[i][i][i] + 1 ? => assign a i a (only used are output once... changed are printed times)

  14. for loop initialization lines count if funciton is inside a for loop

  15. a[++i] = j; => assign i i assign a i j

  16. merge assign and multiassign fns

  17. sed - remove multiple occurance of vars not changed in assignment stmts

  18. int a[3], a[i];

  19. int i = somefunction(a, b);

  20. include handlePreUnary and PostUnary fns in for, while and assignment fns

  21. if(i>4){ printf("%s\n", c); } else if( ++i){ scanf("%d", &n); } (omkar)

n. make compatible with input names

a = max(i, j); --- rcall max a i j max(i, j); call max i j reset(a); --- call reset a

a = i + j; a[i] = j;

max(a, max(b,c));

$1 = max(b,c)
max(a, $1)

====================

main :

a int
b array
c struct

...

DONE

functions call in printf() - ‘$i’ - $1 fine - parse output twice using sentinal

no cond var in for loop ? - direct no of lines

multiple invars - two versions of code

handle array decls.

arrays - ‘a[i] = j’ => assign a i j

handled fscanf and fprintf

handled multiple function declarations and definitions

handled preincrement and post increment ops in "if condition stmts" handled preincrement and post increment ops in array and variable declarations

handled function calls during assignment stmts

structure

multiple assignments in one statement.

// not handled

int i = arr[++j];

int a = b+=c;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages