Add complete assignment description and starter code.

This commit is contained in:
Rob Hess
2019-05-14 12:00:45 -07:00
commit ee407b6450
16 changed files with 798 additions and 0 deletions

87
example_output/p1.gv Normal file
View File

@@ -0,0 +1,87 @@
digraph G {
n0 [label="Block"];
n0 -> n0_0;
n0_0 [label="Assignment"];
n0_0 -> n0_0_lhs;
n0_0_lhs [shape=box,label="Identifier: pi"];
n0_0 -> n0_0_rhs;
n0_0_rhs [shape=box,label="Float: 3.1415"];
n0 -> n0_1;
n0_1 [label="Assignment"];
n0_1 -> n0_1_lhs;
n0_1_lhs [shape=box,label="Identifier: r"];
n0_1 -> n0_1_rhs;
n0_1_rhs [shape=box,label="Float: 8"];
n0 -> n0_2;
n0_2 [label="Assignment"];
n0_2 -> n0_2_lhs;
n0_2_lhs [shape=box,label="Identifier: circle_area"];
n0_2 -> n0_2_rhs;
n0_2_rhs [label="TIMES"];
n0_2_rhs -> n0_2_rhs_lhs;
n0_2_rhs_lhs [label="TIMES"];
n0_2_rhs_lhs -> n0_2_rhs_lhs_lhs;
n0_2_rhs_lhs_lhs [shape=box,label="Identifier: pi"];
n0_2_rhs_lhs -> n0_2_rhs_lhs_rhs;
n0_2_rhs_lhs_rhs [shape=box,label="Identifier: r"];
n0_2_rhs -> n0_2_rhs_rhs;
n0_2_rhs_rhs [shape=box,label="Identifier: r"];
n0 -> n0_3;
n0_3 [label="Assignment"];
n0_3 -> n0_3_lhs;
n0_3_lhs [shape=box,label="Identifier: circle_circum"];
n0_3 -> n0_3_rhs;
n0_3_rhs [label="TIMES"];
n0_3_rhs -> n0_3_rhs_lhs;
n0_3_rhs_lhs [label="TIMES"];
n0_3_rhs_lhs -> n0_3_rhs_lhs_lhs;
n0_3_rhs_lhs_lhs [shape=box,label="Identifier: pi"];
n0_3_rhs_lhs -> n0_3_rhs_lhs_rhs;
n0_3_rhs_lhs_rhs [shape=box,label="Integer: 2"];
n0_3_rhs -> n0_3_rhs_rhs;
n0_3_rhs_rhs [shape=box,label="Identifier: r"];
n0 -> n0_4;
n0_4 [label="Assignment"];
n0_4 -> n0_4_lhs;
n0_4_lhs [shape=box,label="Identifier: sphere_vol"];
n0_4 -> n0_4_rhs;
n0_4_rhs [label="TIMES"];
n0_4_rhs -> n0_4_rhs_lhs;
n0_4_rhs_lhs [label="TIMES"];
n0_4_rhs_lhs -> n0_4_rhs_lhs_lhs;
n0_4_rhs_lhs_lhs [label="TIMES"];
n0_4_rhs_lhs_lhs -> n0_4_rhs_lhs_lhs_lhs;
n0_4_rhs_lhs_lhs_lhs [label="TIMES"];
n0_4_rhs_lhs_lhs_lhs -> n0_4_rhs_lhs_lhs_lhs_lhs;
n0_4_rhs_lhs_lhs_lhs_lhs [label="DIVIDEDBY"];
n0_4_rhs_lhs_lhs_lhs_lhs -> n0_4_rhs_lhs_lhs_lhs_lhs_lhs;
n0_4_rhs_lhs_lhs_lhs_lhs_lhs [shape=box,label="Float: 4"];
n0_4_rhs_lhs_lhs_lhs_lhs -> n0_4_rhs_lhs_lhs_lhs_lhs_rhs;
n0_4_rhs_lhs_lhs_lhs_lhs_rhs [shape=box,label="Float: 3"];
n0_4_rhs_lhs_lhs_lhs -> n0_4_rhs_lhs_lhs_lhs_rhs;
n0_4_rhs_lhs_lhs_lhs_rhs [shape=box,label="Identifier: pi"];
n0_4_rhs_lhs_lhs -> n0_4_rhs_lhs_lhs_rhs;
n0_4_rhs_lhs_lhs_rhs [shape=box,label="Identifier: r"];
n0_4_rhs_lhs -> n0_4_rhs_lhs_rhs;
n0_4_rhs_lhs_rhs [shape=box,label="Identifier: r"];
n0_4_rhs -> n0_4_rhs_rhs;
n0_4_rhs_rhs [shape=box,label="Identifier: r"];
n0 -> n0_5;
n0_5 [label="Assignment"];
n0_5 -> n0_5_lhs;
n0_5_lhs [shape=box,label="Identifier: sphere_surf_area"];
n0_5 -> n0_5_rhs;
n0_5_rhs [label="TIMES"];
n0_5_rhs -> n0_5_rhs_lhs;
n0_5_rhs_lhs [label="TIMES"];
n0_5_rhs_lhs -> n0_5_rhs_lhs_lhs;
n0_5_rhs_lhs_lhs [label="TIMES"];
n0_5_rhs_lhs_lhs -> n0_5_rhs_lhs_lhs_lhs;
n0_5_rhs_lhs_lhs_lhs [shape=box,label="Integer: 4"];
n0_5_rhs_lhs_lhs -> n0_5_rhs_lhs_lhs_rhs;
n0_5_rhs_lhs_lhs_rhs [shape=box,label="Identifier: pi"];
n0_5_rhs_lhs -> n0_5_rhs_lhs_rhs;
n0_5_rhs_lhs_rhs [shape=box,label="Identifier: r"];
n0_5_rhs -> n0_5_rhs_rhs;
n0_5_rhs_rhs [shape=box,label="Identifier: r"];
}

BIN
example_output/p1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

87
example_output/p2.gv Normal file
View File

@@ -0,0 +1,87 @@
digraph G {
n0 [label="Block"];
n0 -> n0_0;
n0_0 [label="Assignment"];
n0_0 -> n0_0_lhs;
n0_0_lhs [shape=box,label="Identifier: a"];
n0_0 -> n0_0_rhs;
n0_0_rhs [shape=box,label="Boolean: 1"];
n0 -> n0_1;
n0_1 [label="Assignment"];
n0_1 -> n0_1_lhs;
n0_1_lhs [shape=box,label="Identifier: b"];
n0_1 -> n0_1_rhs;
n0_1_rhs [shape=box,label="Boolean: 0"];
n0 -> n0_2;
n0_2 [label="Assignment"];
n0_2 -> n0_2_lhs;
n0_2_lhs [shape=box,label="Identifier: x"];
n0_2 -> n0_2_rhs;
n0_2_rhs [shape=box,label="Integer: 7"];
n0 -> n0_3;
n0_3 [label="If"];
n0_3 -> n0_3_cond;
n0_3_cond [shape=box,label="Identifier: a"];
n0_3 -> n0_3_if;
n0_3_if [label="Block"];
n0_3_if -> n0_3_if_0;
n0_3_if_0 [label="Assignment"];
n0_3_if_0 -> n0_3_if_0_lhs;
n0_3_if_0_lhs [shape=box,label="Identifier: x"];
n0_3_if_0 -> n0_3_if_0_rhs;
n0_3_if_0_rhs [shape=box,label="Integer: 5"];
n0_3_if -> n0_3_if_1;
n0_3_if_1 [label="If"];
n0_3_if_1 -> n0_3_if_1_cond;
n0_3_if_1_cond [shape=box,label="Identifier: b"];
n0_3_if_1 -> n0_3_if_1_if;
n0_3_if_1_if [label="Block"];
n0_3_if_1_if -> n0_3_if_1_if_0;
n0_3_if_1_if_0 [label="Assignment"];
n0_3_if_1_if_0 -> n0_3_if_1_if_0_lhs;
n0_3_if_1_if_0_lhs [shape=box,label="Identifier: y"];
n0_3_if_1_if_0 -> n0_3_if_1_if_0_rhs;
n0_3_if_1_if_0_rhs [shape=box,label="Integer: 4"];
n0_3_if_1 -> n0_3_if_1_else;
n0_3_if_1_else [label="Block"];
n0_3_if_1_else -> n0_3_if_1_else_0;
n0_3_if_1_else_0 [label="Assignment"];
n0_3_if_1_else_0 -> n0_3_if_1_else_0_lhs;
n0_3_if_1_else_0_lhs [shape=box,label="Identifier: y"];
n0_3_if_1_else_0 -> n0_3_if_1_else_0_rhs;
n0_3_if_1_else_0_rhs [shape=box,label="Integer: 2"];
n0 -> n0_4;
n0_4 [label="Assignment"];
n0_4 -> n0_4_lhs;
n0_4_lhs [shape=box,label="Identifier: z"];
n0_4 -> n0_4_rhs;
n0_4_rhs [label="DIVIDEDBY"];
n0_4_rhs -> n0_4_rhs_lhs;
n0_4_rhs_lhs [label="TIMES"];
n0_4_rhs_lhs -> n0_4_rhs_lhs_lhs;
n0_4_rhs_lhs_lhs [label="TIMES"];
n0_4_rhs_lhs_lhs -> n0_4_rhs_lhs_lhs_lhs;
n0_4_rhs_lhs_lhs_lhs [shape=box,label="Identifier: x"];
n0_4_rhs_lhs_lhs -> n0_4_rhs_lhs_lhs_rhs;
n0_4_rhs_lhs_lhs_rhs [shape=box,label="Integer: 3"];
n0_4_rhs_lhs -> n0_4_rhs_lhs_rhs;
n0_4_rhs_lhs_rhs [shape=box,label="Integer: 7"];
n0_4_rhs -> n0_4_rhs_rhs;
n0_4_rhs_rhs [shape=box,label="Identifier: y"];
n0 -> n0_5;
n0_5 [label="If"];
n0_5 -> n0_5_cond;
n0_5_cond [label="GT"];
n0_5_cond -> n0_5_cond_lhs;
n0_5_cond_lhs [shape=box,label="Identifier: z"];
n0_5_cond -> n0_5_cond_rhs;
n0_5_cond_rhs [shape=box,label="Integer: 10"];
n0_5 -> n0_5_if;
n0_5_if [label="Block"];
n0_5_if -> n0_5_if_0;
n0_5_if_0 [label="Assignment"];
n0_5_if_0 -> n0_5_if_0_lhs;
n0_5_if_0_lhs [shape=box,label="Identifier: y"];
n0_5_if_0 -> n0_5_if_0_rhs;
n0_5_if_0_rhs [shape=box,label="Integer: 5"];
}

BIN
example_output/p2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

83
example_output/p3.gv Normal file
View File

@@ -0,0 +1,83 @@
digraph G {
n0 [label="Block"];
n0 -> n0_0;
n0_0 [label="Assignment"];
n0_0 -> n0_0_lhs;
n0_0_lhs [shape=box,label="Identifier: n"];
n0_0 -> n0_0_rhs;
n0_0_rhs [shape=box,label="Integer: 6"];
n0 -> n0_1;
n0_1 [label="Assignment"];
n0_1 -> n0_1_lhs;
n0_1_lhs [shape=box,label="Identifier: f0"];
n0_1 -> n0_1_rhs;
n0_1_rhs [shape=box,label="Integer: 0"];
n0 -> n0_2;
n0_2 [label="Assignment"];
n0_2 -> n0_2_lhs;
n0_2_lhs [shape=box,label="Identifier: f1"];
n0_2 -> n0_2_rhs;
n0_2_rhs [shape=box,label="Integer: 1"];
n0 -> n0_3;
n0_3 [label="Assignment"];
n0_3 -> n0_3_lhs;
n0_3_lhs [shape=box,label="Identifier: i"];
n0_3 -> n0_3_rhs;
n0_3_rhs [shape=box,label="Integer: 0"];
n0 -> n0_4;
n0_4 [label="While"];
n0_4 -> n0_4_cond;
n0_4_cond [shape=box,label="Boolean: 1"];
n0_4 -> n0_4_while;
n0_4_while [label="Block"];
n0_4_while -> n0_4_while_0;
n0_4_while_0 [label="Assignment"];
n0_4_while_0 -> n0_4_while_0_lhs;
n0_4_while_0_lhs [shape=box,label="Identifier: fi"];
n0_4_while_0 -> n0_4_while_0_rhs;
n0_4_while_0_rhs [label="PLUS"];
n0_4_while_0_rhs -> n0_4_while_0_rhs_lhs;
n0_4_while_0_rhs_lhs [shape=box,label="Identifier: f0"];
n0_4_while_0_rhs -> n0_4_while_0_rhs_rhs;
n0_4_while_0_rhs_rhs [shape=box,label="Identifier: f1"];
n0_4_while -> n0_4_while_1;
n0_4_while_1 [label="Assignment"];
n0_4_while_1 -> n0_4_while_1_lhs;
n0_4_while_1_lhs [shape=box,label="Identifier: f0"];
n0_4_while_1 -> n0_4_while_1_rhs;
n0_4_while_1_rhs [shape=box,label="Identifier: f1"];
n0_4_while -> n0_4_while_2;
n0_4_while_2 [label="Assignment"];
n0_4_while_2 -> n0_4_while_2_lhs;
n0_4_while_2_lhs [shape=box,label="Identifier: f1"];
n0_4_while_2 -> n0_4_while_2_rhs;
n0_4_while_2_rhs [shape=box,label="Identifier: fi"];
n0_4_while -> n0_4_while_3;
n0_4_while_3 [label="Assignment"];
n0_4_while_3 -> n0_4_while_3_lhs;
n0_4_while_3_lhs [shape=box,label="Identifier: i"];
n0_4_while_3 -> n0_4_while_3_rhs;
n0_4_while_3_rhs [label="PLUS"];
n0_4_while_3_rhs -> n0_4_while_3_rhs_lhs;
n0_4_while_3_rhs_lhs [shape=box,label="Identifier: i"];
n0_4_while_3_rhs -> n0_4_while_3_rhs_rhs;
n0_4_while_3_rhs_rhs [shape=box,label="Integer: 1"];
n0_4_while -> n0_4_while_4;
n0_4_while_4 [label="If"];
n0_4_while_4 -> n0_4_while_4_cond;
n0_4_while_4_cond [label="GTE"];
n0_4_while_4_cond -> n0_4_while_4_cond_lhs;
n0_4_while_4_cond_lhs [shape=box,label="Identifier: i"];
n0_4_while_4_cond -> n0_4_while_4_cond_rhs;
n0_4_while_4_cond_rhs [shape=box,label="Identifier: n"];
n0_4_while_4 -> n0_4_while_4_if;
n0_4_while_4_if [label="Block"];
n0_4_while_4_if -> n0_4_while_4_if_0;
n0_4_while_4_if_0 [label="Break"];
n0 -> n0_5;
n0_5 [label="Assignment"];
n0_5 -> n0_5_lhs;
n0_5_lhs [shape=box,label="Identifier: f"];
n0_5 -> n0_5_rhs;
n0_5_rhs [shape=box,label="Identifier: f0"];
}

BIN
example_output/p3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
example_output/tree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB