Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • theo.putegnat/infosec-ecomp
  • damien.armillon/infosec-ecomp
  • mouhamed.sougou/infosec-ecomp
  • cidre-public/compilation/infosec-ecomp
4 results
Show changes
Showing
with 426 additions and 20 deletions
SYM_IDENTIFIER(gcd)
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_COMMA
SYM_IDENTIFIER(b)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IF
SYM_LPARENTHESIS
SYM_IDENTIFIER(b)
SYM_EQUALITY
SYM_INTEGER(0)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(a)
SYM_SEMICOLON
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(gcd)
SYM_LPARENTHESIS
SYM_IDENTIFIER(b)
SYM_COMMA
SYM_IDENTIFIER(a)
SYM_MOD
SYM_IDENTIFIER(b)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RBRACE
SYM_RBRACE
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_COMMA
SYM_IDENTIFIER(b)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(gcd)
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_COMMA
SYM_IDENTIFIER(b)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(int argc,char* argv[]){ main(ndisque){
int ndisque = atoi(argv[1]);
return hanoi(ndisque); return hanoi(ndisque);
} }
int hanoi(int n) hanoi(n)
{ {
if(n > 0) if(n > 0)
{ {
int x = hanoi(n-1); x = hanoi(n-1);
return 1 + 2 * x; return 1 + 2 * x;
} }
return 0; return 0;
......
{"output": "", "error": null, "retval": 16383}
\ No newline at end of file
{"output": "", "error": null, "retval": 1}
\ No newline at end of file
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_IDENTIFIER(ndisque)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(hanoi)
SYM_LPARENTHESIS
SYM_IDENTIFIER(ndisque)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RBRACE
SYM_IDENTIFIER(hanoi)
SYM_LPARENTHESIS
SYM_IDENTIFIER(n)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IF
SYM_LPARENTHESIS
SYM_IDENTIFIER(n)
SYM_GT
SYM_INTEGER(0)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_IDENTIFIER(hanoi)
SYM_LPARENTHESIS
SYM_IDENTIFIER(n)
SYM_MINUS
SYM_INTEGER(1)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_INTEGER(1)
SYM_PLUS
SYM_INTEGER(2)
SYM_ASTERISK
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_RETURN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int f(int a, f(a,
int b, b,
int c, c,
int d, d,
int e, e,
int f, f,
int g, g,
int h, h,
int i, i,
int j j
){ ){
return a + b * c + d * e * f + g * h * i * j; return a + b * c + d * e * f + g * h * i * j;
} }
int main(int argc, char* argv[]){ main(){
return f(1,2,3,4,5,6,7,8,9,10); return f(1,2,3,4,5,6,7,8,9,10);
} }
{"output": "", "error": null, "retval": 5167}
\ No newline at end of file
{"output": "", "error": null, "retval": 5167}
\ No newline at end of file
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_COMMA
SYM_IDENTIFIER(b)
SYM_COMMA
SYM_IDENTIFIER(c)
SYM_COMMA
SYM_IDENTIFIER(d)
SYM_COMMA
SYM_IDENTIFIER(e)
SYM_COMMA
SYM_IDENTIFIER(f)
SYM_COMMA
SYM_IDENTIFIER(g)
SYM_COMMA
SYM_IDENTIFIER(h)
SYM_COMMA
SYM_IDENTIFIER(i)
SYM_COMMA
SYM_IDENTIFIER(j)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(a)
SYM_PLUS
SYM_IDENTIFIER(b)
SYM_ASTERISK
SYM_IDENTIFIER(c)
SYM_PLUS
SYM_IDENTIFIER(d)
SYM_ASTERISK
SYM_IDENTIFIER(e)
SYM_ASTERISK
SYM_IDENTIFIER(f)
SYM_PLUS
SYM_IDENTIFIER(g)
SYM_ASTERISK
SYM_IDENTIFIER(h)
SYM_ASTERISK
SYM_IDENTIFIER(i)
SYM_ASTERISK
SYM_IDENTIFIER(j)
SYM_SEMICOLON
SYM_RBRACE
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_INTEGER(1)
SYM_COMMA
SYM_INTEGER(2)
SYM_COMMA
SYM_INTEGER(3)
SYM_COMMA
SYM_INTEGER(4)
SYM_COMMA
SYM_INTEGER(5)
SYM_COMMA
SYM_INTEGER(6)
SYM_COMMA
SYM_INTEGER(7)
SYM_COMMA
SYM_INTEGER(8)
SYM_COMMA
SYM_INTEGER(9)
SYM_COMMA
SYM_INTEGER(10)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int g(int x){ g(x){
return x; return x;
} }
int f(int a, int b){ f(a, b){
b = g(8); b = g(8);
print(a); print(a);
print(b); print(b);
return 0; return 0;
} }
int main(int argc, char* argv[]){ main(){
f(3,4); f(3,4);
return 0; return 0;
} }
{"output": "3\n8\n", "error": null, "retval": 0}
\ No newline at end of file
{"output": "3\n8\n", "error": null, "retval": 0}
\ No newline at end of file
SYM_IDENTIFIER(g)
SYM_LPARENTHESIS
SYM_IDENTIFIER(x)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_COMMA
SYM_IDENTIFIER(b)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(b)
SYM_ASSIGN
SYM_IDENTIFIER(g)
SYM_LPARENTHESIS
SYM_INTEGER(8)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_IDENTIFIER(print)
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_IDENTIFIER(print)
SYM_LPARENTHESIS
SYM_IDENTIFIER(b)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_RBRACE
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_INTEGER(3)
SYM_COMMA
SYM_INTEGER(4)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
struct S {
int x;
int y;
int z;
};
struct S *p;
struct S t[3];
int main(){
(t[0]).x = 1;
(t[0]).y = 2;
(t[0]).z = 3;
(t[1]).x = 4;
(t[1]).y = 5;
(t[1]).z = 6;
(t[2]).x = 7;
(t[2]).y = 8;
(t[2]).z = 9;
p = &(t[2]);
return (*p).y;
}
{"output": "", "error": null, "retval": 8}
\ No newline at end of file
{"output": "", "error": null, "retval": 8}
\ No newline at end of file
SYM_STRUCT
SYM_IDENTIFIER(S)
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(z)
SYM_SEMICOLON
SYM_RBRACE
SYM_SEMICOLON
SYM_STRUCT
SYM_IDENTIFIER(S)
SYM_ASTERISK
SYM_IDENTIFIER(p)
SYM_SEMICOLON
SYM_STRUCT
SYM_IDENTIFIER(S)
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(3)
SYM_RBRACKET
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(0)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(1)
SYM_SEMICOLON
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(0)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_INTEGER(2)
SYM_SEMICOLON
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(0)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(z)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(1)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(4)
SYM_SEMICOLON
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(1)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_INTEGER(5)
SYM_SEMICOLON
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(1)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(z)
SYM_ASSIGN
SYM_INTEGER(6)
SYM_SEMICOLON
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(2)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(7)
SYM_SEMICOLON
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(2)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(y)
SYM_ASSIGN
SYM_INTEGER(8)
SYM_SEMICOLON
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(2)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(z)
SYM_ASSIGN
SYM_INTEGER(9)
SYM_SEMICOLON
SYM_IDENTIFIER(p)
SYM_ASSIGN
SYM_AMPERSAND
SYM_LPARENTHESIS
SYM_IDENTIFIER(t)
SYM_LBRACKET
SYM_INTEGER(2)
SYM_RBRACKET
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_LPARENTHESIS
SYM_ASTERISK
SYM_IDENTIFIER(p)
SYM_RPARENTHESIS
SYM_POINT
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int i = 37; int i = 37;
int main(int argc, char** argv){ int main(){
return i; return i;
} }
{"output": "", "error": null, "retval": 37}
\ No newline at end of file
{"output": "", "error": null, "retval": 37}
\ No newline at end of file