Commit 4a823919 authored by Wilke Pierre's avatar Wilke Pierre
Browse files

tests type

parent 168a8ffd
int main(int argc,char* argv[]){
int main(){
char c = 'b';
print_char(c);
return c;
......
{"output": "b", "error": null, "retval": 98}
\ No newline at end of file
{"output": "b", "error": null, "retval": 98}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_CHAR
SYM_IDENTIFIER(c)
SYM_ASSIGN
SYM_CHARACTER(b)
SYM_SEMICOLON
SYM_IDENTIFIER(print_char)
SYM_LPARENTHESIS
SYM_IDENTIFIER(c)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_IDENTIFIER(c)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(){
char c = 'b';
print_char(c+1);
return c;
}
{"output": "c", "error": null, "retval": 98}
\ No newline at end of file
{"output": "c", "error": null, "retval": 98}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_CHAR
SYM_IDENTIFIER(c)
SYM_ASSIGN
SYM_CHARACTER(b)
SYM_SEMICOLON
SYM_IDENTIFIER(print_char)
SYM_LPARENTHESIS
SYM_IDENTIFIER(c)
SYM_PLUS
SYM_INTEGER(1)
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_IDENTIFIER(c)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
......@@ -2,7 +2,7 @@ char f(char c){
return c + 1;
}
int main(int argc, char** argv){
int main(){
print_char(f('c'));
return 0;
}
{"output": "d", "error": null, "retval": 0}
\ No newline at end of file
{"output": "d", "error": null, "retval": 0}
\ No newline at end of file
SYM_CHAR
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_CHAR
SYM_IDENTIFIER(c)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(c)
SYM_PLUS
SYM_INTEGER(1)
SYM_SEMICOLON
SYM_RBRACE
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(print_char)
SYM_LPARENTHESIS
SYM_IDENTIFIER(f)
SYM_LPARENTHESIS
SYM_CHARACTER(c)
SYM_RPARENTHESIS
SYM_RPARENTHESIS
SYM_SEMICOLON
SYM_RETURN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(int a){
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": 3}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_INT
SYM_IDENTIFIER(a)
SYM_RPARENTHESIS
SYM_LBRACE
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){
int x;
if(a < 12){
if(a < 23){
x = 1;
} else {
x = 3;
}
} else {
if (a < 12){
x = 2;
} else {
x = 4;
}
}
return x;
}
{"output": "", "error": null, "retval": 4}
\ 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_INT
SYM_IDENTIFIER(a)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_INT
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_IF
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_LT
SYM_INTEGER(12)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IF
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_LT
SYM_INTEGER(23)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(1)
SYM_SEMICOLON
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(3)
SYM_SEMICOLON
SYM_RBRACE
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_IF
SYM_LPARENTHESIS
SYM_IDENTIFIER(a)
SYM_LT
SYM_INTEGER(12)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(2)
SYM_SEMICOLON
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_IDENTIFIER(x)
SYM_ASSIGN
SYM_INTEGER(4)
SYM_SEMICOLON
SYM_RBRACE
SYM_RBRACE
SYM_RETURN
SYM_IDENTIFIER(x)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment