-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from hyouteki/reduce-ast
Reduce ast
- Loading branch information
Showing
10 changed files
with
199 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -11,6 +11,8 @@ function fib, 1 | |
a = t | ||
i = i + 1 | ||
goto begin | ||
d = 0 | ||
d = d + 1 | ||
// label hello | ||
// ret 3 | ||
label end | ||
|
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,33 @@ | ||
digraph "./eg/test.irl.dot" { | ||
subgraph cluster_fib { | ||
label="fib"; | ||
graph [style=filled]; | ||
fib_ENTRY [label="ENTRY"]; | ||
fib_EXIT [label="EXIT"]; | ||
fib_ENTRY -> fib_BB0; | ||
fib_BB0 [shape=record label="[0]\n"]; | ||
fib_BB0 -> fib_BB1; | ||
fib_BB1 [shape=record label="[1]\na = 0\lb = 1\li = 1\l"]; | ||
fib_BB1 -> fib_BB2; | ||
fib_BB2 [shape=record label="[2 - begin]\n"]; | ||
fib_BB2 -> fib_BB3; | ||
fib_BB2 -> fib_BB4; | ||
fib_BB3 [shape=record label="[3 - end]\nret b\l"]; | ||
fib_BB3 -> fib_EXIT; | ||
fib_BB4 [shape=record label="[4]\nt = b\lb = a + b\la = t\li = i + 1\l"]; | ||
fib_BB4 -> fib_BB2; | ||
} | ||
|
||
subgraph cluster_main { | ||
label="main"; | ||
graph [style=filled]; | ||
main_ENTRY [label="ENTRY"]; | ||
main_EXIT [label="EXIT"]; | ||
main_ENTRY -> main_BB0; | ||
main_BB0 [shape=record label="[0]\n"]; | ||
main_BB0 -> main_BB1; | ||
main_BB1 [shape=record label="[1]\nparam 3\la = call fib, 1\lret a\l"]; | ||
main_BB1 -> main_EXIT; | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.