Skip to content
Snippets Groups Projects
Commit 4a823919 authored by Wilke Pierre's avatar Wilke Pierre
Browse files

tests type

parent 168a8ffd
No related branches found
No related tags found
No related merge requests found
Showing
with 211 additions and 0 deletions
int main(int x, int y){
return 2 * x + y;
}
{"output": "", "error": null, "retval": 40}
\ No newline at end of file
{"output": "", "error": null, "retval": 4}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_INT
SYM_IDENTIFIER(x)
SYM_COMMA
SYM_INT
SYM_IDENTIFIER(y)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_INTEGER(2)
SYM_ASTERISK
SYM_IDENTIFIER(x)
SYM_PLUS
SYM_IDENTIFIER(y)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(){
int a = 5 * 7;
if(a > 12){
a = 1;
} else { a = 3 * a; }
return a;
}
{"output": "", "error": null, "retval": 1}
\ No newline at end of file
{"output": "", "error": null, "retval": 1}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(a)
SYM_ASSIGN
SYM_INTEGER(5)
SYM_ASTERISK
SYM_INTEGER(7)
SYM_SEMICOLON
SYM_IF
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_GT
SYM_INTEGER(12)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(a)
SYM_ASSIGN
SYM_INTEGER(1)
SYM_SEMICOLON
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_IDENTIFIER(a)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_ASTERISK
SYM_IDENTIFIER(a)
SYM_SEMICOLON
SYM_RBRACE
SYM_RETURN
SYM_IDENTIFIER(a)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(){
int a = 3;
return (a*5)+4*(3-2);
}
{"output": "", "error": null, "retval": 19}
\ No newline at end of file
{"output": "", "error": null, "retval": 19}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(a)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_RETURN
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_ASTERISK
SYM_INTEGER(5)
SYM_RPARENTHESIS
SYM_PLUS
SYM_INTEGER(4)
SYM_ASTERISK
SYM_LPARENTHESIS
SYM_INTEGER(3)
SYM_MINUS
SYM_INTEGER(2)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(){
int a_simple_variable = 8;
return a_simple_variable + 5 * 3;
}
{"output": "", "error": null, "retval": 23}
\ No newline at end of file
{"output": "", "error": null, "retval": 23}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(a_simple_variable)
SYM_ASSIGN
SYM_INTEGER(8)
SYM_SEMICOLON
SYM_RETURN
SYM_IDENTIFIER(a_simple_variable)
SYM_PLUS
SYM_INTEGER(5)
SYM_ASTERISK
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(int n, int m){
int a = 10;
int b = 20;
int x;
if (3 > n){
x = a;
} else {
x = b;
}
return x;
}
int f(int x){
int n = 3;
return 3 * x;
}
{"output": "", "error": null, "retval": 20}
\ No newline at end of file
{"output": "", "error": null, "retval": 10}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_INT
SYM_IDENTIFIER(n)
SYM_COMMA
SYM_INT
SYM_IDENTIFIER(m)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(a)
SYM_ASSIGN
SYM_INTEGER(10)
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(b)
SYM_ASSIGN
SYM_INTEGER(20)
SYM_SEMICOLON
SYM_INT
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_IF
SYM_LPARENTHESIS
SYM_INTEGER(3)
SYM_GT
SYM_IDENTIFIER(n)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_IDENTIFIER(a)
SYM_SEMICOLON
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_IDENTIFIER(b)
SYM_SEMICOLON
SYM_RBRACE
SYM_RETURN
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_INT
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_INT
SYM_IDENTIFIER(x)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(n)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_RETURN
SYM_INTEGER(3)
SYM_ASTERISK
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment