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 163 additions and 0 deletions
/** /**/
/** Commentaire ! */
int main(){
return 23;
}
{"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_RETURN
SYM_INTEGER(23)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
// Hello, this is a comment
int main(int a){
/* a multi-line
comment*/
return a / 2;
}
{"output": "", "error": null, "retval": 7}
\ No newline at end of file
{"output": "", "error": null, "retval": 0}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_INT
SYM_IDENTIFIER(a)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_RETURN
SYM_IDENTIFIER(a)
SYM_DIV
SYM_INTEGER(2)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(int n){
while(n > 0){
n = n - 1;
}
return n;
}
{"output": "", "error": null, "retval": 0}
\ No newline at end of file
{"output": "", "error": null, "retval": 0}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_INT
SYM_IDENTIFIER(n)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_WHILE
SYM_LPARENTHESIS
SYM_IDENTIFIER(n)
SYM_GT
SYM_INTEGER(0)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(n)
SYM_ASSIGN
SYM_IDENTIFIER(n)
SYM_MINUS
SYM_INTEGER(1)
SYM_SEMICOLON
SYM_RBRACE
SYM_RETURN
SYM_IDENTIFIER(n)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(int n){
n = n * 2;
return n;
}
{"output": "", "error": null, "retval": 28}
\ No newline at end of file
{"output": "", "error": null, "retval": 2}
\ No newline at end of file
SYM_INT
SYM_IDENTIFIER(main)
SYM_LPARENTHESIS
SYM_INT
SYM_IDENTIFIER(n)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(n)
SYM_ASSIGN
SYM_IDENTIFIER(n)
SYM_ASTERISK
SYM_INTEGER(2)
SYM_SEMICOLON
SYM_RETURN
SYM_IDENTIFIER(n)
SYM_SEMICOLON
SYM_RBRACE
SYM_EOF
int main(int n){
if(n < 0) { n = 0; }
else { }
int res = 1;
while(n > 0){
res = n * res;
n = n - 1;
}
return res;
}
{"output": "", "error": null, "retval": 87178291200}
\ 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(n)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IF
SYM_LPARENTHESIS
SYM_IDENTIFIER(n)
SYM_LT
SYM_INTEGER(0)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(n)
SYM_ASSIGN
SYM_INTEGER(0)
SYM_SEMICOLON
SYM_RBRACE
SYM_ELSE
SYM_LBRACE
SYM_RBRACE
SYM_INT
SYM_IDENTIFIER(res)
SYM_ASSIGN
SYM_INTEGER(1)
SYM_SEMICOLON
SYM_WHILE
SYM_LPARENTHESIS
SYM_IDENTIFIER(n)
SYM_GT
SYM_INTEGER(0)
SYM_RPARENTHESIS
SYM_LBRACE
SYM_IDENTIFIER(res)
SYM_ASSIGN
SYM_IDENTIFIER(n)
SYM_ASTERISK
SYM_IDENTIFIER(res)
SYM_SEMICOLON
SYM_IDENTIFIER(n)
SYM_ASSIGN
SYM_IDENTIFIER(n)
SYM_MINUS
SYM_INTEGER(1)
SYM_SEMICOLON
SYM_RBRACE
SYM_RETURN
SYM_IDENTIFIER(res)
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