-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
413 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
TKN_VOID | ||
TKN_STAR | ||
TKN_ID(malloc) | ||
TKN_L_PAREN | ||
TKN_INT | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_VOID | ||
TKN_ID(printf) | ||
TKN_L_PAREN | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_COMMA | ||
TKN_DOTS | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_VOID | ||
TKN_ID(sprintf) | ||
TKN_L_PAREN | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_COMMA | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_COMMA | ||
TKN_DOTS | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_DIRECTIVE: | ||
TKN_ID(define) | ||
TKN_ID(PUSHARGS) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_ASM | ||
TKN_L_PAREN | ||
TKN_LIT_STR(push rdi) | ||
TKN_LIT_STR(push rsi) | ||
TKN_LIT_STR(push rdx) | ||
TKN_LIT_STR(push rcx) | ||
TKN_LIT_STR(push r8) | ||
TKN_LIT_STR(push r9) | ||
TKN_R_PAREN | ||
TKN_EOF | ||
TKN_DIRECTIVE: | ||
TKN_ID(define) | ||
TKN_ID(SLARGS) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_ASM | ||
TKN_L_PAREN | ||
TKN_LIT_STR(mov rdi, rsi) | ||
TKN_LIT_STR(mov rsi, rdx) | ||
TKN_LIT_STR(mov rdx, rcx) | ||
TKN_LIT_STR(mov rcx, r8) | ||
TKN_LIT_STR(mov r8, r9) | ||
TKN_LIT_STR(mov r9, 0) | ||
TKN_R_PAREN | ||
TKN_EOF | ||
TKN_DIRECTIVE: | ||
TKN_ID(define) | ||
TKN_ID(SRARGS) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_ASM | ||
TKN_L_PAREN | ||
TKN_LIT_STR(mov r9, r8) | ||
TKN_LIT_STR(mov r8, rcx) | ||
TKN_LIT_STR(mov rcx, rdx) | ||
TKN_LIT_STR(mov rdx, rsi) | ||
TKN_LIT_STR(mov rsi, rdi) | ||
TKN_LIT_STR(mov rdi, 0) | ||
TKN_R_PAREN | ||
TKN_EOF | ||
TKN_DIRECTIVE: | ||
TKN_ID(define) | ||
TKN_ID(POPARGS) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_ASM | ||
TKN_L_PAREN | ||
TKN_LIT_STR(pop r9) | ||
TKN_LIT_STR(pop r8) | ||
TKN_LIT_STR(pop rcx) | ||
TKN_LIT_STR(pop rdx) | ||
TKN_LIT_STR(pop rsi) | ||
TKN_LIT_STR(pop rdi) | ||
TKN_R_PAREN | ||
TKN_EOF | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_ID(cc_asprintf) | ||
TKN_L_PAREN | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_ID(inp) | ||
TKN_COMMA | ||
TKN_DOTS | ||
TKN_R_PAREN | ||
TKN_L_BRACE | ||
TKN_ID(SRARGS) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_ID(PUSHARGS) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_ID(ret) | ||
TKN_ASSIGN | ||
TKN_L_PAREN | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_R_PAREN | ||
TKN_ID(malloc) | ||
TKN_L_PAREN | ||
TKN_LIT_INT(128) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_ID(POPARGS) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_ID(sprintf) | ||
TKN_L_PAREN | ||
TKN_ID(ret) | ||
TKN_COMMA | ||
TKN_ID(inp) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_RETURN | ||
TKN_ID(ret) | ||
TKN_SEMICOLON | ||
TKN_R_BRACE | ||
TKN_INT | ||
TKN_ID(main) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_L_BRACE | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_ID(ret) | ||
TKN_ASSIGN | ||
TKN_ID(cc_asprintf) | ||
TKN_L_PAREN | ||
TKN_LIT_STR(salam %s %u%c) | ||
TKN_COMMA | ||
TKN_LIT_STR(donya) | ||
TKN_COMMA | ||
TKN_LIT_INT(123) | ||
TKN_COMMA | ||
TKN_LIT_CHAR(!) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_ID(printf) | ||
TKN_L_PAREN | ||
TKN_LIT_STR(%s %s | ||
) | ||
TKN_COMMA | ||
TKN_LIT_STR(haha) | ||
TKN_COMMA | ||
TKN_ID(ret) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_RETURN | ||
TKN_LIT_INT(0) | ||
TKN_SEMICOLON | ||
TKN_R_BRACE | ||
TKN_EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
TKN_VOID | ||
TKN_STAR | ||
TKN_ID(malloc) | ||
TKN_L_PAREN | ||
TKN_INT | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_VOID | ||
TKN_ID(printf) | ||
TKN_L_PAREN | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_COMMA | ||
TKN_DOTS | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_VOID | ||
TKN_ID(sprintf) | ||
TKN_L_PAREN | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_COMMA | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_COMMA | ||
TKN_DOTS | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_ID(cc_asprintf) | ||
TKN_L_PAREN | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_ID(inp) | ||
TKN_COMMA | ||
TKN_DOTS | ||
TKN_R_PAREN | ||
TKN_L_BRACE | ||
TKN_ASM | ||
TKN_L_PAREN | ||
TKN_LIT_STR(mov r9, r8) | ||
TKN_LIT_STR(mov r8, rcx) | ||
TKN_LIT_STR(mov rcx, rdx) | ||
TKN_LIT_STR(mov rdx, rsi) | ||
TKN_LIT_STR(mov rsi, rdi) | ||
TKN_LIT_STR(mov rdi, 0) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_ASM | ||
TKN_L_PAREN | ||
TKN_LIT_STR(push rdi) | ||
TKN_LIT_STR(push rsi) | ||
TKN_LIT_STR(push rdx) | ||
TKN_LIT_STR(push rcx) | ||
TKN_LIT_STR(push r8) | ||
TKN_LIT_STR(push r9) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_ID(ret) | ||
TKN_ASSIGN | ||
TKN_L_PAREN | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_R_PAREN | ||
TKN_ID(malloc) | ||
TKN_L_PAREN | ||
TKN_LIT_INT(128) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_ASM | ||
TKN_L_PAREN | ||
TKN_LIT_STR(pop r9) | ||
TKN_LIT_STR(pop r8) | ||
TKN_LIT_STR(pop rcx) | ||
TKN_LIT_STR(pop rdx) | ||
TKN_LIT_STR(pop rsi) | ||
TKN_LIT_STR(pop rdi) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_ID(sprintf) | ||
TKN_L_PAREN | ||
TKN_ID(ret) | ||
TKN_COMMA | ||
TKN_ID(inp) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_RETURN | ||
TKN_ID(ret) | ||
TKN_SEMICOLON | ||
TKN_R_BRACE | ||
TKN_INT | ||
TKN_ID(main) | ||
TKN_L_PAREN | ||
TKN_R_PAREN | ||
TKN_L_BRACE | ||
TKN_CHAR | ||
TKN_STAR | ||
TKN_ID(ret) | ||
TKN_ASSIGN | ||
TKN_ID(cc_asprintf) | ||
TKN_L_PAREN | ||
TKN_LIT_STR(salam %s %u%c) | ||
TKN_COMMA | ||
TKN_LIT_STR(donya) | ||
TKN_COMMA | ||
TKN_LIT_INT(123) | ||
TKN_COMMA | ||
TKN_LIT_CHAR(!) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_ID(printf) | ||
TKN_L_PAREN | ||
TKN_LIT_STR(%s %s | ||
) | ||
TKN_COMMA | ||
TKN_LIT_STR(haha) | ||
TKN_COMMA | ||
TKN_ID(ret) | ||
TKN_R_PAREN | ||
TKN_SEMICOLON | ||
TKN_RETURN | ||
TKN_LIT_INT(0) | ||
TKN_SEMICOLON | ||
TKN_R_BRACE | ||
TKN_EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
./out "" | ||
------------- | ||
haha salam donya 123! |
Oops, something went wrong.